Modify

Opened 3 years ago

Last modified 3 years ago

#21250 new enhancement

Implement TileJson specification for Mapbox Vector Tiles

Reported by: frodrigo Owned by: team
Priority: normal Milestone:
Component: Core imagery Version:
Keywords: mvt Cc:

Description

Add MVT/Style imagery

https://cdn.jsdelivr.net/gh/openmaptiles/osm-bright-gl-style@v1.9/style.json

It fails with error.

Not fulls and shiny support expected, but not an error.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2021-08-02 19:44:04 +0200 (Mon, 02 Aug 2021)
Build-Date:2021-08-02 18:26:20
Revision:18118
Relative:URL: ^/trunk

Identification: JOSM/1.5 (18118 fr) Linux Arch Linux
Memory Usage: 794 MB / 1744 MB (218 MB allocated, but free)
Java version: 1.8.0_292-b10, Oracle Corporation, OpenJDK 64-Bit Server VM
Look and Feel: com.formdev.flatlaf.FlatLightLaf
Screen: :0.0 1920×1080 (scaling 1.00×1.00)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→16×16, 32×32→32×32
Environment variable LANG: fr_FR.UTF-8
System property file.encoding: UTF-8
System property sun.jnu.encoding: UTF-8
Locale info: fr_FR
Numbers with default locale: 1234567890 -> 1234567890
Desktop environment: XFCE
VM arguments: [-Djosm.restart=true]
Dataset consistency test: No problems found

Plugins:
+ Mapillary (2.0.0-alpha.12)
+ OpeningHoursEditor (35640)
+ PicLayer (1.0.1)
+ apache-commons (35524)
+ apache-http (35589)
+ buildings_tools (35756)
+ cadastre-fr (35758)
+ conflation (0.6.6)
+ contourmerge (v0.1.8)
+ ejml (35458)
+ epci-fr (35640)
+ flatlaf (35734)
+ geotools (35458)
+ jaxb (35543)
+ jna (35662)
+ jts (35458)
+ log4j (35458)
+ measurement (35640)
+ opendata (35640)
+ openqa (0.2.2)
+ pbf (35720)
+ photo_geotagging (35738)
+ photoadjust (35770)
+ poly (35640)
+ reverter (35732)
+ tageditor (35640)
+ todo (30306)
+ turnlanes (35640)
+ turnlanes-tagging (288)
+ turnrestrictions (35640)
+ undelete (35640)
+ utilsplugin2 (35691)

Tagging presets:
+ https://josm.openstreetmap.de/josmfile?page=Presets/LaneAttributes&zip=1

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/Cycleways&style&zip=1
- https://github.com/hotosm/HDM-JOSM-style/archive/master.zip
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_features&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_features_ryg&zip=1

Validator rules:
- https://github.com/Jungle-Bus/transport_mapcss/raw/gh-pages/transport.validator.zip
+ /..${HOME}/tmp/osmose-backend/plugins/Bicycle.validator.mapcss
+ /..${HOME}/tmp/osmose-backend/plugins/Construction2.validator.mapcss
+ /..${HOME}/tmp/osmose-backend/plugins/Name_Cadastre_FR.validator.mapcss
+ /..${HOME}/tmp/osmose-backend/plugins/Power.validator.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Rules/FranceSpecificRules&zip=1

Last errors/warnings:
- 00112.243 E: Impossible de trouver l'image "regulatory--texts--g2"
- 00112.345 E: Impossible de trouver l'image "void--car-mount"
- 00112.345 E: Impossible de trouver l'image "void--dynamic"
- 00112.345 E: Impossible de trouver l'image "void--ego-vehicle"
- 00112.346 E: Impossible de trouver l'image "void--ground"
- 00112.346 E: Impossible de trouver l'image "void--static"
- 00112.544 E: Impossible de trouver l'image "warning--kangaroo-crossing--g1"
- 00160.035 E: Unsupported savable layer type: MVTLayer
- 00160.147 E: org.openstreetmap.josm.data.imagery.vectortile.mapbox.InvalidMapboxVectorTileException: TileJson not yet supported
- 00160.157 E: Handled by bug report queue: java.lang.ClassCastException: org.glassfish.json.JsonObjectBuilderImpl$JsonObjectImpl cannot be cast to javax.json.JsonNumber



