Wednesday, 2 November 2016

postgis - Making Great Circle Arcs which look good on Web Mercator map?


I'm trying to create a map, with data indicating some flights, and want to use Great Circle Arcs, to connect the source and destinations.



Basically, I want to do something similar to the famous Facebook map: enter image description here


I used the functions given in this post: https://gis.stackexchange.com/a/5205/442, (i.e. this blog article: http://anitagraser.com/2011/08/20/visualizing-global-connections/) and I could get lines, but they cross the International Date Line, as well as bunch up, at the poles:


enter image description here


@underdark, has mentioned in the linked blogpost that these lines need need to be split, but I don't know how to split them automatically in PostGIS.


Additionally the bunching of the lines near the poles need to be resolved as well.


How do I do both of these, when I have the point locations for start and end of these flights?



Answer



The principles in this blog post transfer over to general purpose PostGIS.


http://blog.cartodb.com/jets-and-datelines/


Basically, use ST_Segmentize on geography, and a bit of magic to slice date-line crossing lines.



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...