wavded / ogre

ogr2ogr geojson-focused web client
http://ogre.adc4gis.com
MIT License
266 stars 79 forks source link

Questions about KMZ conversion and Polar Projections #112

Closed DanielJDufour closed 1 year ago

DanielJDufour commented 1 year ago

Hello. Firstly, thank you for such an awesome library. It has been really helpful! I was hoping to get your perspective on a few things that we noticed. They aren’t really bugs per se, but rather I believe limitations of ogr2ogr. I was wondering if expanding the functionality of ogre to handle these cases might be within scope of this project.

Converting KMZ with multiple subfiles:

We sometimes try to convert KMZ files that have multiple subfiles and run into this error.

ERROR 6: Support only 1 file in archive 

file /tmp/f3eaa987a9dad7f03230938b251f75daTest.kmz when no explicit in-archive filename is specified
You could try one of the following :
/vsizip/{/tmp/f3eaa987a9dad7f03230938b251f75daTest.kmz}/2D4CC302FF314E20AC5683118FDD12A7.xsl
/vsizip/{/tmp/f3eaa987a9dad7f03230938b251f75daTest.kmz}/doc.kml

My interpretation of this error is that ogr2ogr won’t currently search through the subfiles and identify the one .kml subfile among the other subfiles. Would it be possible to add code to ogre that lists the subfiles, finds the .kml file, and then passes that along to ogr2ogr?

Conversion Around the Poles

When we upload a shapefile in a polar projection with a geometry that encircles Antarctica (crossing the -90 degree latitude line), the reprojected geometry won’t extend to the -90 degree latitude line. My reading is that ogr2ogr is truthfully reprojecting each vertex individually, but without a greater sense of the shape of the polygon. (I've attached some screenshots that hopefully illustrate the issue better than I can explain.) I believe we would need some special logic to handle this edge case. Would it be possible to add some of this special logic to ogre?

Thank you for your consideration and looking forward to your thoughts :-)

Geometry in Polar Projection

antarctica-in-polar-projection

Geometry in 4326

antarctica-4326
wavded commented 1 year ago

Thanks for the detailed response. I would recommend pulling out the KML file before passing it to the web service if that is possible. Unfortunately there are too many one-offs with ogr2ogr and I don't want to maintain custom functionality that goes beyond the scope of ogr2ogr's capabilities. FWIW, we tried that in the past (not this specific issue but others) and it became painful to maintain and led to other issues. Perhaps there is room for plugins in the future if there is enough interest.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 5 days with no activity.