[Dev] OGC CQLs "Envelope" WKT extension

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Dev] OGC CQLs "Envelope" WKT extension

dsmiley
WKT may not have an official rectangle type but OGC "Catalogue Services Specification" has a "CQL" (Common Query Language) sub-spec which includes WKT with this small WKT modification to the BNF:
<Envelope Tagged Text> ::= ENVELOPE <Envelope Text>
<Envelope Text> := EMPTY
                | <left paren>
                  <WestBoundLongitude><comma>
                  <EastBoundLongitude><comma>
                  <NorthBoundLatitude><comma>
                  <SouthBoundLatitude>
                  <right paren>
Oddly the spec never refers to "WKT" or spelled out but if you know WKT, it's obvious it uses WKT for geometry literals.  I'm not fond of the ordering of the parameters for the Envelope but oh well (north then south?!).  This spec appears to be implemented by GeoServer which refers to the same syntax: http://docs.codehaus.org/display/GEOTOOLS/ECQL+Parser+Design#ECQLParserDesign-SpatialPredicate

GeoServer's wiki also says it supports this: ENVELOPE (minx maxx miny maxy).   -- strange, I don't know why; maybe it's erroneous I don't know.  See http://docs.geoserver.org/latest/en/user/filter/ecql_reference.html#literal

So in conclusion, I think Spatial4j should support OGC CQL's extension to WKT.  Looking closely at the BNF shows that our WKT parser needs to be a little smarter to support a leading '+' and 'E' notation.

_______________________________________________
dev mailing list
[hidden email]
http://lists.spatial4j.com/listinfo.cgi/dev-spatial4j.com