Data visualization with SAS programming

Geocoding: Subset Strret Lookup data for Missouri

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 99
Accepted Solution

Geocoding: Subset Strret Lookup data for Missouri


Hi all,

           The street look up data provided by SAS for use with proc geocode is huge. I am only intersted in doing street geocoding for Missouri. Is their a way to subset that data.

   I appreciate your help.

Best Regards,

Amit


Accepted Solutions
Solution
‎08-09-2012 01:21 PM
SAS Employee
Posts: 23

Re: Geocoding: Subset Strret Lookup data for Missouri

I assume you are referring to the nationwide street lookup data containing all of the US states. It is possible to subset those data sets but there is not a SAS-supplied utility for doing so. You'd have to write it. Subsetting the USM data set for only Missouri is easy. However, if you'd want to remove non-Missouri observations from the associated USS data set, you'd have to redo the FIRST and LAST values in USM which are row number links into USS. Then to subset the USP data set, you'd also have to update the START row numbers in the USS data set. While possible, it would take a while to code and debug.

A more straightforward approach would be to download the TIGER data for Missouri and use the TIGER2GEOCODE.sas program from MapsOnline to import it. You will need the EDGES, FACES and FEATNAMES files for all of the counties in Missouri. On the Geocoding page (http://support.sas.com/rnd/datavisualization/mapsonline/html/geocode.html), download the TIGER2GEOCODE.zip file which includes that SAS program. Instructions are in the program comments at the top of the file. SAS Technical Support can provide assistance if needed. I hope this helps.

View solution in original post


All Replies
Solution
‎08-09-2012 01:21 PM
SAS Employee
Posts: 23

Re: Geocoding: Subset Strret Lookup data for Missouri

I assume you are referring to the nationwide street lookup data containing all of the US states. It is possible to subset those data sets but there is not a SAS-supplied utility for doing so. You'd have to write it. Subsetting the USM data set for only Missouri is easy. However, if you'd want to remove non-Missouri observations from the associated USS data set, you'd have to redo the FIRST and LAST values in USM which are row number links into USS. Then to subset the USP data set, you'd also have to update the START row numbers in the USS data set. While possible, it would take a while to code and debug.

A more straightforward approach would be to download the TIGER data for Missouri and use the TIGER2GEOCODE.sas program from MapsOnline to import it. You will need the EDGES, FACES and FEATNAMES files for all of the counties in Missouri. On the Geocoding page (http://support.sas.com/rnd/datavisualization/mapsonline/html/geocode.html), download the TIGER2GEOCODE.zip file which includes that SAS program. Instructions are in the program comments at the top of the file. SAS Technical Support can provide assistance if needed. I hope this helps.

Super User
Posts: 11,124

Re: Geocoding: Subset Strret Lookup data for Missouri

I'm not familiar with the structure of that data but generally any place you reference a dataset you can use the WHERE dataset option to only include data of interest.

It would look something like:

lookup= geocodedatasetname (where=(State='MO'))   if state were to use the 2 letter abbreviation.

The name of the variables in the where option are from your data.

If you are only doing a few cities it possibly could look like:

(where = (State='MO' and city in ('City name 1', 'City name 2'...)   the case and spelling of the city name in this clause would have to match what is in the data.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 266 views
  • 0 likes
  • 3 in conversation