hunzikp / velox

https://hunzikp.github.io/velox/
119 stars 23 forks source link

Feature request: rasterToPolygons #20

Open jebyrnes opened 6 years ago

jebyrnes commented 6 years ago

Your rasterize function is amazing and has sped up my workflow immensely. Can the same principle be applied to going the other way, which often takes even longer?

mdsumner commented 6 years ago

You might try spex::polygonize, it uses a "dense-mesh" model to index the corner coordinates and build the sp polygons. It's pretty fast (but at some point it just becomes a bad idea to convert pixels to expanded polygons, since the entire mesh can stay implicit).

mdsumner commented 6 years ago

Aand, actually I've had another look and I can't see a fast way to convert from sf to sp, which kind of makes the speedup moot, unless you move to using sf, so nvm.

jebyrnes commented 6 years ago

This is actually useful - can one go from the meshed polygons to something smoother?

And, honestly, the job I have requires polygonizing thousands of small rasters, so the speedup is a lifesaver. I can do the conversion to a big sp object later.

mdsumner commented 5 years ago

See isoband package now on CRAN