Does the GeoJSON spec imply or strongly suggest that PostGIS geometry type should be used over geography?

Looking at section 3.1.1 I am seeing that

In other words, every point on a line that does not cross the antimeridian between a point (lon0, lat0) and (lon1, lat1) can be calculated as

F(lon, lat) = (lon0 + (lon1 - lon0) * t, lat0 + (lat1 - lat0) * t)

with t being a real number greater than or equal to 0 and smaller than or equal to 1.

This would seem to assume a flat/cartesian coordinate reference system? Otherwise, the points should lie along a great circle arc?

  • 1
    The two are unrelated. On one hand there are the 2 PostGIS storage types (geometry and geography), on the other hand there is the GeoJson exchange format. You can cast between them and the app reading the GeoJson can do whatever it wants with the contained features. Similarly you can do computations as you wish in PostGIS and create a GeoJson output from it. (ex: compute length between two airports using Geography, save the starting/ending point in a GeoJson, send to a web app which reads it and construct the great circle line OR a straight line) – JGH Feb 18 at 14:47
  • 1
    PostGIS utilizes the same internal export function, after checking options, for both function signatures of ST_AsGeoJSON; in either way, the export will conform with the standard. – geozelot Feb 18 at 14:55
  • 1
    To add to what @ThingumaBob said, it is a meaningless difference once it is GeoJSON, which is simply a human-readable transfer format/specification. It makes a difference in Postgis, as some functions behave differently (or don't exist) in Postgis. – John Powell Feb 19 at 9:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.