JuliaGeo / Shapefile.jl

Parsing .shp files in Julia
http://juliageo.org/Shapefile.jl/
MIT License
82 stars 14 forks source link

`GeoInteface.getgeom(polygon, i)` is very slow. We need a cache for calculating holes and rings only once. #108

Closed rafaqz closed 3 months ago

rafaqz commented 6 months ago

Using getgeom(multipolygon) rather than getgeom(polygon, i) is recommended... but in practice the later is used a lot and is currently insanely slow if you have e.g. 100 holes in a polygon.

We could maybe add a cache of bit indices for each polygon with the exterior then all the holes. Then we can just index with it to get each polygon after the first time.

asinghvi17 commented 3 months ago

I believe this is now a thing.