rafaqz / Extents.jl

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

Geographic extent #27

Open evetion opened 1 month ago

evetion commented 1 month ago

Something that we can apply the correct crstrait on from GeoInterface. We can discuss here how intersections on such an extent would look like.

rafaqz commented 1 month ago

This object will need implementations of all the predicates.

We can set up special cyclic dimensions that move any values to -180 : 180 cycle in the constructor. Then bounds in high-low order are wrapping around.

So predicates will have to check the bounds order and have a branch for both.

X=Cycle{-180,180}(170, -150) would do it and be generic.

evetion commented 1 month ago

That looks nice! However, can we also generically implement crstrait (i.e. dispatch) on it? Any Extent with a Cycle as one of its dims?

rafaqz commented 1 month ago

Yeah we may still need a wrapper type, but this at least makes the predicates generic to any cyclic dimension