Plotting dots on a GMAP

Reply
Contributor
Posts: 29

Plotting dots on a GMAP

I have this small snippet of code that generates a map of Denmark.

filename gsasfile  "denmark.gif";

pattern1 v=s c=cx669966 r=1000;

%macro show(cntry,dsn,dsn2,lid1,lid2,type,legend,mode);

proc gmap map=&dd1..&dsn data=&dd2..&dsn2 resolution=AUTO;

id &lid1; choro &lid2/discrete &legend coutline=graycc name="&dsn";

TITLE "HELLO WORLD";

run;

%mend;

%let dd1=mapsgfk;

%let dd2=mapsgfk;

goptions dev=gif transparency gaccess=gsasfile gsfname=gsasfile goutmode=replace xpixels=800 ypixels=800 ftext=simplex

gunit=pct htext=.15in colors= ctext=black;

FOOTNOTE "Country: Denmark";

%show( %str(DENMARK ),%str(DENMARK ),%str(DENMARK_ATTR ),id,idname,solid,nolegend,share);

Would it be possible to plot X/Y dots on the maps (excisting code) - based on gps coordinates? (another example with a non-us country would be very helpfull also!)

Best

Kasper

Grand Advisor
Posts: 10,215

Re: Plotting dots on a GMAP

An example at 31419 - Place symbols at ZIP code locations on a U.S. map might help. The key bits you'd be looking for are the getting latitude and longitude into map coordinates. The example starts by matching selected postal codes to a data set with coordinates, which you wouldn't need. Also the symbol plotted is a star but getting a dot should be easy enough to modify.

Ask a Question
Discussion stats
  • 1 reply
  • 193 views
  • 0 likes
  • 2 in conversation