codeforkansascity / Neighborhood-Dashboard

We're working to help neighborhoods help themselves by giving them easy access to useful data to allow them to identify and track problem areas in their neighborhood.
https://neighborhood-dashboard.codeforkc.org/
MIT License
18 stars 9 forks source link

Crime Data Not Showing Correctly #129

Closed AmandaWilsonKC closed 5 years ago

AmandaWilsonKC commented 7 years ago

It seems that the crime data points on the map don't seem to match up with the numbers in the drop down report. For example, in the financial district, the drop down report says there are 44 homicides in the previous year but the map data shows 7 homicides and only a portion of those were last year.

AmandaWilsonKC commented 6 years ago

Another place for pulling crime data would be the County's GIS. Need to compare data from the County's GIS and the City's open data but i wonder if our app could easily help compare the two??

http://arcgisweb.jacksongov.org/arcgis/rest/services/COMBAT/ViolentCrimePoints/MapServer  Part I Violent Crime (County-wide, dates depend on agency – KCPD data through last week)

http://maps.jacksongov.org/combat/  COMBAT’s web mapping application – it has the Part I Violent Crime data

moldybeats commented 5 years ago

Seems like these Jackson County COMBAT URLs have moved:

https://jcgis.jacksongov.org/combat/combat.htm

https://jcgis.jacksongov.org/arcgis/rest/services/COMBAT/ViolentCrimePoints/MapServer/0

buzwells commented 5 years ago

Since I am already working on the crime tab, I can take a look at this issue. After I close out the https://github.com/codeforkansascity/Neighborhood-Dashboard/issues/142, I will do a deeper dive into the data to try to reconcile our own views internally. Then I will try to compare our data to data from other sites.

buzwells commented 5 years ago

I added some browser console logging today to help illuminate some of the issues. What I found was that map pins often represent multiple offenses, but that is not indicated anywhere on the pin. In a little testing with assaults in one neighborhood, the grouped totals (crime report) showed 12 for 2018, and a query I ran also returned 12 assaults. But only 4 pins dropped on the map due to location overlap. Particularly with crimes, where the locations are simpler (just the intersection), this is going to be true. I only tested with one type of crime (assault), but I'm guessing the same would be true if more than one type of crime occurred. This even challenges the legend a bit (though we could add a pattern for multiple types of crimes).

Here's a screenshot with the above-referenced data. You can see 12 offenses, but only four addresses.

screen shot 2019-02-01 at 6 33 00 pm

How do we want to handle this in terms of both the pin colors and also the popup content? I'm assuming we will want to list all the crimes in the popup, but that could get lengthy.

buzwells commented 5 years ago

Looking more closely at the data, it appears that we are counting each record in the dataset as a crime. But it looks as though there can be multiple rows for a single crime, all linked together by a "report no" field. Each separate row appears to relate to a different person involved in the crime (e.g., suspects, arrestees and victims, identified by the "involvement" field). If this is correct - and I certainly need to do a little more digging on this - then we probably only want to count once for the whole incident.

buzwells commented 5 years ago

I pushed and merged some improvements to the display of crime data:

buzwells commented 5 years ago

Another additional issue: some filter checkboxes are not sending down the right codes (they appear broken), which results in no pins being dropped even when the violations exist.

buzwells commented 5 years ago

There were 4 crime filters that were not working properly because they were not associated with any codes behind the scenes: Sex Offenses (both), Counterfeiting and Domestic Nonviolent. I've made the necessary fixes, including changing the label of "Counterfeiting" to "Forgery/Counterfeiting" to reflect the underlying NIBRS documentation. I will be pushing and deploying the changes shortly.

buzwells commented 5 years ago

Fix has been deployed. Closing this large issue. Will open smaller issues for minor remaining improvements.