Geography datatype #2152
-
PostGIS has a |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
It shouldn't be too difficult to add this. We'll just need a way to tell osm2pgsql in the config file that we want geography instead of geometry columns. We probably also need to check the SRID, because geography types only allow lat/lon SRIDs and we want to give a nice error message instead of failing with an SQL error. I don't have much experiences with the geography type, but I think that's probably it. |
Beta Was this translation helpful? Give feedback.
-
Not to sure about that, if we do want Geography support, it seems more natural to me to implement a generic solution also supporting all other geodetic SRSs PostGIS supports, to have maximum compatibility with PostGIS. Support for other geodetic SRSs than EPSG:4326 was already added back in PostGIS 2.2 according to https://postgis.net/docs/using_postgis_dbmanagement.html#PostGIS_Geography, so should be well established and tested by now. |
Beta Was this translation helpful? Give feedback.
-
Just a note here. This can currently be done using something like this:
But it would be nice to have "official" support for this. If we restrict the use to 4326 projection we can do this:
If we want to allow all lat/lon projections:
or
Any opinions on this? |
Beta Was this translation helpful? Give feedback.
It shouldn't be too difficult to add this. We'll just need a way to tell osm2pgsql in the config file that we want geography instead of geometry columns. We probably also need to check the SRID, because geography types only allow lat/lon SRIDs and we want to give a nice error message instead of failing with an SQL error. I don't have much experiences with the geography type, but I think that's probably it.