placemark / togeojson

convert KML, TCX, and GPX to GeoJSON, without the fuss
https://placemark.github.io/togeojson/
BSD 2-Clause "Simplified" License
401 stars 67 forks source link

KMZ overlay with rotation not working correctly #119

Closed jsk01 closed 10 months ago

jsk01 commented 10 months ago

I have a mapbox map that contains a KMZ file that displays some overlays correctly and others rotated incorrectly. Further inspection shows all the overlays with rotation set to zero display correctly. If rotation is set the rotation displayed on the map is off and inverted I believe.

Screenshot shows an overlay with rotation set as 41.0118 in Google Earth. Changing the value to -41.0118 causes the image to be close to correct. Although its still slightly off from the green outline polygon. I have a version of the map using ESRI and it loads the KMZ correctly so I believe the issue is with togeojson logic in some way. issue with overlay rotation

tmcw commented 10 months ago

(misread before, this is for an overlay)

https://github.com/placemark/togeojson/blob/71ce365886c49ec037bfe602155913e052bb4f87/lib/kml/ground_overlay.ts#L48-L58

Must be a bug here?

jsk01 commented 10 months ago

Here's the kmz I'm having an issue with. Only two overlays. One with no rotation and one with rotation.

Legend Point is the overlay not rotating as expected. Let me know if you don't have the same experience.

Looking at the code above, line 52 should be plus rotation? It would fit what I tested yesterday by making the rotation value a negative number in the kmz.

Overlay1-test.zip