Data visualization with SAS programming

how do i get lat/longs from my GIS shape file?

Reply
Occasional Contributor
Posts: 5

how do i get lat/longs from my GIS shape file?

[ Edited ]

I am a novice with GIS files, and was given my first SHAPE file as one of my inputs for my analysis investigation. The first thing I like to do is to get convert/input data to SAS format.  So I ran Proc Mapimport and now Have over a million records describing the boundaries and shapes for my 53K properties of interest. 

 

My SAS file contains data given to me describing one county in the US -which ought to match what I'd pull myself from SAS's Tiger Shape files from the census - but I wish to start with what my client sent me.    my SAS file shows me Parcel ID's with  x and y values.  But i do not know what sort of projection system SAS proc mapimport used to produce their geographic coordinate system

 

Mapping systems are complicated -- as I understand that one location on the ground will have many different latitude-longitude values depending on which geographic coordinate system is used.   does SAS have code to run to produce the geographic (datum) transformations to reconcile the x and y's to lat/longs

 

  I am not clear on the dimension or unit of measurement that i starting with.  Found a conversion macro UTM2latlong  but when i input the x an y from proc mapimport,  the macro gave me values not in in the proper part of the US -- so i must not have started with X and Y (in meters).  when I look on the  ArcGIS website I see there are ways to export a raster to a netCDF file.    is that what I have ?  Raster cell values are exported as a netCDF variable? 

 

geez - this area is new to me - i am struggling simply to pose my question to this forum!  yikes!

 

Respected Advisor
Posts: 4,606

Re: how do i get lat/longs from my GIS shape file?

First thing to try is to chose another UTM zone

 

%UTM2latLong(dsn,y=Y,x=X,zone=16N);

PG
SAS Employee
Posts: 170

Re: how do i get lat/longs from my GIS shape file?

First, Proc MAPIMPORT just takes the same coordinates that was in the shapefile.  It just converts the shapefile into a SAS Date set.  (Note, you may need to use the ID statement.  See the doc and examples).

Second, If you are using MAPS for your map it is likely in Radians.  If you are using the newer MAPSGFK maps, then it is in Degrees.  The shapefile is probably in Degrees.

Third, you need to know what projection your shapefile is in.  It may be unprojected.  In that case, you would need to take your MAPS or your MAPSGFK data as unprojected too (MAPS must be converted to degrees).  Use Proc GPROJECT to project your data.  You need to combine both the maps and the coordinates together.

 

 

Occasional Contributor
Posts: 5

Re: how do i get lat/longs from my GIS shape file?

[ Edited ]

UTM zone -- yes that was one of my questions when i found the macro.

OK  - after googling what a UTM zone is -- and finding the 2 digit numeric that matches the county and state I am interested in,

I put that code in the macro and

and getting closer.     my latitudes are now in the right ballpark -- but the longitudes are still off.

 

does the alph in the third position of the UTM code refer to the positioning system.  I see N and S and others to verify...

 

 

 

Ask a Question
Discussion stats
  • 3 replies
  • 334 views
  • 1 like
  • 3 in conversation