1
votes

I'm trying to use the results from a withinDistance query in a second withinDistance.

I have 2 spatial indexes, Houses and POIs (Points of Interest). I'm trying to find houses which match certains parameters and then find POIs around each house.

This is what I have so far, but I don't know how to pass house.lon and house.lat as argument in the second withinDistance query

START house=node:Houses('withinDistance:[48.0,5.3,100.0]')
MATCH house ... // ... find Houses which match certain parameters
WITH house
    START poi=node:POIs('withinDistance:[house.lon,house.lat,50.0]')
    RETURN house.name, count(poi)

Bonus question: POIs are linked to POI_Type nodes, how can I return the count of POIs by type around each House?

Cheers :)

1
I raised it with the team, perhaps there will be the possibility of having string-expressions for start-itemsMichael Hunger

1 Answers

1
votes

Unfortunately start index lookup statements are not expressions but literals. So you'll have to do a client roundtrip for now to construct them :(

Which is unfortunate but I doubt it will change.