Opened 10 years ago

Last modified 7 years ago

#3121 new defect

way_area might get zero when using 4326

Reported by: TobWen Owned by: jburgess777@…
Priority: major Milestone:
Component: osm2pgsql Version:
Keywords: Cc:


When using projection 4326 on osm2pgsql import, way_area might get zero if it's too small. This can mess up sorting.

Possible solutions:

  1. multiplicate with 10.000 (or anything big),
  2. calculate way_area using 900913,
  3. calculate way_area on psql


  1. is a bad workaround,
  2. is hard to implent, since GEOS uses already projected coordinates,
  3. is somehow slow and uses triggers

Change History (4)

comment:1 Changed 10 years ago by Ldp

I'd prefer if way_area was consistently correct, independent of the projection. If we start making more rendering decisions based on polygon size, it needs to make the same decisions for both 900913 and 4326.

comment:2 Changed 10 years ago by Ldp

Owner: changed from jburgess to jburgess777@…

comment:3 Changed 10 years ago by TobWen

I've done some calculations directly using spheroid geometry (geodetic on WGS84). It's valid all over the globe, even on very big polygons. The problem is the area is built up by GEOS when the coordinates are projected already. So I never can grab the original coordinates calculate the geodetic area ;-(

comment:4 Changed 7 years ago by Andy Allan

Component: mapnikosm2pgsql
Note: See TracTickets for help on using tickets.