[osmosis-dev] bounding-polygon dismisses points at +180° longitude

WanMil wmgcnfg at web.de
Tue Jun 14 18:00:19 BST 2011


Although I wrote to Brett directly that extending the polygon to 181° 
works I have observed that is works only for osm input but not for pbf 
input.

osmosis --read-pbf file=180.osm.pbf --bounding-polygon file=asia.poly 
--write-xml file=filtered.osm
throws an exception:

SCHWERWIEGEND: Thread for task 1-read-pbf failed
java.lang.IllegalArgumentException: Bound coordinates outside of valid range
         at 
org.openstreetmap.osmosis.core.domain.v0_6.Bound.<init>(Bound.java:72)
         at 
org.openstreetmap.osmosis.areafilter.v0_6.PolygonFilter.simpleBoundIn
tersect(PolygonFilter.java:118)
         at 
org.openstreetmap.osmosis.areafilter.v0_6.PolygonFilter.process(Polyg
onFilter.java:71)
         at 
org.openstreetmap.osmosis.core.container.v0_6.BoundContainer.process(
BoundContainer.java:59)
         at 
org.openstreetmap.osmosis.areafilter.v0_6.AreaFilter.process(AreaFilt
er.java:116)
         at 
crosby.binary.osmosis.OsmosisBinaryParser.parse(OsmosisBinaryParser.j
ava:245)
         at crosby.binary.BinaryParser.handleBlock(BinaryParser.java:64)
         at crosby.binary.file.FileBlock.process(FileBlock.java:135)
         at 
crosby.binary.file.BlockInputStream.process(BlockInputStream.java:34)

         at crosby.binary.osmosis.OsmosisReader.run(OsmosisReader.java:37)
         at java.lang.Thread.run(Unknown Source)
14.06.2011 18:56:20 org.openstreetmap.osmosis.core.Osmosis main
SCHWERWIEGEND: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more 
tasks failed
.
         at 
org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForComple
tion(Pipeline.java:146)
         at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:92)
         at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at 
org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Laun
cher.java:329)
         at 
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:239)
         at 
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
         at 
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
         at org.codehaus.classworlds.Launcher.main(Launcher.java:31)


So the pbf parser should be changed.

WanMil

> I'm surprised nobody has brought this up before :-)  It's always been a
> limitation of the polygon task.
>
> Osmosis uses the Java 2D libraries to do the polygon calculations.
> Please read the "Definition of insideness" in the following link which
> explains why you're seeing this issue.
> http://download.oracle.com/javase/6/docs/api/java/awt/Shape.html
>
> We have no way of changing the functionality of the inbuilt java
> libraries we're stuck with this one.
>
> I wonder if we should even have points existing on both 0 and 180
> longitudes in the database given that they're the same location.
> Perhaps a number of tools rely on it though.
>
> Can you modify your polygon to extend to 181°?  I don't think I've ever
> tried it, but it should work in theory.
>
> On Tue, Jun 14, 2011 at 7:04 AM, WanMil <wmgcnfg at web.de
> <mailto:wmgcnfg at web.de>> wrote:
>
>     Hi,
>
>     today I tried to cut out the data of asia from a planet file using
>     the attached asia.poly file.
>     Osmosis is doing fine with the exception that the points at +180°
>     longitude are missing.
>
>     I created a little test osm file (180.osm) with one node at +180°
>     and it's removed by the asia.poly polygon.
>
>     This is a real problem because there are (a few) points which really
>     lie on the +180° longitude, e.g.
>     http://www.openstreetmap.org/__browse/node/1113705746
>     <http://www.openstreetmap.org/browse/node/1113705746>
>
>     Without this node there are problems to calculate the multipolygon
>     of the russian country. So there is a specific need for that.
>
>     Can you change the osmosis behaviour so that +180° longitude is
>     supported?
>
>     WanMil
>
>     _______________________________________________
>     osmosis-dev mailing list
>     osmosis-dev at openstreetmap.org <mailto:osmosis-dev at openstreetmap.org>
>     http://lists.openstreetmap.org/listinfo/osmosis-dev
>
>




More information about the osmosis-dev mailing list