isciences / exactextractr

R package for fast and accurate raster zonal statistics
https://isciences.gitlab.io/exactextractr/
274 stars 26 forks source link

Output Order #43

Closed r-barnes closed 3 years ago

r-barnes commented 3 years ago

I've been looking for a way to easily join the outputs of this processing back to the input shapefile.

If the output is in the same order as the polygons in the shapefile, then the solution is simple, but I don't see a guarantee or explanation of the ordering in the documentation.

Could you clarify what the output ordering is?

dbaston commented 3 years ago

The output ordering is the same as the input, so you can cbind the results to the input. Alternatively, you can include columns from the input directly in the output, using append_cols.

r-barnes commented 3 years ago

Thanks, that's very helpful!