perrygeo / python-rasterstats

Summary statistics of geospatial raster datasets based on vector geometries.
BSD 3-Clause "New" or "Revised" License
531 stars 116 forks source link

`properties_out` option #271

Open perrygeo opened 1 year ago

perrygeo commented 1 year ago

The current approach provides two outputs

geojson_out=False (default) gives you all requests stats as a list of dicts. None of the original properties or geometry is retained; you have to rely on the order to match them with the original vector features.

geojson_out=True gives you the data back as geojson, complete with the original geometry, original properties, and stats added as new properties.

Some use cases (outputting to a csv for example) require only the properties not the geometry itself. I propose a new properties_out flag that would yield a list of dicts containing the original properties plus stats only, no geom.

Why? The geometry can be costly to copy and store. If you just need the properties, this could be a useful optimization.

ericboucher commented 1 year ago

We're doing this manually but it would be great to have this out of the box for sure!