rafaqz / Extents.jl

A shared Extent object for Julia spatial data, with DE-9IM spatial predicates
MIT License
4 stars 3 forks source link

add DE-9IM predicates and test #13

Closed rafaqz closed 11 months ago

rafaqz commented 1 year ago

@evetion these might help with https://github.com/JuliaGeo/GeoInterface.jl/issues/106

There are a few more to add, we have intersects, within, contains, union and intersection so far.

In GeoInterface we can just do things like

within(geom, ext::Extent) = Extents.within(GI.extent(geom), ext)
codecov-commenter commented 1 year ago

Codecov Report

Merging #13 (a743a1b) into main (b76338a) will increase coverage by 3.36%. The diff coverage is 87.87%.

@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
+ Coverage   84.40%   87.76%   +3.36%     
==========================================
  Files           1        1              
  Lines         109      139      +30     
==========================================
+ Hits           92      122      +30     
  Misses         17       17              
Files Coverage Δ
src/Extents.jl 87.76% <87.87%> (+3.36%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

rafaqz commented 1 year ago

Yes to disjoint and overlaps, and I guess equals.

Also to very clear tests and docs. This package should be bomb-proof.

But not sure when I will be able to lift it to that standard.

rafaqz commented 11 months ago

@evetion I went all out ISO and implemented DE-9IM

Seems to work well but some feedback would be good. I'm not sure about the strict keyword and generally what to do as the default when there is an extra dimension in one of the extents (like there is a time or Z dimension in a spatial raster as well as X/Y - what do when checking if it intersects with a regular X/Y raster.

They all seem to take a few nanosecond. I'm thinking we can use them in fast loops over many geometries, matching some predicate like everything that might overlap.