=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (17) of main
java.lang.ClassCastException: org.glassfish.json.JsonObjectBuilderImpl$JsonObjectImpl cannot be cast to javax.json.JsonNumber
	at org.glassfish.json.JsonObjectBuilderImpl$JsonObjectImpl.getJsonNumber(JsonObjectBuilderImpl.java:247)
	at org.openstreetmap.josm.data.imagery.vectortile.mapbox.style.Layers.parsePaintFill(Layers.java:437)
	at org.openstreetmap.josm.data.imagery.vectortile.mapbox.style.Layers.<init>(Layers.java:124)
	at org.openstreetmap.josm.data.imagery.vectortile.mapbox.style.MapboxVectorStyle.lambda$new$3(MapboxVectorStyle.java:120)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.Iterator.forEachRemaining(Iterator.java:116)
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)
	at org.openstreetmap.josm.data.imagery.vectortile.mapbox.style.MapboxVectorStyle.<init>(MapboxVectorStyle.java:121)
	at org.openstreetmap.josm.data.imagery.vectortile.mapbox.style.MapboxVectorStyle.lambda$getMapboxVectorStyle$0(MapboxVectorStyle.java:61)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
	at org.openstreetmap.josm.data.imagery.vectortile.mapbox.style.MapboxVectorStyle.getMapboxVectorStyle(MapboxVectorStyle.java:57)
	at org.openstreetmap.josm.data.imagery.vectortile.mapbox.MapboxVectorTileSource.<init>(MapboxVectorTileSource.java:49)
	at org.openstreetmap.josm.gui.layer.imagery.MVTLayer.getTileSource(MVTLayer.java:112)
	at org.openstreetmap.josm.gui.layer.imagery.MVTLayer.getTileSource(MVTLayer.java:64)
	at org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer.initializeIfRequired(AbstractTileSourceLayer.java:575)
	at org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer.attachToMapView(AbstractTileSourceLayer.java:557)
	at org.openstreetmap.josm.gui.MapView.layerAdded(MapView.java:342)
	at org.openstreetmap.josm.gui.layer.LayerManager.fireLayerAdded(LayerManager.java:459)
	at org.openstreetmap.josm.gui.layer.LayerManager.realAddLayer(LayerManager.java:234)
	at org.openstreetmap.josm.gui.layer.MainLayerManager.realAddLayer(MainLayerManager.java:284)
	at org.openstreetmap.josm.gui.layer.LayerManager.lambda$addLayer$0(LayerManager.java:218)
	at org.openstreetmap.josm.gui.util.GuiHelper.runInEDTAndWaitWithException(GuiHelper.java:246)
	at org.openstreetmap.josm.gui.layer.LayerManager.addLayer(LayerManager.java:218)
	at org.openstreetmap.josm.gui.layer.LayerManager.addLayer(LayerManager.java:207)
	at org.openstreetmap.josm.actions.AddImageryLayerAction.actionPerformed(AddImageryLayerAction.java:167)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:842)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:886)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
	at java.awt.Component.processMouseEvent(Component.java:6539)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6304)
	at java.awt.Container.processEvent(Container.java:2239)
	at java.awt.Component.dispatchEventImpl(Component.java:4889)
	at java.awt.Container.dispatchEventImpl(Container.java:2297)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
	at java.awt.Container.dispatchEventImpl(Container.java:2283)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
	at java.awt.EventQueue$4.run(EventQueue.java:733)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Attachments (0)

Change History (5)

comment:1 by taylor.smock, 3 years ago

Component: CoreCore imagery

comment:2 by taylor.smock, 3 years ago

Summary: Error opening MapboxGL StyleImplement TileJson specification for Mapbox Vector Tiles
Type: defectenhancement

As noted in the error log, TileJson not yet supported. Not all parts of the specification have been implemented, and specifically, TileJson hasn't yet been implemented.

This was a decision I made when I was writing the Mapbox vector tile support. I got enough of the spec implemented so that it was largely usable, with some parts having to be implemented later.

TBH, when I was writing the code, the primary reason was due to Mapillary requiring MVT support in their v4 API.

comment:3 by grinapo, 3 years ago

https://josm.openstreetmap.de/wiki/Maps says, quote:

For MVT services, you may specific a url to a ​Mapbox Vector Style sheet. If a vector tile style sheet is specified, max-zoom and min-zoom properties do not need to be specified, as the vector tile style sheet should include that information for all the sources and layers in the vector tile style sheet.

My educated guess is that this is, considering what has been written above, is not true. Maybe it should be fixed, but I am not sure enough to fix myself. Thanks!

in reply to:  3 comment:4 by frodrigo, 3 years ago

Replying to grinapo:

https://josm.openstreetmap.de/wiki/Maps says, quote:

For MVT services, you may specific a url to a ​Mapbox Vector Style sheet. If a vector tile style sheet is specified, max-zoom and min-zoom properties do not need to be specified, as the vector tile style sheet should include that information for all the sources and layers in the vector tile style sheet.

My educated guess is that this is, considering what has been written above, is not true. Maybe it should be fixed, but I am not sure enough to fix myself. Thanks!

max-zoom and min-zoom can be specified in a tilejson for tiles provided. It can also be specified in the source part of a style when a tilejson is not used, in the same way as in tilejson.

Other max-zoom and min-zoom in the style are regarding the display of the rendered layers, not the vector tiles.

comment:5 by taylor.smock, 3 years ago

Right now, TileJson still isn't supported. If you want to support it, feel free to write the code. If I'm able to break away some time, I'll take a look at doing it myself, but it isn't high priority for me right now. And my TODO list is continually growing.

Anyway, an example entry for MVT:
https://josm.openstreetmap.de/wiki/Maps/Worldwide#MapillaryImagesandPointFeatures
This points to the stylesheet at source:/osm/applications/editors/josm/mvt/mapillary-style.json

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to frodrigo.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.