On Thursday, March 22, 2012 08:09:25 PM Matthijs Laan wrote:
> I have a simple feature with a property named "#SHAPE#". I wanted to use
> this property as an identifier in a CQL query, but this doesn't work:
> 
> #SHAPE# = 1
> 
> In GEOT-3122 quoting was added, but alas:
> 
> "#SHAPE#" = 1
> 
> Does not work. This is because it is interpreted as a XPath expression
> so the SimpleFeaturePropertyAccessor isn't used. Fair enough, lets try
> using some JXPath magic, as this works:
> 
> ff.property("./*[name() = '#SHAPE#']").evaluate(f)
> 
> But this doesn't parse in CQL because it doesn't allow spaces in XPath
> expressions, so this is my working CQL:
> 
> "./*[name()='#SHAPE#']" = 1
Hi, it is not an valid identifier for CQL specification
http://docs.codehaus.org/display/GEOTOOLS/CQL+Parser+Design

> 
> Is there an easier way I overlooked? I wish there was an easier way to
> do this, like a Hint to specify that the SimpleFeaturePropertyAccessor
> should always be used even with special characters in the identifier.
Your chance could be a preprocess with a Map between your identifiers and the 
CQL valid identifier
> 
> Matthijs

cheers
> 
> 
> ----------------------------------------------------------------------------
> -- This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> GeoTools-GT2-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
-- 
Mauricio Pazos

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to