-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polygon orientation #36
Comments
I'll check this out |
@ShibaBandit Hi,Did you checkout this issue? |
We had the same problem when testing with a tegola server as tile source. Should definetely be fixed to conform with the mvt-standard. |
…reation on mvt. This hotfix should be applied until the issue wdtinc#36 get fixed
So the method @exe-dealer mentioned takes in geometry in MVT coordinates (y-positive down). It then tries to ensure that the winding order is CW for the outer and CCW for the inner. I guess the issue is that the spec wants that ordering to be determined from the source geometry that does not have a positive Y down axis, so flipping the signs appears to handle this? |
Trying out some changes for this problem, one commit I saw on this issue thread is incomplete because it didn't flip the PolyRingClassifierV2_1#classifyRings check. Therefore unit tests would fail . |
Closing via #41 |
It seems that rings orientation in polygons is wrong. The specs says that exterior ring must be clockwise in screen coordinates. But orientation is flipped when JTS geometry is encoded to mvt, so preparation step should do the opposite orientation when it operates with JTS geometry. Mapbox encoder implementation does it like I say https://github.com/mapbox/geojson-vt/blob/d3bf094b1329dd84dcc8446ba407c9830469b808/src/tile.js#L113
Because of this issue extruded polygons are displayed inside out in mapboxgl viewer
When I swapped orientation checks for exterior and interior rings in the following file then 3d polygons became normal
mapbox-vector-tile-java/src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/JtsAdapter.java
Line 366 in e5e3df3
mapbox-vector-tile-java/src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/JtsAdapter.java
Line 385 in e5e3df3
The text was updated successfully, but these errors were encountered: