0

My goal is to find closest node by the given langitude and longitude. I have created Simple Point Layer and I'm using findClosestGeometies query, but response times, even with relatively small databases, are rather unsatisfactory. Below operations I execute to create my layer:

:POST /db/data/ext/SpatialPlugin/graphdb/addSimplePointLayer { 
    "layer" : "layerName", 
    "lat" : "NODE_LAT", 
    "lon" : "NODE_LON" 
}

:POST /db/data/index/node {"name":"layerName", "config": 
  {"provider":"spatial", "geometry_type":"point", "lat":"NODE_LAT", "lon":"NODE_LON"}
}

match(n:WAY_NODE) set n.id=ID(n);

Then using simple java program I added ~70k nodes to the layer and run sample query:

:POST db/data/ext/SpatialPlugin/graphdb/findClosestGeometries { 
    "pointX" : 18.5640344020454,
    "pointY" : 54.4441138296926,
    "distanceInKm" : 1.0, 
    "layer" : "layerName" 
}

It's working, but each response takes more or less 8 seconds. Is there a way to speed things up? Any ideas what should I use?

Fuv
  • 922
  • 2
  • 12
  • 25

1 Answers1

0

I've observed rather poor performance for this as well if there are a lot of places within the provided distance parameter.

My workaround was to start off with a rather small distance value. If there are no results within that range increase it and try again.

Stefan Armbruster
  • 39,465
  • 6
  • 87
  • 97