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 Jun 4, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 4, 2026. It is now read-only.
Converting from geometry.hpp to internal representation #40
Currently, convert.cpp code converts from GeoJSON data in RapidJSON representation to GeoJSON-VT internal representation, which is implemented using Projected* types (basically, OGC features with a third coordinate for simplification value + bounding boxes, and additionally storing polygon area + line length for each linear ring).
Instead we would need to either have separate convert_geojson and convert_geometry code paths, or just fully ditch GeoJSON conversion and only accept geometry.hpp for the input, moving the GeoJSON parsing responsibility to GL Native.
Per chat, @kkaefer suggests making mapbox/geojson.hpp that converts from GeoJSON to geometry.hpp representation, and then switch to that in gl-native while ditching GeoJSON code from this repo. Sounds like a great plan.
Here's a rough bullet list of things that need to be done, per chat with @springmeyer:
create a mapbox/geojson.hpp library that converts raw GeoJSON data to geometry.hpp (would be similar to convert.cpp code)
ditch GeoJSON conversion code from this repo and make geometry.hpp representation the input
hide all Projected* classes and converFeatures static method from public API
make GeoJSONVT index creation a one-step process again (accepting geometry.hpp in constructor instead of ProjectedFeature vector generated by convertFeatures)
switch GL Native to use geojson.hpp for GeoJSON parsing and switch to new geojson-vt-cpp with geometry.hpp input
switch GL Native shape annotations implementation to use geometry.hpp representation instead of using Projected*
update remaining types in types.hpp to use geometry.hpp — Feature, Tags, etc.
if possible, update internal Projected* classes to reuse as much geometry.hpp as possible (relies on 3rd coord, etc.)
Activity
artemp commentedon May 4, 2016
@mourner - I thinks taking GeoJSON specific stuff out is a smart move, yes ^
mourner commentedon May 4, 2016
Per chat, @kkaefer suggests making
mapbox/geojson.hppthat converts from GeoJSON to geometry.hpp representation, and then switch to that in gl-native while ditching GeoJSON code from this repo. Sounds like a great plan.mourner commentedon May 4, 2016
Here's a rough bullet list of things that need to be done, per chat with @springmeyer:
mapbox/geojson.hpplibrary that converts raw GeoJSON data to geometry.hpp (would be similar to convert.cpp code)Projected*classes andconverFeaturesstatic method from public APIProjectedFeaturevector generated byconvertFeatures)geojson.hppfor GeoJSON parsing and switch to new geojson-vt-cpp with geometry.hpp inputProjected*types.hppto usegeometry.hpp—Feature,Tags, etc.Projected*classes to reuse as much geometry.hpp as possible (relies on 3rd coord, etc.)kkaefer commentedon Jun 28, 2016
🎉