Conversation
There was a problem hiding this comment.
These should all take their argument as const __ & to avoid copying, and use the CamelCase aliases defined below.
There was a problem hiding this comment.
Shape annotation tests were failing without this clamp -- the maxZoom passed here is the map's mapZoom (20). I need to dig further in master to understand what's changed (was geojson-vt-cpp clamping this?)
There was a problem hiding this comment.
util::clamp<uint8_t>(maxZoom, 0, 18)
|
@brunoabinader can you check if this fixes that maxZoom issue? |
There was a problem hiding this comment.
I think we can replace this auto& with a const auto&.
Just did a rebase of my patches from #5517 on top of this branch. I removed the zoom clamping introduced by @yhahn otherwise the app crashes inside GeoJSONVT's Although the unit test I introduce passes (all zoom levels returns non-empty features when queried with This comes along with a console filled with |
3bb5010 to
b851c94
Compare
421d0e1 to
ebd29c1
Compare
|
Once 🍏 this PR will be ready for another review! Here are some known issues/open questions remaining:
Strictness changesDetermine what to do about two known API behavior changes:
Question: do we need to smooth these changes out for developers or should we nudge them toward more strictness? |
What that the rendering issue you were seeing earlier? For the annotations API, it would be easy enough to close any unclosed polygon rings, right?
Note that features with |
Yes. I started to poke at this but it looks like a slippery slope to me -- we would need to add an early closed-ring validator + corrector for fixing any polygons/multipolygons (ie. before shape annotations are passed to
Yep, this condition is handled properly. |
|
After re-reading the discussion on #5517 I think we should land this first (get fully up to date on |
There was a problem hiding this comment.
C++ should deduct the return type so this can be just return { ... }, right?
|
Looked through the code and this looks great to me! Looking forward to this being merged. I'll follow-up with supercluster.hpp integration after that. |
There was a problem hiding this comment.
The value in each visitor here could be passed by const & to avoid an unneeded copy. That said, the compiler will likely optimize away the copy so its not certain my suggestion will run any faster.
My sense is this will be an unexpected / breaking change for users and we should retain the loose API for annotations. We've never documented the annotations API as requiring closed rings or strict GeoJSON geometry.
In contrast this seems like an acceptable change. It's reasonable to require a GeoJSON source have valid GeoJSON data. Making the parser more conformant can be construed as a bug fix. And use of GeoJSON sources is low in any case. |
There was a problem hiding this comment.
It's awkward to be unable to directly compose mapbox::geojson::convert and mapbox::GeoJSONVT::GeoJSONVT. We should add a GeoJSONVT constructor that accepts mapbox::util::variant<geometry, feature, feature_collection>. cc @mourner
There was a problem hiding this comment.
s/emplace_back(point.x, point.y)/emplace_back(point)/g
This is fine from the iOS and macOS SDKs’ perspective: for compatibility with MapKit, we’ve documented a requirement that MGLPolygon be closed, and the behavior is undefined otherwise. |
|
@jfirebaugh ready whenever you have a chance for another 👀 Only major change besides the cleanup from notes is the addition of the ring-closer for fill annotations: |
|
Ring closing should only apply to polygons and multipolygons, not line strings. |
Since #5514, feature IDs may be integers, unsigned integers, floating-point numbers, or strings, not just unsigned integers.
|
8ca8e2c updates the MGLFeature documentation in the iOS and macOS SDKs to reflect the fact that a feature identifier may be one of several types, not necessarily an NSNumber. We deliberately made the identifier as broadly typed as possible ( |

geometry.hpp-based geojsonvt.geometry-0.8.0