[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: [Fwd: To support OGC GetRecords/Filter ...]
-- Panagiotis (Peter) A. Vretanos CubeWerx Inc. Big Kahuna (Senior Database Developer) http://www.cubewerx.com Tel. 416-701-1985 Fax. 416-701-9870 pvretano@cubewerx.com If you have any trouble sounding condescending, find a Unix user to show you how it's done. ~Scott Adams
--- Begin Message ---
- From: "Panagiotis (Peter) A. Vretanos" <pvretano@cubewerx.com>
- To: "Farrukh S. Najmi" <farrukh@wellfleetsoftware.com>
- Date: Thu, 19 Nov 2009 12:30:44 -0500
Farrukh, To support filter I think you would need to make the following changes ... Right now the spatialFilter() function has the following prototype: spatialFilter( propertyName string, spatialOperator string, geometry GEOMETRY, delimieter string) To support filter you need to add one more parameter: spatialFilter( propertyName string, spatialOperator string, geometry GEOMETRY, delimiter string, template string ) A "template" is a string that is used verbatim by the function to generate each return value. The notation ${id} is used to indicate where the return identifier should be substituted in the template string. The way the function works is as follows: 1) If a delimiter is specified then each return value is separated using the specified delimiter. 2) The default delimiter is comma (,). 3) The value of delimited can be NULL or "" meaning that no separator is used. 3) The delimiter can be escaped values like "\n" for newline or "\t" for tab, etc. 4) If a template argument is specified then each return id value is substituted into the template and the resulting string is then appended to the return string using the specified delimiter (if one is specified) to separate each return value. Here are some example ... Example 1: spatialFilter("myGeom","Intersects","<gml:Polygon>...") would return: id1,id2,id3,id4,.... Example 2: spatialFilter("myGeom","Intersects","<gml:Polygon>...","|") would return : id1|id2|id3|id4|... Example 3: spatialFilter("myGeom","Intersects","<gml:Polygon>...","\n", "<ogc:RecordId rid=\"${id}\"/>"); would return: <ogc:RecordId rid="id1"/> <ogc:RecordId rid="id2"/> <ogc:RecordId rid="id3"/> <ogc:RecordId rid="id4"/> So, f we wanted to add an ad-hoc query example to the document that uses CSW GetRecords as the query expression, we could add: <query:QueryRequest ...> ... <query:Query queryDefinition="urn:oasis:names:tc:ebxmlregrep:query:AdhocQuery"> <rim:Slot name="queryLanguage"> <rim:ValueList> <rim:ValueListItem xsi:type="StringValueType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <rim:Value>urn:oasis:names:tc:ebxmlregrep:QueryLanguage:CSW-Query</rim:Value> </rim:ValueListItem> </rim:ValueList> </rim:Slot> <rim:Slot name="queryExpression"> <rim:ValueList> <rim:ValueListItem xsi:type="StringValueType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <rim:Value> #@ <csw:GetRecords service="CSW" version="2.0.2" maxRecords="5" startPosition="1" resultType="results" outputFormat="application/xml" outputSchema="http://www.opengis.net/cat/csw/2.0.2" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 ../../../csw/2.0.2/CSW-discovery.xsd"> <csw:Query typeNames="csw:Record"> <csw:ElementSetName>brief</csw:ElementSetName> <csw:Constraint version="1.1.0"> <ogc:Filter> @# ogc:spatialFilter(“headquarters”,“contains”,“<gml:Envelope srsName=\"urn:ogc:def:crs:OGC:2:WGS84\"><gml:lowerCorner>0 0</gml:lowerCorner><gml:upperCorner>30 30</gml:upperCorner></gml:Envelope>”,NULL,"<RecordId rid=\"${id}\"/>") #@ </ogc:Filter> </csw:Constraint> </csw:Query> </csw:GetRecords> @# </rim:Value> </rim:ValueListItem> </rim:ValueList> </rim:Slot> </query:Query> </query:QueryRequest> Of course I would need to escape the GetRecords XML string but you get the idea. Comments? Ciao. -- Panagiotis (Peter) A. Vretanos CubeWerx Inc. Big Kahuna (Senior Database Developer) http://www.cubewerx.com Tel. 416-701-1985 Fax. 416-701-9870 pvretano@cubewerx.com If you have any trouble sounding condescending, find a Unix user to show you how it's done. ~Scott Adams--- End Message ---
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]