BookmarkSubscribeRSS Feed
iznally
Calcite | Level 5

Hi all,

I'm trying to create the following map:

First layer:      SAS map.germany via proc gmap.    

Second layer:  imported shapefile (german lakes) - it can be displayed on top of the map by using the annotate poly & polycont function.

But the problem is: the coordinates don't match. I've tried two ways to solve this:

1) The SAS map has projected (Albers) coordinates in meter. If I use gproject to project the imported shapefile in the same projection, I'll get the coordinates in radians, not in meter.

2) If I project the shapefile in ArcMap before importing it into SAS, I get different meter values. (SAS map: 3xxxxxx,6xxxxxx. Imported Shapefile: -1xxxxx, 2xxxxxx) Tried Albers, Lambert and Equal Conic - all with the same result.

How can I get these two datasets in the same coordinate system, so that they can be mapped together?

Any help would be appreciated.

7 REPLIES 7
iznally
Calcite | Level 5

Thanks Arthur, but unfortunately that's not what I need in this case.

ballardw
Super User

I don't know if this will help but when I was using two different map sources it worked better to combine the data with the coordinates (latitude and longitude) before projection and then separate the parts out after.

iznally
Calcite | Level 5

Hhmm nice thought, but the problem is the SAS germany map is already projected - unfortunately SAS doesn't provide a map dataset for germany containing lat/long values as far as I know...

art297
Opal | Level 21

The first link I included contained the following comment in the code:

* THIS PROGRAM USES MAPS.GERMANY SAS RELEASE 9.2               *

* Given a dataset containing city names and latitude longitude *

* it can easily be annotated onto a map whose coordinates are  *

* also  in latitude and longitude.                             *

* However, if the desire is to include, in the dataset, the    *

* region or province within which a city falls, one can        *

* accomplish this with GINSIDE...as this sample shows          *


					
				
			
			
				
			
			
			
			
			
			
			
		
ballardw
Super User

Interesting. When I look at the MAPS library supplied in my version of SAS 9.2 the Germany data set has LAT and LONG with the unit in radians. X and Y are the Lambert projected longitude and latitude from the variable labels.

Maybe time to visit the SAS tech support downloads and see if other versions of the files are available.

The online example program GPJANNOT for GPROJECT shows conversion from degrees to radians.

iznally
Calcite | Level 5

You are right! I seemed to have lost these lat/long values somewhere on the way... Ok, now I can try the combined projection - thanks a lot!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1032 views
  • 3 likes
  • 3 in conversation