isciences / exactextract

Fast and accurate raster zonal statistics
Apache License 2.0
246 stars 32 forks source link

Support writing more file formats #25

Closed chapmanjacobd closed 3 years ago

chapmanjacobd commented 3 years ago

Does this work?

There is probably a better way to do this. It looks like GDAL/ogr already knows how to find the correct driver to use from arbitrary file extensions? https://github.com/OSGeo/gdal/search?q=CPLGetExtension

dbaston commented 3 years ago

Here's how GDAL does it. I don't see that it's exposed in a way that a client library can use:

https://github.com/OSGeo/gdal/blob/master/gdal/apps/commonutils.cpp#L71

I suspect there aren't that many different non-spatial formats people are going to want to write outputs to.

chapmanjacobd commented 3 years ago

ahh I see. So that's how GDAL works 🤔

How difficult do you think it would be to add support for spatial outputs? Maybe I'll try learning C if it sounds like a feature you might be willing to merge?

chapmanjacobd commented 3 years ago

actually I think I'll just use the R wrapper more so I don't forget R