July2014.CSV (642 KB)
Good stuff. Would be interesting to break this down by type of crime and then create a Manipulate that let you select the crime type. Also, I note there’s a time stamp on the crime in the original data. If the time stamp could be parsed, there might be a useful Numb3ersish animation lurking here.
I added date filed to data:
data = data[[All, {1, 3, 9, 11, 19, 20}]];
and create sorted subdata:
dataset = dataset[All, Append[##, "GeoPosition" -> (GeoPosition[GeoGridPosition[{Quantity[#XCoord, "Feet"], Quantity[#YCoord, "Feet"]}, projection]])] &]
subdata = dataset[SortBy[#DateOccur &], {"DateOccur", "Description", "GeoPosition"}];
By crime type:
desc = Normal[subdata[All, "Description"] // Union];
Manipulate[
GeoGraphics[{Red, Opacity[.4], AbsolutePointSize[5], Point[#]} & /@
Normal[subdata[Select[description === #Description &]][All,
"GeoPosition"]],
GeoRange -> {{38.5355, 38.7697}, {-90.3991, -90.1004}},
ImageSize -> Large], {description, desc}]
By time stamp:
Manipulate[
GeoGraphics[{{Red, Opacity[.4], AbsolutePointSize[5], Point[#]} & /@
Normal[subdata[1 ;; time, "GeoPosition"]]}, ImageSize -> Large,
GeoRange -> {{38.5355, 38.7697}, {-90.3991, -90.1004}}], {time, 1,
Length[subdata], 1}]
This is great!
I shared this exercise with my students taking a course on statistics and they grasped pretty well the value of linked data.
Thanks
J. Rico
This an animated GIF made from Jaebum’s Manipulate code:
imgs = Table[
GeoGraphics[{{Red, Opacity[.4], AbsolutePointSize[5], Point[#]} & /@
Normal[subdata[1 ;; time, "GeoPosition"]]}, ImageSize -> Large,
GeoRange -> {{38.5355, 38.7697}, {-90.3991, -90.1004}}], {time,
1, Length[subdata], 100}];
Export["test.gif", imgs, ImageSize -> 400]

Hi,
This a great example. I tried to copy this example on my own data. It works fine. The only issue I’ve is that there is not a kind of refresh of the image after each day. So, when a bullit is highlited, it stays highlited even that specific object it’s not active on that day. Who has a solution for this issue?
Thanks Michiel
– you have earned Featured Contributor Badge ![]()
Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!
