BookmarkSubscribeRSS Feed
Kaushansky
Obsidian | Level 7
I have a crime lat and Long file and would love to map the crime stats at the street level? What is the best approach?
7 REPLIES 7
Kaushansky
Obsidian | Level 7
Hi there.
I’m using desktop SAS 9.4 and have SAS Studio 3.8

AhmedAl_Attar
Rhodochrosite | Level 12

@Kaushansky 


@Kaushansky wrote:
Hi there.
I’m using desktop SAS 9.4 and have SAS Studio 3.8

Hmm, to my knowledge, in this case you are limited to SAS/GIS (if licensed) and maybe Proc Geocode!?

 

Quentin
Super User

There is an article on reverse geocoding here:

https://communities.sas.com/t5/SAS-Communities-Library/Reverse-Geocoding-Using-PROC-GINSIDE/ta-p/895...

 

I would think that would be good for, say, mapping lat and long to state level, or county level, because a polygon can represent a state or county.   Not sure how well it would work for mapping to a street.

 

I guess another option would be to use a google maps API or similar to do the lookups.

 

I also stumbled across this solution, which uses an R package to reverse geocode, and looks like it will look up street addresses.  https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-do-reverse-geocoding-in-SAS/td-p/342193

BASUG is hosting free webinars Next up: Mark Keintz presenting History Carried Forward, Future Carried Back: Mixing Time Series of Differing Frequencies on May 8. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
Kaushansky
Obsidian | Level 7

Thanks but that did not work. Here is the dataset I have (attached). In terms of SAS I have Proc Map and Proc GIS loaded.

 

What is the best way top map by zipcode?

Quentin
Super User

If you go to lexjansen.com index of user group papers, there are lots of papers about mapping by zipcode:

https://www.lexjansen.com/search/searchresults.php?q=map+zipcode

 

This isn't something I do, so can't recommend a specific approach.

BASUG is hosting free webinars Next up: Mark Keintz presenting History Carried Forward, Future Carried Back: Mixing Time Series of Differing Frequencies on May 8. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
GraphGuy
Meteorite | Level 14

Someone mentioned SAS/GIS - that would probably be the best SAS solution for this type of thing ... but it was never finished, and the current version of the software has been 'frozen' (no new decelopment) for many years, and it would be difficult to find expertise/advice/examples to help you with that.

 

You could plot lat/long crime data on streetmaps using SAS/Graph Proc Gmap, but it's a bit cumbersome (you have to download all the map tiles, and stitch them together, and then get a bit tricky to annotate your data onto the map tile images).

 

SAS Proc SGmap makes overlaying lat/long data onto streetmaps very simple - that's what I would recommend. I put an example in a blog that might get you started (sample code at bottom of the blog): https://blogs.sas.com/content/graphicallyspeaking/2021/08/17/cary-nc-data-fire-incidents/

 

cary_fire.png

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 668 views
  • 4 likes
  • 4 in conversation