Repository navigation
Clean up coordinate types - #3873
Conversation
There was a problem hiding this comment.
This method should be renamed latLngToScreenCoordinate(), right?
There was a problem hiding this comment.
Good catch 👍 I'll update the TransformState function names accordingly.
c8ea0c2 to
e9f0875
Compare
I strongly disagree with this change. These are integer because tile endpoints are integer only. Making them floating point may introduce subtle epsilon bugs when comparing tile IDs. |
e9f0875 to
a01f822
Compare
| std::string attribution; | ||
| std::array<float, 3> center = { { 0, 0, 0 } }; | ||
| std::array<float, 4> bounds = { { -180, -90, 180, 90 } }; | ||
| vec3<> center = { 0, 0, 0 }; |
There was a problem hiding this comment.
LatLng center;
double zoom;
LatLngBounds bounds;
|
I agree with @kkaefer, I don't think should replace TileCoordinate with TileID and make TileID coordinates double. Instead, we should reduce the usage of TileCoordinate to just |
a01f822 to
6e3cfa8
Compare
199154c to
6ede00f
Compare
ee9a42f to
a19acf3
Compare
|
@jfirebaugh @kkaefer this is ready for review now. This PR is getting too big to fit all changes from #3529 so I'd prefer to implement the rest of
|
a19acf3 to
3c7f15e
Compare
|
Update: I'm investigating a regression in the test suite expectations, will let you know once I have more information. |
|
@brunoabinader let's remove the last commit ("Initial setup for UnwrappedTileID") and commit this before it gets unwieldy. |
Use 'LATITUDE_MAX', 'LONGITUDE_MAX', 'DEG2RAD' and 'RAD2DEG' whenever possible.
Also introduced GeometryCoordinates (vector of GeometryCoordinate items), to better cope with GeometryCollection.
GeoJSONTile and AnnotationTile don't need to reimplement getExtent() if they use the same default value. This also helps point and shape annotations to avoid using raw values.
Fixes a precision loss when converting unwrapped LatLngs.
4762290 to
c083fe8
Compare
Plus type change for zoom and removed redundant inlines.
c083fe8 to
9346a6d
Compare
As per #3785, this PR main changes are:
TileCoordinatewithTileIDTileIDcoordinates use double precisionvec4implementationPrecisionPointtoScreenCoordinatevec{2,3,4}andstd::array<float, 2>- they are still used in some places though no longer in coordinate-related logic👀 @jfirebaugh @tmpsantos @1ec5 @kkaefer