oshdb
oshdb copied to clipboard
spatial "proximity" queries
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
//edit @tyrasd: merged into top post (so github can show progress of the tick marks)
the code has now been moved from gitlab: https://github.com/GIScience/oshdb/tree/spatialJoin
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.)
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.