acdh-oeaw / arche-core

MIT License
0 stars 1 forks source link

Provide spatial indexing #18

Closed zozlak closed 3 years ago

zozlak commented 3 years ago

Arche-core uses Postgresql as a backend, so adding spatial indexing and search with Postgis shouldn't be a rocket science. This would require:

To decide (@csae8092) - what kind of operators do we need. I would say intersection should be enough. If someone wants more fancy ones, (s)he may use an SQL query with all the goodies Postgis provides.

(see https://redmine.acdh.oeaw.ac.at/issues/19100)

csae8092 commented 3 years ago

I pass into a query a Polygon -> give me all resources either fully in this polygon | give me all resources intersecting this polygon I pass into a query a Point -> give me all resources this point intersects with

zozlak commented 3 years ago

Do you think contains is more intuitive than intersects? I would argue that "contains" raises the issue of what should be contained in what (search geometry in repository object geometry or other way round) and depending on particular search users may expect different behavior. Intersection doesn't have this ambiguity.

Of course we can also create three operators, let's say && (intersects), &>& (right contained in left), &<& (left contained in right).

csae8092 commented 3 years ago

Of course we can also create three operators, let's say && (intersects), &>& (right contained in left), &<& (left contained in right).

perfect

zozlak commented 3 years ago

Implemented in 04e66eb130c8484da30ac55ba245bddfe4d7c875 (arche-core) and 25c61b55411264f9b2eaa27686139272108a052f in arche-lib