Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

merge GeoJSON vector tiles work #893

Closed

Description

@incanus

Picking up from #507 (comment), we'll need to merge the geojsonvt branch, which will require it interfacing better with the library.

  • match vector tile object structure with main library
  • allow for live reindexing when features are added/removed
  • handle non-GeoJSON (in-memory features)
  • nailing some hopefully-basic performance kinks
  • MultiGeometry support
  • other API merging (e.g. LatLng struct)
  • figuring out how independent of or reliant on GL we want the library to be

/cc @mourner @1ec5

Activity

  1. added this to the milestone on Feb 17, 2015
  2. incanus commented on Feb 17, 2015

    @incanus
    ContributorAuthor

    The library consists of geojsonvt.hpp and geojsonvt.cpp.

  3. incanus commented on Feb 18, 2015

    @incanus
    ContributorAuthor

    @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?

  4. mourner commented on Feb 18, 2015

    @mourner
    Member

    @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.

  5. incanus commented on Feb 19, 2015

    @incanus
    ContributorAuthor

    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?
  6. incanus commented on Feb 19, 2015

    @incanus
    ContributorAuthor

    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.

  7. incanus commented on Feb 20, 2015

    @incanus
    ContributorAuthor

    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 GeoJSONVT Tile 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.
  8. incanus commented on Feb 25, 2015

    @incanus
    ContributorAuthor

    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.

  9. added a commit that references this issue on Feb 25, 2015
  10. incanus commented on Feb 25, 2015

    @incanus
    ContributorAuthor

    As of 645aeda I'm getting things to render a bit.

    anigif-1424899491

  11. incanus commented on Feb 26, 2015

    @incanus
    ContributorAuthor

    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.
    • Layer iOS API on top of that plus add API for currently hardcoded annotation styling.

    That should keep me busy a while longer.

  12. incanus commented on Feb 26, 2015

    @incanus
    ContributorAuthor

    Get all shapes to render on first view.

    As of d36caee this now works, at least within the limits of:

    Figure out what's causing pieces of PA and all of NJ to not show up

    That's next.

  13. incanus commented on Feb 26, 2015

    @incanus
    ContributorAuthor

    (some sort of collision thing or possibly actually losing data unintentionally during conversion)

    It's the latter, as merely drawing background plus the data is no better.

    screen shot 2015-02-26 at 11 34 07 am

  14. mb12 commented on Feb 26, 2015

    @mb12

    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.

  15. 39 remaining items

  16. added a commit that references this issue on Mar 18, 2015
  17. incanus commented on Mar 19, 2015

    @incanus
    ContributorAuthor

    For b2, need to port over some improvements from @mourner like mapbox/geojson-vt@6f82954 when we get back to shapes.

  18. incanus commented on Mar 22, 2015

    @incanus
    ContributorAuthor
  19. incanus commented on May 20, 2015

    @incanus
    ContributorAuthor

    Picking up shape annotation work again for b2 in shape-annotations.

  20. incanus commented on May 22, 2015

    @incanus
    ContributorAuthor
    map.addPointAnnotation(mbgl::LatLng(45, -120), "default_marker");
    
    map.addShapeAnnotation({
        mbgl::LatLng(44, -122),
        mbgl::LatLng(46, -122),
        mbgl::LatLng(46, -121),
        mbgl::LatLng(44, -122)
    });

    screen shot 2015-05-22 at 4 31 46 pm

  21. picciano commented on May 22, 2015

    @picciano

    pretty sweet! does that work with lines as well as closed shapes?

  22. incanus commented on May 22, 2015

    @incanus
    ContributorAuthor

    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.

  23. incanus commented on May 26, 2015

    @incanus
    ContributorAuthor

    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:

      1. Each shape can be independently styled (stroke, color, alpha, etc.).
      2. 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).

    /cc @jfirebaugh @kkaefer @ansis

  24. incanus commented on May 26, 2015

    @incanus
    ContributorAuthor

    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?

  25. jfirebaugh commented on May 26, 2015

    @jfirebaugh
    Contributor

    make line and fill buckets parse out their properties for styling

    That's a huge push, outlined in mapbox/mapbox-gl-style-spec#249.

  26. incanus commented on May 26, 2015

    @incanus
    ContributorAuthor

    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.

  27. incanus commented on May 27, 2015

    @incanus
    ContributorAuthor

    Shape work PR coming into place: #1655

  28. incanus commented on Jun 2, 2015

    @incanus
    ContributorAuthor

    Shapes are just about set for b2, so I'm back looking into this ticket's branch (geojsonvt) for shape simplification.

  29. incanus commented on Jun 8, 2015

    @incanus
    ContributorAuthor

    #1655 supersedes this now that GeoJSONVT as the underpinning of shape annotations has landed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions