[josm-dev] Validator plugin working differently for each projection

Pieren pieren3 at gmail.com
Wed Dec 3 22:04:47 GMT 2008


Hi,

I'm currently investigating why the Validator plugin raises a memory
heap overflow when the projection "Lambert Zone" is in use in JOSM.

I discovered that some classes use east,north coordinates for geometry
validation like for ways overlapping or coastline checker.

For ways overlapping, the validator builds a list of cells inside a
"grid" (getSegmentCells() in Util.java) which are concerned by a
segment (two nodes).
The problem is that the method needs a "grid detail" factor which
defines the grid granularity based on the east,north values. This grid
detail is hardcoded at 10000 in CrossingWays.java.

I've checked what is happening for the same segment checked in
different projections:

Given the following segment (two Nodes):
n1 = LatLon[lat=47.7763433,lon=7.3530963]
n2 = LatLon[lat=47.7770473,lon=7.3574774]

- with EPSG:4326:
n1 = EastNorth[e=7.3530963, n=47.7763433]
n2 = EastNorth[e=7.3574774, n=47.7770473]
the size of the list of cells returned is 52        (in maxSteps)

- with Mercator:
n1 = EastNorth[e=0.12833574065121273, n=0.9516457013066892]
n2 = EastNorth[e=0.12841220527107183, n=0.9516639851138439]
the size of the list of cells returned is 2

- with Lambert Zone (France):
n1 = EastNorth[e=975734.9758213528, n=320536.1338515263]
n2 = EastNorth[e=976057.6719212476, n=320635.2011935329]
the size of the list of cells is theoritically 4217635 (thus the
memory heap overflow)

I need some advice from the experts here to see how we could make the
validator independant of the projection.
For instance, I don't know if the grid detail of 10000 was originally
fixed for EPSG:4326 or Mercator, means if the size of the list should
be 2 or 52.
Shall we adapt the grid details for each projection then to have a
constant size of cells ? Or stop working with east,north ?

Thanks,
Pieren




More information about the josm-dev mailing list