#20971 closed defect (fixed)
IAE: "POLYGON cannot have zero area" after adding custom MVT source
Reported by: | Owned by: | taylor.smock | |
---|---|---|---|
Priority: | normal | Milestone: | 21.07 |
Component: | Core imagery | Version: | |
Keywords: | template_report mvt vector | Cc: |
Description
What steps will reproduce the problem?
- add my mvt source https://tiles.where.tn/mvt/{z}/{x}/{y}.pbf (contains data about Tunisia only)
- Zoom in
What is the expected result?
What happens instead?
JOSM Exception
Please provide any additional information below. Attach a screenshot if possible.
URL:https://josm.openstreetmap.de/svn/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2021-06-02 22:03:39 +0200 (Wed, 02 Jun 2021) Build-Date:2021-06-02 20:11:30 Revision:17919 Relative:URL: ^/trunk Identification: JOSM/1.5 (17919 en) Linux Mint 19.3 Tricia Memory Usage: 1163 MB / 2540 MB (626 MB allocated, but free) Java version: 1.8.0_292-8u292-b10-0ubuntu1~18.04-b10, Private Build, OpenJDK 64-Bit Server VM Look and Feel: javax.swing.plaf.nimbus.NimbusLookAndFeel Screen: :0.0 1366×768 (scaling 1.00×1.00) Maximum Screen Size: 1366×768 Best cursor sizes: 16×16→16×16, 32×32→32×32 Environment variable LANG: en_US.UTF-8 System property file.encoding: UTF-8 System property sun.jnu.encoding: UTF-8 Locale info: en_US Numbers with default locale: 1234567890 -> 1234567890 Desktop environment: X-Cinnamon Java package: openjdk-8-jre:amd64-8u292-b10-0ubuntu1~18.04 libcommons-compress-java: libcommons-compress-java:all-1.18-1~18.04 libcommons-logging-java: libcommons-logging-java:all-1.2-2 fonts-noto: fonts-noto:all-20171026-2 Plugins: + CADTools (1008) + ColorPlugin (1537115529) + DirectDownload (35640) + DirectUpload (35640) + EasyPresets (1612708244) + HouseNumberTaggingTool (35640) + PolygonCutOut (v0.7) + apache-commons (35524) + apache-http (35589) + continuosDownload (91) + editgpx (35562) + jaxb (35543) + jna (35662) + jogl (1.2.3) + log4j (35458) + mapwithai (1.8.2) + markseen (14) + measurement (35640) + reltoolbox (35640) + reverter (35732) + terracer (35640) + utilsplugin2 (35691) Tagging presets: + https://github.com/kendzi/Simple3dBuildingsPreset/releases/download/0.9_2018-05-08/s3db-preset.zip Map paint styles: - https://josm.openstreetmap.de/josmfile?page=Styles/AddressValidator&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Admin_Boundaries&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/DigiRoadBusStops&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransportV2&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/RU-SubwayEntranceLabeling&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Noname&zip=1 - https://github.com/osmlab/applepaintstyles/archive/master.zip + https://josm.openstreetmap.de/josmfile?page=Styles/MapWithAI&zip=1 Validator rules: + https://github.com/Jungle-Bus/transport_mapcss/raw/gh-pages/transport.validator.zip Last errors/warnings: - 00005.237 W: Not a single layer for the name 'where apple': [] - 00005.237 W: Not a single layer for the name 'where apple': [] - 00006.211 W: java.io.IOException: The requested URL https://github.com/osmlab/applepaintstyles/archive/master.zip was not found - 00006.978 W: Failed to load Mappaint styles from 'https://github.com/osmlab/applepaintstyles/archive/master.zip'. Exception was: java.io.IOException: The requested URL https://github.com/osmlab/applepaintstyles/archive/master.zip was not found - 00006.979 E: java.io.IOException: The requested URL https://github.com/osmlab/applepaintstyles/archive/master.zip was not found - 00007.494 E: Failed to locate image 'MapWithAI' - 00143.487 E: Handled by bug report queue: java.lang.IllegalArgumentException: POLYGON cannot have zero area === REPORTED CRASH DATA === BugReportExceptionHandler#handleException: No data collected. Warning issued by: BugReportExceptionHandler#handleException === STACK TRACE === Thread: MVT-downloader-20 (95) java.lang.IllegalArgumentException: POLYGON cannot have zero area at org.openstreetmap.josm.data.imagery.vectortile.mapbox.Geometry.<init>(Geometry.java:86) at org.openstreetmap.josm.data.imagery.vectortile.mapbox.Feature.getGeometryObject(Feature.java:172) at org.openstreetmap.josm.data.vector.VectorDataStore.lambda$addDataTile$8(VectorDataStore.java:284) at java.util.ArrayList.forEach(ArrayList.java:1259) at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1082) at org.openstreetmap.josm.data.vector.VectorDataStore.addDataTile(VectorDataStore.java:282) at org.openstreetmap.josm.data.imagery.vectortile.mapbox.MVTTile.getData(MVTTile.java:122) at org.openstreetmap.josm.data.imagery.vectortile.mapbox.MVTTile.loadImage(MVTTile.java:71) at org.openstreetmap.josm.data.imagery.TMSCachedTileLoaderJob.tryLoadTileImage(TMSCachedTileLoaderJob.java:328) at org.openstreetmap.josm.data.imagery.TMSCachedTileLoaderJob.loadingFinished(TMSCachedTileLoaderJob.java:210) at org.openstreetmap.josm.data.cache.JCSCachedTileLoaderJob.finishLoading(JCSCachedTileLoaderJob.java:265) at org.openstreetmap.josm.data.cache.JCSCachedTileLoaderJob.run(JCSCachedTileLoaderJob.java:234) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
Attachments (0)
Change History (10)
comment:1 by , 4 years ago
Component: | Core → Core imagery |
---|
comment:2 by , 4 years ago
comment:3 by , 4 years ago
Keywords: | mvt vector added |
---|
comment:4 by , 4 years ago
Summary: | Exception after adding custom mvt source → IAE: "POLYGON cannot have zero area" after adding custom MVT source |
---|
comment:5 by , 4 years ago
I get the error while downloading https://tiles.where.tn/mvt/6/36/25.pbf
Commands:
[ CommandInteger [type=MoveTo, parameters=[-9, -17]], CommandInteger [type=LineTo, parameters=[9, 17, -19, 0]], CommandInteger [type=ClosePath] ]
comment:7 by , 4 years ago
New logs:
2021-07-11 03:46:10.567 FINE: JCS - Submitting job for execution for url: https://tiles.where.tn/mvt/6/36/25.pbf 2021-07-11 03:46:11.388 FINE: JCS - starting fetch of url: https://tiles.where.tn/mvt/6/36/25.pbf 2021-07-11 03:46:11.389 FINE: JCS - Returning object from cache: 20971:https://tiles.where.tn/mvt/{z}/{x}/{y}.pbf/6/36/25 2021-07-11 03:46:11.390 SEVERE: Cannot add vector data for feature Feature [geometry=[CommandInteger [type=MoveTo, parameters=[-9, -17]], CommandInteger [type=LineTo, parameters=[9, 17, -19, 0]], CommandInteger [type=ClosePath, parameters=[]]], geometryType=POLYGON, id=0, ] of tile Tile 6/36/25@20971 [LOADING...] [loaded]: POLYGON cannot have zero area 2021-07-11 03:46:11.401 SEVERE: java.lang.IllegalArgumentException: POLYGON cannot have zero area java.lang.IllegalArgumentException: POLYGON cannot have zero area at org.openstreetmap.josm.data.imagery.vectortile.mapbox.Geometry.<init>(Geometry.java:86) at org.openstreetmap.josm.data.imagery.vectortile.mapbox.Feature.getGeometryObject(Feature.java:174) at org.openstreetmap.josm.data.vector.VectorDataStore.addFeatureData(VectorDataStore.java:303) at org.openstreetmap.josm.data.vector.VectorDataStore.addDataTile(VectorDataStore.java:285) at org.openstreetmap.josm.data.imagery.vectortile.mapbox.MVTTile.getData(MVTTile.java:122) at org.openstreetmap.josm.data.imagery.vectortile.mapbox.MVTTile.loadImage(MVTTile.java:71) at org.openstreetmap.josm.data.imagery.TMSCachedTileLoaderJob.tryLoadTileImage(TMSCachedTileLoaderJob.java:328) at org.openstreetmap.josm.data.imagery.TMSCachedTileLoaderJob.loadingFinished(TMSCachedTileLoaderJob.java:210) at org.openstreetmap.josm.data.cache.JCSCachedTileLoaderJob.finishLoading(JCSCachedTileLoaderJob.java:265) at org.openstreetmap.josm.data.cache.JCSCachedTileLoaderJob.run(JCSCachedTileLoaderJob.java:228) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833)
My understanding is that your code is correct according to MVT spec and the tile is erroneous. In r17994 I catched the exception to issue an error log and continue with next feature. I'll let you check if the behavior is OK :)
comment:8 by , 4 years ago
Milestone: | → 21.07 |
---|---|
Owner: | changed from | to
comment:9 by , 4 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I think it's fixed. Please reopen if I did wrong.
comment:10 by , 4 years ago
I haven't seen anything wrong. :)
Probably the best option was to catch the exception and continue on. That shouldn't affect anything (except not showing a polygon with no area).
This is probably a spec misread. The v1 spec didn't do a good job of defining polygons (IIRC), while the v2 spec was very specific on there being interior and exterior rings, with interior rings have a surveyor's area of < 0 ("negative") and exterior rings having an area of > 0 ("positive").
Its possible that
0
might be considered a "positive" number in context, but I'll have to see if I can find the polygon with zero area, so I can figure out how its supposed to be displayed.