- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
I am trying to use sas mapsgfk.world dataset. I have a separate dataset where latitudes and longitudes are collected in decimal degrees. Mapsgft.world has LONG, LAT, X and Y variables.
The values in LONG, LAT doesn't match entirely with the dataset I have.
Ex: From within united states, I have co-ordinates longitude: -164.7520065 and latitude:64.4912815 in my dataset however, this does not match any latitude longitude co-ordinates from mapsgfk.world so I can use these as id variables in proc gmap.
Any thoughts please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The maps data set is a boundary file designed to map the world entirely, it doesn't have every point mapped.
What are you trying to do that you think will not work?
Have you tried a basic SGMAP to visualize your data?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have not used proc sgmap.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
https://support.sas.com/rnd/datavisualization/mapsonline/html/geocode_gmap.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
My dataset:
Common_name lat long bucket
Bar-tailed Godwit 64.4912815 -164.7520065 5
Bar-tailed Godwit 37.0946519 -122.2786759 1
Bar-tailed Godwit 34.6303 -76.5328 1
Bar-tailed Godwit 44.5088097 -124.0803623 1
Bar-tailed Godwit 41.373717 -112.133503 1
Bar-tailed Godwit 46.516505 -124.027205 1
CODE:
proc format;
value bucket 1 = "<=5"
2 ="<=10"
3 ="<=15"
4 ="<=20"
5 =">20"
;
run;
%let name=us;
filename odsout '/sasuserhome/stok';
ODS LISTING CLOSE;
ODS HTML path=odsout body="&name..htm"
(title="Godwit migration")
style=sasweb;
goptions border;
goptions cback=CXFFFFFF ctext=black;
goptions xpixels=900 ypixels=600;
pattern1 value=solid color=CX60497B;
pattern2 value=solid color=CXE5E0EC;
pattern3 value=solid color=CXCCC0DA;
pattern4 value=solid color=CXB2A1C7;
pattern5 value=solid color=RED;
goptions gunit=pct htitle=6 ftitle="Calibri/Bold" htext=2.7 ftext="Calibri";
legend1 label=none shape=bar(3,1) value=(justify=left "<=5" "<=10" "<=15" "<=20" ">20" )
across=1 origin=(75,12) mode=share;
title1 lspace= 5 "Migration";
proc gmap data=birds map=mapsgfk.world all;
id long ;
choro bucket/ midpoints=1 2 3 4 5 coutline=black legend=legend1 des="First" name="FY2021" ;
run;
ODS HTML CLOSE;
ODS LISTING;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
https://blogs.sas.com/content/graphicallyspeaking/2019/05/14/geocoding-us-street-addresses-and-plott...
If not, I think this is the closest example I can find to what you're trying to do and should have everything you need to follow along.
Map:
https://robslink.com/SAS/democd16/office.htm
Code:https://robslink.com/SAS/democd16/office.sas
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Tommer wrote:
Posted the code above. Any idea if I am doing something terribly wrong?
Using LONG as an ID variable.
If you examine the map data set the ID variable is using a two letter country abbreviation as the ID, i.e. AD for Andorra.
So none of your Long values will match the ID in the map data set.
I don't know what you may have used before but with this map data set you would have to provide an ID that matches. Which means doing some Geocoding to get the the country code to add to the summary values before mapping.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Is it possible to drill down to specific location within country?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Tommer wrote:
Thanks ballardw, I added the ID variable in my dataset too for country code and I could generate the map. However, what I was looking for is drilling down to specific location within the country. Using country code as ID, it helps in showing the data for country but not for specific location within the country. Hence, I was using ID variable as LONG.
Is it possible to drill down to specific location within country?
Specific location within an area in Gmap usually means an Annotate data set. You add some extra variables to describe what you want to appear, such as marker size and shape and/or text, along with the coordinates to place the information.
There are a number of examples at https://support.sas.com/sassamples/graphgallery/PROC_GMAP_Graph_Elements_Annotation.html
Example Sample 24906 shows placing city markers and names on a world map using the Maps.world map data set. Similar should be an easy transfer the the GFK version if you use the LATLON option you wouldn't need to project your coordinates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content