Hi Alireza,

That code looks OK. Could you send me some sample data? I could try this
myself and see what the problem is. The code underneath is using the JTS
function Geometry.within(Geometry) and that is strictly defined. See
http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/geom/Geometry.html#within(com.vividsolutions.jts.geom.Geometry)
.

But if I try your data I could double-check if there is perhaps an issue in
how we use this.

Regards, Craig



On Wed, Sep 3, 2014 at 3:15 PM, Alireza Rezaei Mahdiraji <
[email protected]> wrote:

>
> I tried this snippet:
>
> GeometryFactory gf = layer.getGeometryFactory();
> Geometry geom = gf.toGeometry(envelope);
> List<Node> nodes = GeoPipeline.startWithinSearch(layer, geom).toNodeList();
>
> but the result still contains nodes which are not fully inside the
> envelope.
>
> What am I missing?
>
> Thanks,
>
> Alireza
>
>
> On Tuesday, September 2, 2014 10:35:38 AM UTC+2, Craig Taverner wrote:
>
>> Hi,
>>
>> I can see two ways in the Java API to do this. One is the 'within' filter
>> in the GeoPipeline.
>>
>>    - See example usage in the test code at
>>    - See the implementation using JTS in the code at
>>    https://github.com/neo4j-contrib/spatial/blob/master/
>>    src/main/java/org/neo4j/gis/spatial/pipes/filtering/
>>    FilterWithin.java#L47
>>    
>> <https://github.com/neo4j-contrib/spatial/blob/master/src/main/java/org/neo4j/gis/spatial/pipes/filtering/FilterWithin.java#L47>
>>
>> And the other is the older, but still functional use of CQL for within
>> queries:
>>
>>    - See an example using dynamic layers at https://github.com/neo4j-
>>    contrib/spatial/blob/master/src/test/java/org/neo4j/gis/
>>    spatial/TestDynamicLayers.java#L138
>>    
>> <https://github.com/neo4j-contrib/spatial/blob/master/src/test/java/org/neo4j/gis/spatial/TestDynamicLayers.java#L138>
>>    - And the implementation at https://github.com/neo4j-
>>    contrib/spatial/blob/master/src/main/java/org/neo4j/gis/
>>    spatial/filter/SearchCQL.java#L56
>>    
>> <https://github.com/neo4j-contrib/spatial/blob/master/src/main/java/org/neo4j/gis/spatial/filter/SearchCQL.java#L56>
>>
>> A direct usage of the SearchCQL class is also possible, but I did not see
>> a test case for it. It was used by the GeoServer integration though.
>>
>> Regards, Craig
>>
>>
>> On Mon, Sep 1, 2014 at 5:15 PM, Alireza Rezaei Mahdiraji <
>> [email protected]> wrote:
>>
>>>
>>> Hi All,
>>>
>>> I would like to find nodes of the graph which are completely (not
>>> partially) contained in a given
>>> Envelope. I tried several GeoPipeline methods but it seems they all
>>> consider partial containment.
>>> Any idea?
>>>
>>> Thanks,
>>> Best,
>>> Alireza
>>>
>>>  --
>>> 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.
>

-- 
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.

Reply via email to