Dear all,
am tring to create a map using sgmap. I realise the polygons are overlaping. I have being tring to findout what am doing wrong but haven't been successful. Please any help. Here is my code
proc sgmap mapdata=germany maprespdata=myplotdata rattrmap=rattrmap
plotdata=myplotdata;
openstreetmap;
choromap sum_of_cases /mapid=id id=id transparency=0.5 leveltype=interval numlevels=4 attrid=myid name="map";
gradlegend "map" / position=right notitle;;
run;
and the result is attached:
I also get this warning:
WARNING: Some of the regions in the map contain multiple classification values. Only the first value is will be displayed.
Hello,
I am not a specialist with all that is "maps"-related.
But could it be that your problem is the same as the one that was described (and solved!) here?
How to remove extraneous lines in map of Mexico?
https://communities.sas.com/t5/Graphics-Programming/How-to-remove-extraneous-lines-in-map-of-Mexico/...
Koen
Yes, its similar. Let me try that and see.
Thanks
Dear all,
I wasn't sucessful with that solution. I will be glad if anyone can help
The error message probably means that your response dataset (maprespdata=myplotdata) has multiple response/choro values (sum_of_cases) for some of the map areas.
A 'quick fix' might be to do something like this, and use the new dataset:
proc sql noprint;
create table myplotdata_unique as
select unique id, sum_of_cases
from myplotdata;
quit; run;
But you should really investigate and determine why you have multiple observations for your id's.
@sbxkoenk I could solve the problem this way;
proc sql;
create table germany_rlp as select a.*, b.idname from mapsgfk.germany(drop=x y) a natural join mapsgfk.germany_attr b
where id1 = "DE-07";
create table respdat_rlp as select id as id, mean(long) as longc, mean(lat) as latc, min(idname) as idname from
germany_rlp group by id;
quit;
proc sgmap mapdata=germany_rlp maprespdata=respdat_rlp plotdata=myplotdat;
openstreetmap;
choromap/ mapid=id;
bubble x=longc y=latc size= no_of_cases/ bradiusmin=2px bradiusmax=10px datalabel=idname
datalabelattrs=(color=red size=3px style=italic);
run;
this is the result I got
My question is how can I make the selected region larger to cover a larger area of the map
The background map area is automatically selected to accommodate all the map areas and bubbles you're drawing. Therefore you'll need to eliminate the 'bubbles' from your data, in the areas you do not want to show.
@GraphGuy actually I will like to display those outside the selected region also but the emphasis is on the selected region
something similar to this. Just that the bubbles can also be outside the selected region
Keep the bubbles for the areas of the map you want shown.
Delete the bubbles out of your dat for the areas of the map you do not want shown.
There is no other way provided to subset/restrict the area of the background map shown.
ok, thanks. I will try that
Perhaps it would be better to open a separate topic/thread for each of your requests.
Yes, I can , I thought It's all about the same graph. That is why I open just a a thread
@GraphGuy I have opened two threads for that. I hope it's okay
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.