Ticket #633 (closed Feature Request: fixed)

Opened 6 years ago

Last modified 6 years ago

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:1 Changed 6 years ago by jri

  • Status changed from new to accepted

comment:2 Changed 6 years ago by jri

  • Milestone Release 4.3 deleted

comment:3 Changed 6 years ago by jri

Development has started meanwhile:
https://github.com/jri/dm4-geospatial

I will proceed with it now.

comment:4 Changed 6 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 6 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 6 years ago by Jörg Richter

Extend Geomaps service (#633).

Geomaps API:

import de.deepamehta.plugins.geomaps.model.GeoCoordinate;

GeoCoordinate geoCoordinate(Topic geoCoordTopic)

Returns the geo coordinate encoded in a Geo Coordinate topic.

See #633.

comment:7 Changed 6 years ago by jri

Update geospatial index (#633).

Once a Geo Coordinate topic changes (e.g. when an Address is changed) the geospatial index is updated accordingly.

See #633.

comment:8 Changed 6 years ago by jri

Remove entries from geospatial index (#633).

Once a Geo Coordinate topic is deleted (e.g. when an Address is deleted) the corresponding entry is removed from the geospatial index.

NOTE: this module is still experimental. Only use it with a testing DB.

See #633.

comment:9 Changed 6 years ago by jri

Fix searching an empty geospatial index (#633).

When an empty geospatial index is searched an empty result is returned. No exception is thrown.

See #633.

comment:10 Changed 6 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:13 Changed 6 years ago by Jörg Richter

Extend Geomaps service (#633).

Geomaps API:

import de.deepamehta.plugins.geomaps.model.GeoCoordinate;

GeoCoordinate geoCoordinate(Topic geoCoordTopic)

Returns the geo coordinate encoded in a Geo Coordinate topic.

See #633.

comment:14 Changed 6 years ago by jri

  • Status changed from accepted to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.