0

I'm trying create custom maps to Russia in Visual Analytics. So, I've faced with a trouble of "separated region".
You can see a visualization of this problem by using Dal'nevostochnyy (DVFO) region from MAPSGFK library. enter image description here

I tried to fix the scatter by this code:

data mps.vaasia1;
set mps.vaasia1;
if LONG < 0 and isoalpha2="RU" then long=long+360 ; 
run;

And so I get this result (on picture imaged region Chukotka, but it dosen't matter):

enter image description here It's better then previous situation, but it's look like crutch.
I've try to combine this two polygons by using GREMOVE (also add paramether FUZZ), but result was as the same.

UPD:
I use this code to get coordinates:

data ch;
set mapsgfk.Russia;
where id ="RU-77" ;
if LONG LE 0 then  long=long+360 ; 
x=long ;
y = lat;
run;

enter image description here

So my question is:
How can I delete space between two separated regions?

Thx for your answers / comments.

Sanek Zhitnik
  • 716
  • 1
  • 10
  • 25

2 Answers2

2

This seems to work, at least for the specific issue. The issue is that the segment is not the same for these, so they get a border. Doing this in a more general way I'm not sure if there's a good way or not; there probably is a better way, perhaps using GPROJECT, that would avoid the issue entirely.

But this works, at least for this specific issue...

data vaasia1;
set mapsgfk.asia1;
if LONG LE 0 and isoalpha2="RU" then do;
  long=long+360 ; 
  if segment=2 then segment=1;
  else if segment=7 then segment=8;
end;
if idname =: 'Dal';
*if long le 0;
run;


proc gmap data=vaasia1 map=vaasia1;
id id;
choro id/nolegend;
run;
quit;
Joe
  • 62,789
  • 6
  • 49
  • 67
0

Thanks @Jor for you post. Your answer pushed me to thought: "May be I can't merge two poligons because they don't have common points?". So, I saw task like this:

  1. Remove points between polygons (Red squares in picture below)
  2. Set edge's polygons dots coordinates equal (Blue arrows)

enter image description here

data ch
/*Drop out dots with coord in red squares*/
(where=(not(lat > 66 and lat <68 and long >179 and long<181) ));
set mapsgfk.Russia;
where id ="RU-77" ;

if LONG LE 0 then  long=long+360 ; 

/*Set coordinates of near edge's points the same*/
if (long > 179.9 and long < 180.3) then do; 
    long =180;
    if (lat > 68.9 and lat < 69) then lat=68.97;
    if (lat > 65 and lat < 65.1) then lat=65;
    if (lat > 70.9 and lat < 71) then lat=70.95;
    if (lat > 71.5 and lat < 71.6) then lat=71.55;
end;

x=long ;
y = lat;
run;

proc gremove data=ch out=ch;
by id;
id id1;
run;


proc gmap data=ch map=ch;
id id;
choro id/nolegend;
run;
quit;

Result: enter image description here

Community
  • 1
  • 1
Sanek Zhitnik
  • 716
  • 1
  • 10
  • 25