BookmarkSubscribeRSS Feed
RandoDando
Pyrite | Level 9

I have a shapefile I've downloaded online. I ran the PROC MAPIMPORT statement, no id variable because there isn't one.  The dataset has a X Y variable but they are NOT in degrees.  Values are in the hundreds of thousands, so I have no idea what projection they are using.  Any idea on what options I should enter in the GPROJECT statement to get this converted to degrees?  Here is a snapshot of what the resulting dataset looks like after running PROC MAPIMPORT:

 

  data_shapefile.jpg

 

 

8 REPLIES 8
ballardw
Super User

I might guess that SEGMENT could be used as an ID variable though it doesn't have much meaning as shown.

If you look at your data the first record for Segment=1 has the same coordinates as the last (Obs=5??) which would close a map polygon. Segment=2 does the same. Unless the Segment variable appears with the same values and different X,Y coordinates elsewhere in the data it looks like the Id variable.

 

Maps do not always have anything resembling latitude or longitude degree or other angular measurements.

For instance you might have a shape file for a single building and in the grand scheme of things the X,Y coordinates would be all that is needed as lat/long would not add much for many purposes.

 

Did that source have any of the associated information files like DBF or SHX that would provide additional information?

RandoDando
Pyrite | Level 9
Yes, this was in a zip file containing a shp, shx, prj, and dbf file. All files were unzipped to same folder before importing the shp file.
GraphGuy
Meteorite | Level 14

You might be able to look in the .prj file (of the shapefile) and determine what projection was used, and then that might tell you what from= to use with proc gproject so that you can get regular unprojected lat/long values. See an example in my old blog: https://blogs.sas.com/content/sastraining/2017/10/17/rdu-airport-vs-surrounding-parks-and-nature/

 

Or ... it almost looks like those x/y values are long/lat values that have been multiplied by 10,000.

 

RandoDando
Pyrite | Level 9
Thanks..

I tried using the link you provided in your blog post to prj2epsg and it is
no longer up. Do you know of another way to get the projection?
GraphGuy
Meteorite | Level 14

Looks like the people hosting that page don't host it anymore (see some discussion here: https://gis.stackexchange.com/questions/372381/is-there-an-alternative-to-prj2epsg-org)

 

A Google search turned up this page. I haven't tried it, and of course "your mileage may vary" 🙂

https://prj2epsg.azimap.com/search

 

RandoDando
Pyrite | Level 9
Thanks. I will try that tomorrow and let you know.

In the meantime, is EPSG:4326 the projection to enter in the To= in order
for this to overlay with USCounties?
GraphGuy
Meteorite | Level 14

That's the coordinate system that most of the SAS maps (and most other maps you'll be working with) use.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 1593 views
  • 2 likes
  • 4 in conversation