Help using Base SAS procedures

Projection issue when using SAS Map dataset and imported shapefile

Reply
Occasional Contributor
Posts: 8

Projection issue when using SAS Map dataset and imported shapefile

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.

PROC Star
Posts: 7,356

Re: Projection issue when using SAS Map dataset and imported shapefile

Not really an area where I can be of much help, but does the following SAS sample and SUGI paper provide any direction?:

http://support.sas.com/rnd/datavisualization/mapsonline/html/ginside_germany.html

http://www.sascommunity.org/sugi/SUGI87/Sugi-12-89%20Chojnacky%20Tymcio.pdf

Occasional Contributor
Posts: 8

Re: Projection issue when using SAS Map dataset and imported shapefile

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

Super User
Posts: 10,466

Re: Projection issue when using SAS Map dataset and imported shapefile

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.

Occasional Contributor
Posts: 8

Re: Projection issue when using SAS Map dataset and imported shapefile

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...

PROC Star
Posts: 7,356

Re: Projection issue when using SAS Map dataset and imported shapefile

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          *


					
				
			
			
				
			
			
			
			
			
			
			
		
Super User
Posts: 10,466

Re: Projection issue when using SAS Map dataset and imported shapefile

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.

Occasional Contributor
Posts: 8

Re: Projection issue when using SAS Map dataset and imported shapefile

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!

Ask a Question
Discussion stats
  • 7 replies
  • 354 views
  • 3 likes
  • 3 in conversation