On 2012-03-23 06:39, Mauricio Pazos wrote:
> 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+DesignIt should be valid according to ECQL though if I understand GEOT-3122 correctly. > >> 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 I think that would pretty cumbersome. But I think I can work around this, as I am writing the DataStore which is creating the features with special attribute names. I can pass on the filter expression to the data source and not use Filter.evaluate(), like the WFS DataStore which will generate a <ogc:PropertyName/> element with special characters no problem. Matthijs ------------------------------------------------------------------------------ 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
