Ticket #633 (closed Feature Request: fixed)
Geospatial Queries
Reported by: | jri | Owned by: | jri |
---|---|---|---|
Priority: | Major | Milestone: | |
Component: | 3rd Party Plugins | Version: | 4.2 |
Keywords: | Cc: | dgf, Malte | |
Complexity: | 8 | Area: | |
Module: |
Description
We want create a new external module "dm4-geospatial" to support spatial database features, in particular a geographical "Within Distance" query. We want utilize the Neo4j Spatial module for that:
www.neo4j.org/develop/spatial
We need that for Kiezatlas 2, in particular the Familienportal application.
Change History
comment:3 Changed 10 years ago by jri
Development has started meanwhile:
https://github.com/jri/dm4-geospatial
I will proceed with it now.
comment:4 Changed 10 years ago by jri
First working version (#633).
New API for performing a proximity search.
Geospatial API:
import de.deepamehta.plugins.geomaps.model.GeoCoordinate; List<Topic> getTopicsWithinDistance(GeoCoordinate geoCoord, double maxDistanceInKm)
REST API:
GET /geospatial/<lon>,<lat>/distance/<km>
Returned are Geo Coordinate topics (as defined in the Geomaps module).
Each time a Geo Coordinate topic is created or updated its values are automatically indexed by means of Neo4j Spatial (http://www.neo4j.org/develop/spatial). That is typically each time an Address topic is created/updated, e.g. when editing a Person or an Institution.
Existing Geo Coordinate topics are not yet indexed (this remains to be implemented). Only create and update operations are respected at the moment.
There is a bug in Neo4j Spatial: when the above API is used while the geospatial index has no entries yet, a NullPointerException? is thrown.
Hint: with a Geo Coordinate topic at hand you can retrieve the corresponding domain topic (e.g. a Person or Institution) by calling the Geomaps service's
Topic getDomainTopic(long geoCoordId)
See #633.
comment:5 Changed 10 years ago by jri
Index Geo Coordinate topics directly (#633).
The internal indexing approach is changed: the Geo Coordinate topics are indexed directly, so that they become an active part of the R-tree build up by Neo4j Spatial. This supports index update and delete operations more natural.
NOTE: this module is still experimental. Only use it with a testing DB.
See #633.
comment:6 Changed 10 years ago by Jörg Richter
comment:7 Changed 10 years ago by jri
comment:8 Changed 10 years ago by jri
comment:9 Changed 10 years ago by jri
comment:10 Changed 10 years ago by jri
Fill the geospatial index initially (#633).
When the plugin is deployed for the first time the geospatial index is filled with all existing Geo Coordinate topics. So, existing geo data is searchable from the start.
The dm4-geospatial plugin now has reached its first milestone and is about to be released as 0.1
See #633.
comment:11 Changed 10 years ago by jri
comment:12 Changed 10 years ago by jri
Add example to README
comment:13 Changed 10 years ago by Jörg Richter
comment:14 Changed 10 years ago by jri
- Status changed from accepted to closed
- Resolution set to fixed