Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geomesa-dev] Decomposing filter for KafkaDataStore

Dale,

This example assumes that your ID filter is not nested, although that's
fairly easy to deal with, as a Filter is really just a tree.

The org.geotools.filter.text.ecql.ECQL class can be used to translate
between String and Filter as follows:

  Filter filter = ECQL.toFilter("in ('MyFID-57', 'MyFID-58')")

That filter will accept features whose fid is either MyFID-58 or
MyFID-58, as you would expect.  More importantly, the Id* class that
corresponds to the root of this Filter contains a getIDs() method:

  Set<Object> ids = (org.opengis.filter.Id)filter.getIDs()

In this example, that returns:
  java.util.Set[Object] = [MyFID-57, MyFID-58]

I hope this helps.  If not, please just let us know.

Thanks!

Sincerely,
  -- Chris

_______________
*
https://github.com/geotools/geotools/blob/master/modules/library/opengis/src/main/java/org/opengis/filter/Id.java



On Mon, 2016-03-14 at 18:47 +0000, Dale F. McIntosh wrote:
> I am attempting to process the delete from the kafka data store.
> 
>  
> 
> It has a filter, but no id reference.
> 
>  
> 
> According to Jim Hughes, I need to decompose the filter to determine
> if it has a featured ID and obtain the feature id.
> 
>  
> 
> Can you please provide an example for decomposing a filter to obtain
> the feature id?
> 
>  
> 
>   Thanks,
> 
>   Dale McIntosh
> 
>   Forward Slope
> 
>   619-302-7637
> 
>  
> 
> 
> _______________________________________________
> geomesa-dev mailing list
> geomesa-dev@xxxxxxxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> http://locationtech.org/mailman/listinfo/geomesa-dev




Back to the top