Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Create great circles in postgis / cartodb.
The examples given, and the previous answer all depend on taking the line into a planar projection and then segmentizing. As of PostGIS 2.1 (which I think CartoDB is on) you can do a general-purpose job of it using ST_Segmentize(geography), so like this:
ST_SetSRID(ST_MakePoint(-71.060316, 48.432044),4326),
, 10000
FROM mytable;
In words,
make a central point in SRS 4326
make a line between that point and each point in the table
convert that line into the geography type
segmentize in geography space (along the great circle route)
convert that detailed geography back into geometry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.