Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
3 changed files
with
136 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/java/de/deepamehta/plugins/geospatial/service/GeospatialService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package de.deepamehta.plugins.geospatial.service; | ||
|
||
import de.deepamehta.plugins.geomaps.model.GeoCoordinate; | ||
|
||
import de.deepamehta.core.Topic; | ||
import de.deepamehta.core.service.PluginService; | ||
|
||
import java.util.List; | ||
|
||
|
||
|
||
public interface GeospatialService extends PluginService { | ||
|
||
List<Topic> getTopicsWithinDistance(GeoCoordinate geoCoord, double maxDistanceInKm); | ||
} |