You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
@kkaefer@mourner Do you guys think this should be a part of GL itself, or should we try to keep it a separate library for general use of geo data -> vector tiles?
@incanus it would be nice to have it as a separate library — easier to maintain this way, with separate tests etc. It could also grow into a useful standalone tool.
Related to #904, we can't subclass Source to make e.g. a LiveSource (my first approach), so instead I am thinking:
Use Source, possibly with manually-created or passed SourceInfo related to the data (GeoJSON or other) setup.
Adapt Source::addTile() to handle SourceType:GeoJSON (currently unimplemented) as a first measure.
Above relies on a new GeoJSONTileData class which works similar to VectorTileData, but which pulls tiles from the GeoJSONVT structure.
A Source initialized in this way (perhaps with passed GeojSON) would async run the GeoJSONVT clipping & splitting algorithm upon creation so that it would be ready for these tile queries. This shouldn't take long, but maybe it will block addTile() calls until it's done?
FYI above I was speaking of GeoJSON only because that's what GeoJSONVT currently takes (a GeoJSON string) in its conversion, but ideally GL will go right at this conversion regardless of the format or of runtime-added features. We don't really care about GeoJSON file support right now in the iOS beta.
Current status: as of 988e64e, I have some semblance of an ever-present annotations layer atop the style layers, which generates tile coverage properly. Then, instead of kicking off async web loads for tile data, it queries a passed GeoJSONVT object. I can pan and zoom and observe the proper tiles being requested out of the object, including it auto-drilling down to slice up the GeoJSON.
Next steps, roughly:
Bridge the GeoJSONVTTile and TileFeature format into VectorTileData that we can render.
Cut my sample GeoJSON (or any passed GeoJSON, for that matter) out for now.
Write an API to expose direct writes/conversions into Tile and TileFeature.
Still making slow progress here. Current structure is a LiveTileData peer to VectorTileData & RasterTileData, which will support programmatic annotation adding as well as (eventually) GeoJSON file retrieval/parsing. Just as VectorTileData passes to TileParser, LiveTileData passes to LiveTileParser, which will get refactored using large parts of TileParser such as render bucket creation, but first I'm just getting through the functionality.
Next up is some careful looking into the GeoJSONVT library and my use of move/copy and references. I got to the bottom of an issue that was causing modification to throwaway stack variables and thus losing fidelity. So... back to the porting drawing board a bit for some cleanups, then:
Get all shapes to render on first view.
Figure out what's causing pieces of PA and all of NJ to not show up (some sort of collision thing or possibly actually losing data unintentionally during conversion).
Cut out the hardcoded GeoJSON load and go right at the GeoJSONVT conversion routines with live-added data.
Add APIs to stick stuff into said conversion routines.
1.) Collision detection happens only for Symbol Buckets (not lines or areas).
2.) If you want render something over all areas, lines and symbols, you would have to make sure that glDepthRange gets called with the right depth range. Painter uses a variable called strata for this. You may want to review your changes around this area to debug this.
Yep, though still working through a fair number of issues. It’s looking like the first cut will support either open shapes with a variable-width/color border, closed shapes with a fill color and an optional, but fixed-width, variable-color border, and possibly cutout holes in closed shapes.
Currently working on multiple layers, styling, and laying foundation for relative ordering.
Just to brain dump:
For points, we use one style layer which is added post-parse and contains all points when added/removed at runtime. Points are individually styled by passing their sprite image association in the {sprite} property, just as we do for map style POIs.
For shapes, each annotation will need its own layer in the style. This is for two reasons:
Each shape can be independently styled (stroke, color, alpha, etc.).
Shape layers can be ordered and reordered at runtime.
Passing styling properties in the annotation proprieties like we do with points won't work as-is since we don't parse tokens out of properties the same way we do in the symbol bucket.
This also means that we need to modify the style each time the client adds or removes a shape layer. I think this will render alright (i.e. not flicker the basemap) since we're only modifying and invalidating the annotation tiles (fast LiveTile objects with no network component).
Another approach, an alternative to each shape having a layer in the style, is to put all shapes in a single style layer like we do with points, make line and fill buckets parse out their properties for styling (modifying the StyleLayer on the fly), and punt relative ordering of shapes to however we will solve #988, i.e. probably do it in the shaders?
I was seeing it in terms of annotation layers only, but I see how this should be made generic and how it plays with data-driven styles now. Thanks for the reminder.
Activity
incanus commentedon Feb 17, 2015
The library consists of
geojsonvt.hppandgeojsonvt.cpp.incanus commentedon Feb 18, 2015
@kkaefer @mourner Do you guys think this should be a part of GL itself, or should we try to keep it a separate library for general use of geo data
->vector tiles?mourner commentedon Feb 18, 2015
@incanus it would be nice to have it as a separate library — easier to maintain this way, with separate tests etc. It could also grow into a useful standalone tool.
incanus commentedon Feb 19, 2015
Related to #904, we can't subclass
Sourceto make e.g. aLiveSource(my first approach), so instead I am thinking:Source, possibly with manually-created or passedSourceInforelated to the data (GeoJSON or other) setup.Source::addTile()to handleSourceType:GeoJSON(currently unimplemented) as a first measure.GeoJSONTileDataclass which works similar toVectorTileData, but which pulls tiles from theGeoJSONVTstructure.Sourceinitialized in this way (perhaps with passed GeojSON) would async run theGeoJSONVTclipping & splitting algorithm upon creation so that it would be ready for these tile queries. This shouldn't take long, but maybe it will blockaddTile()calls until it's done?incanus commentedon Feb 19, 2015
FYI above I was speaking of GeoJSON only because that's what
GeoJSONVTcurrently takes (a GeoJSON string) in its conversion, but ideally GL will go right at this conversion regardless of the format or of runtime-added features. We don't really care about GeoJSON file support right now in the iOS beta.incanus commentedon Feb 20, 2015
Current status: as of 988e64e, I have some semblance of an ever-present annotations layer atop the style layers, which generates tile coverage properly. Then, instead of kicking off async web loads for tile data, it queries a passed
GeoJSONVTobject. I can pan and zoom and observe the proper tiles being requested out of the object, including it auto-drilling down to slice up the GeoJSON.Next steps, roughly:
GeoJSONVTTileandTileFeatureformat intoVectorTileDatathat we can render.TileandTileFeature.incanus commentedon Feb 25, 2015
Still making slow progress here. Current structure is a
LiveTileDatapeer toVectorTileData&RasterTileData, which will support programmatic annotation adding as well as (eventually) GeoJSON file retrieval/parsing. Just asVectorTileDatapasses toTileParser,LiveTileDatapasses toLiveTileParser, which will get refactored using large parts ofTileParsersuch as render bucket creation, but first I'm just getting through the functionality.refs #893: basic live tile parsing/conversion
incanus commentedon Feb 25, 2015
As of 645aeda I'm getting things to render a bit.
incanus commentedon Feb 26, 2015
Next up is some careful looking into the
GeoJSONVTlibrary and my use of move/copy and references. I got to the bottom of an issue that was causing modification to throwaway stack variables and thus losing fidelity. So... back to the porting drawing board a bit for some cleanups, then:GeoJSONVTconversion routines with live-added data.That should keep me busy a while longer.
incanus commentedon Feb 26, 2015
As of d36caee this now works, at least within the limits of:
That's next.
incanus commentedon Feb 26, 2015
It's the latter, as merely drawing
backgroundplus the data is no better.mb12 commentedon Feb 26, 2015
1.) Collision detection happens only for Symbol Buckets (not lines or areas).
2.) If you want render something over all areas, lines and symbols, you would have to make sure that glDepthRange gets called with the right depth range. Painter uses a variable called strata for this. You may want to review your changes around this area to debug this.
39 remaining items
Merge pull request #1021 from mapbox/point-annotations-api
incanus commentedon Mar 19, 2015
For b2, need to port over some improvements from @mourner like mapbox/geojson-vt@6f82954 when we get back to shapes.
incanus commentedon Mar 22, 2015
Note to catch up with
2.0.0in general when we're back on this:https://github.com/mapbox/geojson-vt#200-mar-20-2015
incanus commentedon May 20, 2015
Picking up shape annotation work again for b2 in
shape-annotations.incanus commentedon May 22, 2015
picciano commentedon May 22, 2015
pretty sweet! does that work with lines as well as closed shapes?
incanus commentedon May 22, 2015
Yep, though still working through a fair number of issues. It’s looking like the first cut will support either open shapes with a variable-width/color border, closed shapes with a fill color and an optional, but fixed-width, variable-color border, and possibly cutout holes in closed shapes.
incanus commentedon May 26, 2015
Currently working on multiple layers, styling, and laying foundation for relative ordering.
Just to brain dump:
For points, we use one style layer which is added post-parse and contains all points when added/removed at runtime. Points are individually styled by passing their sprite image association in the
{sprite}property, just as we do for map style POIs.For shapes, each annotation will need its own layer in the style. This is for two reasons:
Passing styling properties in the annotation proprieties like we do with points won't work as-is since we don't parse tokens out of properties the same way we do in the symbol bucket.
This also means that we need to modify the style each time the client adds or removes a shape layer. I think this will render alright (i.e. not flicker the basemap) since we're only modifying and invalidating the annotation tiles (fast
LiveTileobjects with no network component)./cc @jfirebaugh @kkaefer @ansis
incanus commentedon May 26, 2015
Another approach, an alternative to each shape having a layer in the style, is to put all shapes in a single style layer like we do with points, make line and fill buckets parse out their
propertiesfor styling (modifying theStyleLayeron the fly), and punt relative ordering of shapes to however we will solve #988, i.e. probably do it in the shaders?jfirebaugh commentedon May 26, 2015
That's a huge push, outlined in mapbox/mapbox-gl-style-spec#249.
incanus commentedon May 26, 2015
I was seeing it in terms of annotation layers only, but I see how this should be made generic and how it plays with data-driven styles now. Thanks for the reminder.
incanus commentedon May 27, 2015
Shape work PR coming into place: #1655
incanus commentedon Jun 2, 2015
Shapes are just about set for b2, so I'm back looking into this ticket's branch (
geojsonvt) for shape simplification.incanus commentedon Jun 8, 2015
#1655 supersedes this now that GeoJSONVT as the underpinning of shape annotations has landed there.