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.
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?
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
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
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.