On Sun, Oct 16, 2011 at 23:54, Robert <[email protected]> wrote:
> I know it's a work in progress, but if I may ask a few questions?
Sure! :)
1)
If you have a List of SpatialDatabaseRecord you can use these
GeoPipeline factory method:
public static GeoPipeline start(Layer layer,
List<SpatialDatabaseRecord> records)
If you have an Iterator I've just added the following:
public static GeoPipeline start(Layer layer,
Iterator<SpatialDatabaseRecord> records)
To create SpatialDatabaseRecords from Node ids you have two methods in Layer:
SpatialDatabaseRecord get(Long geomNodeId);
List<SpatialDatabaseRecord> get(Set<Long> geomNodeIds);
2)
If you want to filter on SpatialDatabaseRecord properties you have to
add a CopyDatabaseRecordProperties pipe to the pipeline:
GeoPipeline geoPipeline =
startNearestNeighborSearch(shoutDatabaseLayer, locationCoordinate,
radiusInKm)
.copyDatabaseRecordProperties()
.propertyFilter(EXPIRY_DATE_TIME_PROPERTY, date, LESS_THAN_EQUAL);
I've created a specific pipe to extract SpatialDatabaseRecord
properties because I thought that reading these properties can be
expensive so it's better to do it only when it's needed. A
SpatialDatabaseRecord contains a reference to a single Node, but a
SpatialDatabaseRecord property is a Node property only in the simplest
case. We could have properties that require traversing many Nodes…
But I'm not satisfied with this implementation. A propertyFilter needs
only a single property and now we load them all.
Maybe we should create a DatabasePropertyFilter that filters on
SpatialDatabaseRecord properties or a CopyDatabaseRecordProperties
pipe that accepts a list of properties to load.
WDYT?
Regards,
--
Davide Savazzi
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user