On a related note we are running two type systems:
- Expression.getType() - returning a constant of ExpressionType
- instanceof LiteralExpression, instanceof GeometryFilter etc ...

GeoAPI uses the interfaces right the way across the board, and I would like
to see us move in that direction as well.

I would also like to ask about the difference between:
- LITERAL_DOUBLE
- LITERAL_INTEGER
- LITERAL_STRING
- LITERAL_GEOMETRY

And:
- ATTRIBUTE
- ATTRIBUTE_DOUBLE
- ATTRIBUTE_GEOMETRY
- ATTRIBUTE_INTEGER
- ATTRIBUTE_STRING
- ATTRIBUTE_UNDECLARED

Are these things that we can actually know? Aka the Features have a schema that uses XML Simple types, but we cannot tell just by looking at the Filter expression what is going on. I am also not sure if in practice Filter uses anything other then Strings and Geometry ...

Let me check Filter 1.1:
   <xsd:complexType name="LiteralType">
      <xsd:complexContent mixed="true">
         <xsd:extension base="ogc:ExpressionType">
            <xsd:sequence>
               <xsd:any minOccurs="0"/>
            </xsd:sequence>
         </xsd:extension>
      </xsd:complexContent>
   </xsd:complexType>
Well that kind of leaves the door open to *anything*, Geometry and Complex types - that is good news for Gabriel. So as I understand it one could be strongly indicating integer and double types using Filter combined with a reference to a custom schema ... interesting. To bad none of the examples in the documentation make use of this.

How do they do it? Well they only every make use of *one* literal at a time, and each time they do they "know" what kind of type it expected to be. The same type as the Attribute they just referenced

So the only safe thing seems to be allow Strongly type Geometry and Strong literals, and for Object literals. The other thing to do is to make sure all the operations know how to up convert from String to something they can deal with. This has one hole:

<PropertyIsLessThan>
  <LiteralExpression>9</LiteralExpression>
  <LiteralExpression>10</LiteralExpression>
</PropertyIsLessThan>

We would expect to false - ie "10" < "9" and their is nothing we can do about it - on the bright side expression completely of literals are useless - so the above example is bad in theory but in practice we will be fine.

So what do you guys want to do?
1. Stop up converting to Interger and Double on creation
2. up converting to Interger, Double, Date, Color as required to match the "context" provided by the result of a Function or Attribute Expression. 3. Give up on figuring out the difference between ATTRIBUTE and ATTRIBUTE_X (because we really can never tell)




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to