omniscale / imposm3

Imposm imports OpenStreetMap data into PostGIS
http://imposm.org/docs/imposm3/latest/
Apache License 2.0
719 stars 157 forks source link

Clip latitude to [90;-90] #106

Open JanJakes opened 8 years ago

JanJakes commented 8 years ago

It seems that Imposm3 produces invalid coordinates from (0 -90) for South pole:

Query SELECT ST_AsText(geometry) FROM osm_destination_points WHERE osm_id = 436012592; results in POINT(-0.00460936092720608 nan).

ImreSamu commented 8 years ago

It seems that Imposm3 produces invalid coordinates from (0 -90) for South pole:

imho :

https://en.wikipedia.org/wiki/Web_Mercator

"Because the Mercator projects the poles at infinity, Google Maps cannot show the poles. Instead it cuts off coverage at 85.051129° north and south. This is not considered a limitation, given the purpose of the service. The value 85.051129° is the latitude at which the full map becomes a square, and is computed as φ given y = 0"

imposm3 ... -srid 3857

+ psql -d imposm3dev -c 'SELECT id,  ST_AsText(geometry) , ST_SRID( geometry)   FROM osm_spoint ;'
    id     |            st_astext            | st_srid 
-----------+---------------------------------+---------
 436012592 | POINT(-0.00460936092720608 nan) |    3857
(1 row)

imposm3 ... -srid 4326

+ psql -d imposm3dev -c 'SELECT id,  ST_AsText(geometry) , ST_SRID( geometry)   FROM osm_spoint ;'
    id     |                   st_astext                    | st_srid 
-----------+------------------------------------------------+---------
 436012592 | POINT(-4.14065937093255e-08 -90.0000000626128) |    4326
(1 row)
sgrossberndt commented 6 years ago

Is this the same issue as https://github.com/omniscale/imposm3/issues/3 ?