oshdb icon indicating copy to clipboard operation
oshdb copied to clipboard

spatial "proximity" queries

Open SlowMo24 opened this issue 5 years ago • 4 comments

opened by @tyrasd

Feedback from today's workshop: spatial proximity queries are a very important topic for geographers. An example query would be: calculate all benches that are inside of a park and in the vicinity of a tree and have an ice cream shop nearby :ice_cream:

//cc @franz-benjamin @redfrexx

!!! please consider the detailed comments: https://gitlab.gistools.geog.uni-heidelberg.de/giscience/big-data/ohsome/oshdb/issues/104 !!!

The following steps need to be taken, to merge this:

  • [ ] More test-cases (e.g. a mapping of OSHDBSnapshot-> XYZ before the match() would result in an Exception and needs to be asserted)
  • [ ] reduce number of introduced functions: we propose one function e.g. .spatialJoin(...) that takes the type of join as an argument (instead of one method per type)
  • [ ] clean up code
    • [ ] there is a lot of commented out code
    • [ ] assure the new code meets the quality standards set out in jenkins
  • [ ] Implementation for SnapshotView has priority. A solution for ContributionView should be thought of (there is one in the code which needs to be reviewed in detail)
  • [ ] possible other open questions should be discussed in a personal meeting
  • [ ] this issue needs an assignee and a timestamp (milestone)
  • [ ] "harden" the API against potential misuse (e.g. returning a non matching mapreducer in the spatial relation callback functions); or if possible: change the API to not allow such cases

SlowMo24 avatar Mar 07 '19 16:03 SlowMo24

//edit @tyrasd: merged into top post (so github can show progress of the tick marks)

SlowMo24 avatar Mar 18 '19 17:03 SlowMo24

the code has now been moved from gitlab: https://github.com/GIScience/oshdb/tree/spatialJoin

SlowMo24 avatar Mar 18 '19 17:03 SlowMo24

a quick update about this:

We are currently re-evaluating the option to run spatial queries within OSHDB, but are not yet decided if and how this will happen.

Spatial queries are possible in OSMpsql database and to some extend with overpass, but not for other tools such as libosmium.

In regard to OSHDB (or questions which need information about historic OSM elements) we have often used the data extraction endpoint in combination with another tool/database to run the spatial query.

For instance, first you extract OSM data about parks and then analyze the spatial relations in Spark. In a similar way you could analyze the spatio temporal dynamics of contributions.

If you are interested in this or have use cases why this should be in OSHDB add your thoughts here. (We will review this issue in a few weeks.)

Hagellach37 avatar Nov 18 '22 10:11 Hagellach37

One solution could be to thoroughly plan one use-case, implement it with the current functionality and add it to https://gitlab.gistools.geog.uni-heidelberg.de/giscience/big-data/ohsome/oshdb-examples (with a note saying please signal your interest in this feature at #106 in the main repository). The example should be referenced in the documentation here (in this main repository).

We could then close this (expensive) issue for now and collect interest in the topic from the examples repository.

SlowMo24 avatar Nov 28 '22 11:11 SlowMo24