11-13-2012 09:09 AM
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.
11-13-2012 09:19 AM
Not really an area where I can be of much help, but does the following SAS sample and SUGI paper provide any direction?:
11-13-2012 10:54 AM
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.
11-13-2012 11:02 AM
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...
11-13-2012 11:21 AM
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 *
11-13-2012 11:23 AM
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.
11-13-2012 11:30 AM
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!