rveciana / d3-composite-projections

Set of d3 projections for showing countries distant lands together
http://rveciana.github.io/d3-composite-projections/
Other
98 stars 22 forks source link

Try for Malaysia custom projection #9

Closed saifulazfar closed 7 years ago

saifulazfar commented 7 years ago

Sorry noob here trying to create custom composite projection for Malaysia though, i tried to follow the calculations from EquadorMercator but seems my graticule looks ugly,

http://bl.ocks.org/saifulazfar/76053d7a7d420a3a0bc0fb5849006309

FYI world-50m.json also attached with the gist, i recommend you try with the world data also, need advice with the clipping

any help or advise welcome

rveciana commented 7 years ago

The problem with graticule lines is because the two zones of the composite projection overlap. If you look at the projection for Ecuador: http://bl.ocks.org/rveciana/29671e257e9e724d2857f726844777b6 you'll see that the lines can be drawn without problem, because the two zones are completely separated. In your case, you could try separating the two zones a little and set the zone projections to fit the land parts so they don't overlap. If you finish the projection, please tell me, I could add it to the d3-composite-projections so everybody can use it, if you want.

saifulazfar commented 7 years ago

thank you...yes i think i should seperate them rather than overlap

2

By the way how could the mbostock example of AlbersUSA + PR zones of the composite projection overlap? it seems alaska, hawaii and puerto rico drawn into lower48 bounding box...is it because of the alberUsa projection that already on d3.geo? same goes how i try to achieved to as peninsular draw on top of borneo bounding box...is it possible that way?

1

i see all current d3-composite-projection separate the zone, never overlap each other, if there could be possible to overlap that we can just move the inset map as per needs, rather than rework back the whole code, maybe just change the translate value regardless to change the coordinate etc

3

maybe this example could help Circular inset maps for D3

rveciana commented 7 years ago

Graticule lines can create strange effects if the projection area is not clipped properly. But sometimes it may work. I the US, the different zones are very separated, so maybe the meridians and parallels are not twice in the same image, so they don't create these effects.