Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geowave-dev] SpatialQuery CompareOperations

Trully sorry about that.  I think i saw them reversed somewhere and thought should be reversed in the cqlfilter too. Now is working great :)


The only relation I'm missing is the 'isWithinDistance', do you know if works? When running with it I'm getting this exception


org.geotools.filter.text.cql2.CQLException: Encountered "POINT" at line 1, column 28.
Was expecting one of:
    <STRING_LITERAL> ...
    "true" ...
    "false" ...
    "(" ...
    "[" ...
    <INTEGER_LITERAL> ...
    <FLOATING_LITERAL> ...
    <IDENTIFIER> ...
     Parsing : isWithinDistance(geometry, POINT (-25.88987361,-49.88764954), 1000.0).

    at org.geotools.filter.text.cql2.CQLCompiler.compileFilter(CQLCompiler.java:106)
    at org.geotools.filter.text.commons.CompilerUtil.parseFilter(CompilerUtil.java:196)
    at org.geotools.filter.text.cql2.CQL.toFilter(CQL.java:134)
    at org.geotools.filter.text.cql2.CQL.toFilter(CQL.java:113)
    at mil.nga.giat.geowave.adapter.vector.query.cql.CQLQuery.<init>(CQLQuery.java:64)
    at mil.nga.giat.geowave.adapter.vector.query.cql.CQLQuery.<init>(CQLQuery.java:53)

Thanks!



De: geowave-dev-bounces@xxxxxxxxxxxxxxxx <geowave-dev-bounces@xxxxxxxxxxxxxxxx> en nombre de Eric Robertson <rwgdrummer@xxxxxxxxx>
Enviado: lunes, 29 de febrero de 2016 04:23 p.m.
Para: geowave-dev
Asunto: Re: [geowave-dev] SpatialQuery CompareOperations
 
Any reason you flipped latitude/longitude?

CONTAINS does as you say: test to see if the geometry stored by GeoWave contains the provide geometry
WITHIN tests to see if the geometry stored by GeoWave is within the provided geometry (which we can assume is some valid polygon for the simple case).

Here is an example of Within i had used recently:
WITHIN(geom,POLYGON((-122.76470055844142 0.4979, -122.76474089862228 0.4974904192702817, -122.76486036891433 0.4970965784983109, -122.76505437814123 0.4967336127640861, -122.76531547063722 0.4964154706372199, -122.76563361276409 0.4961543781412318, -122.76599657849832 0.49596036891432, -122.76639041927028 0.4958408986222733, -122.7668 0.4958005584414154, -122.76720958072973 0.4958408986222733, -122.76760342150169 0.49596036891432, -122.76796638723592 0.4961543781412318, -122.76828452936279 0.4964154706372199, -122.76854562185878 0.4967336127640861, -122.76873963108568 0.4970965784983109, -122.76885910137773 0.4974904192702817, -122.76889944155859 0.4979, -122.76885910137773 0.4983095807297183, -122.76873963108568 0.4987034215016891, -122.76854562185878 0.499066387235914, -122.76828452936279 0.4993845293627801, -122.76796638723592 0.4996456218587683, -122.76760342150169 0.49983963108568, -122.76720958072973 0.4999591013777267, -122.7668 0.4999994415585847, -122.76639041927028 0.4999591013777267, -122.76599657849832 0.49983963108568, -122.76563361276409 0.4996456218587683, -122.76531547063722 0.4993845293627801, -122.76505437814123 0.499066387235914, -122.76486036891433 0.4987034215016891, -122.76474089862228 0.4983095807297183, -122.76470055844142 0.4979)))





On Mon, Feb 29, 2016 at 12:43 PM, Jose M <soloninguno@xxxxxxxxxxx> wrote:

Hi Eric,


Thanks for the advice. Any chance you can show me an example that uses a WITHIN (or any of the other operators) with CQLQuery? Cause I'm testing CQLQuery and is not working for me, and all the available examples in geowave github use BBOX, so i think i'm using it wrongly.


Not even works with CONTAINS in my case.  For example I have only this feature/polygon stored (a square)

-24.88987361,-47.88764954
-24.98669082,-47.88764954
-24.98669082,-48.02909851
-24.88987361,-48.02909851

-24.88987361,-47.88764954


Then i want to find the features that contains this point (it's in the center of the polygon)

-24.9204948,-47.9535657


I create the CQLQuery like this

new CQLQuery("CONTAINS(geometry, POINT (-47.9535657 -24.9204948))", featureDataAdapter);


But the query return no results. If I use the EverythingQuery the features is return ok, so it's seems not to be a problem with the adapter used.


Thanks!






De: geowave-dev-bounces@xxxxxxxxxxxxxxxx <geowave-dev-bounces@xxxxxxxxxxxxxxxx> en nombre de Eric Robertson <rwgdrummer@xxxxxxxxx>
Enviado: viernes, 26 de febrero de 2016 09:30 p.m.
Para: geowave-dev
Asunto: Re: [geowave-dev] SpatialQuery CompareOperations
 

The CompareOperation.CONTAINS is an optimization for 'within a range' type search. 
See executePolygonAndTimeRangeQuery in  mil.nga.giat.geowave.examples.queryGeoTemporalQueryExample

To gain full use of those operators, use mil.nga.giat.geowave.adapter.vector.query.cql.CQLQuery.

See:  examples/src/main/java/mil/nga/giat/geowave/examples/query/SpatialQueryExample.java

 


On Fri, Feb 26, 2016 at 6:14 PM, Jose M <soloninguno@xxxxxxxxxxx> wrote:

Hi again,


I was looking at the CompareOperations in SpatialQueryFilter and seems they use the JTS Geometry compare methods.


As I see, only CONTAINS and OVERLAPS are implemented (in facts don't know why but OVERLAPS uses interesect instead of overlaps Geometry method).


Can the other methods be used (coveredBy, covers, crosses, disjoint, equals, intersect, touches, within)?

I can update the SpatialQueryFilter code adding new enums to CompareOperations on my own, just want to know if I need to consider something else. Don't know if they were not implemented because missing time, or for some incompatibility with geowave.


Thanks!



_______________________________________________
geowave-dev mailing list
geowave-dev@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.locationtech.org/mailman/listinfo/geowave-dev



_______________________________________________
geowave-dev mailing list
geowave-dev@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.locationtech.org/mailman/listinfo/geowave-dev



Back to the top