For option 1, your app code needs to change the lat-lon values for each
request. Cypher will not be dynamic, the app code will. The pseudo-code
would be something like:
foreach node in geomnodes:
query = 'START n=node:geom("withinDistance:[' + node.lat + ',' +
node.lon +
', 10.0]") MATCH (a {case_number:"' + node.case_number +
'"}) WHERE NOT a = n MERGE n-[:CLOSE_TO]->a RETURN a,n'
results = db.query(query)
# do something with results
I'm not sure if you can also try parameterized queries with the index
lookup, but that's also worth a try for some performance gains.
On Mon, Aug 18, 2014 at 3:37 PM, Mohana Krishna <[email protected]> wrote:
> So in first option, Do I need to alter lat-lon values manually? As you
> said dynamically supplying values is not possible in query, I guess even
> writing code to replace lat-lon each time won't work. Please enlighten.
>
> Thanks for references regarding 2nd option. I will go through them and get
> back in case of any doubts.
>
> Thanks again :)
>
>
> On Tuesday, 12 August 2014 20:00:01 UTC+5:30, Mohana Krishna wrote:
>
>> Hello,
>>
>> I have loaded the spatial data in the attached file using REST API script
>> (which is also attached). The nodes are created and I can visualize them on
>> DB.
>>
>> However when I perform the query
>>
>> "START n=node:geom('withinDistance:[41.8082, -87.7084, 10.0]') RETURN n"
>> in CYPHER window , I am getting "Unknown Error" as result.
>>
>> Please help.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.