Common Catalogue Query Language 2008. 04. 03 천 동 석 충남대학교 컴퓨터공학과 ikarus1004@cnu.ac.kr
Contents Query란? Filter란? Spatial Operators Comparison operators Logical operators Filter Example Common Catalogue Query Reference
OGC catalogue UML static model
Query란? 클라이언트는 카탈로그 서비스에 메타데이터를 찾고 result set을 생성하는 쿼리를 수행하기 위하여 카탈로그에 요청 SQL SELECT에서 SQL WHERE를 기본으로 함
Filter란? SQL문의 WHERE 역할 Filter에 올수 있는 Operator spatialOps comparisonOps logicalOps
Spatial Operators geometric 인자를 받아 공간관계를 만족하는지를 결정하는 오퍼레이터 타입 비교가 참이면 true 비교가 거짓이면 false 타입 BinarySpatialOpType DistanceBufferType BBOXType
Spatial Operators - BinarySpatialOpType 2개의 geometry 사이의 공관적 관계를 비교 종류 Equals Disjoint Touches Within Overlaps Crosses Intersects Intersects(g1, g2 ) ↔ Not (Disjoint(g1, g2 )) Contains Contains(g1, g2 ) ↔ Within(g2 , g1)
Spatial Operators - DistanceBufferType geometric property의 값이 지정된 거리의 안인지 밖인지 test 거리는 <Distance>로 표현 예) <Distance unit=“http://www.uomdict.com/uom.html#meters”>10</Distance> 종류 DWithin Beyond
Spatial Operators - BBOXType bounding box의 간단한 표현 제공 종류 BBOX <BBOX> … </BBOX> = <Not><Disjoint> … </Disjoint></Not> Page17에 Example 3참고
Comparison operators 2개의 인자에 대해서 수학적 비교하는 오퍼레이터 타입 비교가 참이면 true 비교가 거짓이면 false 타입 BinaryComparisonOpType PropertyIsLikeType PropertyIsNullType PropertyIsBetweenType
Comparison operators - BinaryComparisonOpType =, <, >, >=, <=, <> 을 이용하여 비교 종류 PropertyIsEqualTo PropertyIsNotEqualTo PropertyIsLessThan PropertyIsGreaterThan PropertyIsLessThanOrEqualTo PropertyIsGreaterThanOrEqualTo
Comparison operators - PropertyIsLikeType String 패턴 매치 속성으로 wildCard, singleChar, escapeChar 지정 속성 wildCard : \ 0 or more characters singleChar : ? One character escapeChar : * more characters 종류 PropertyIsLike
Comparison operators – PropertyIsNullType 종류 PropertyIsNull
Comparison operators - PropertyIsBetweenType 범위 체크 예) lower and upper boundary 종류 PropertyIsBetween
Logical operators 1 또는 그 이상의 조건 표현식을 결합할 때 사용하는 오퍼레이터 종류 AND OR NOT 모두 참이어야 참 OR 여러 개 중에 한 개라도 참이면 참 NOT logical value를 반대로 표현
Filter Example
Example 1 A simple non-spatial filter checking to see if SomeProperty is equal to 100.
Example 2 A simple non-spatial filter comparing a property value to a literal. In this case, the DEPTH is checked to find instances where it is less than 30 - possibly to identify areas that need dredging.
Example 3 - 1 This example encodes a simple spatial filter. In this case we are finding all features that have a geometry that spatially interacts with the specified bounding box. The expression NOT DISJOINT is used to exclude all features that do not interact with the bounding box; in other words identify all the features that interact with the bounding box in some way.
Example 3 - 2 An alternative encoding of this filter could have used to <BBOX> element: <Filter> <BBOX> <PropertyName>Geometry</PropertyName> <gml:Envelope srsName="http://www.opengis.net/gml/srs/epsg.xml#63266405"> <gml:lowerCorner>13.0983 31.5899</gml:lowerCorner> <gml:upperCorner>35.5472 42.8143</gml:upperCorner> </gml:Envelope> </BBOX> </Filter>
Example 4 In this example we combine examples 2 and 3 with the logical operator AND. The predicate is thus interpreted as seeking all features that interact with the specified bounding box and have a DEPTH value of less than 30 meters.
Example 5 The following filter includes the encoding of a function. This filter identifies all features where the sin() of the property named DISPERSION_ANGLE is 1.
Example 6 This example encodes a filter that includes an arithmetic expression. This filter is equivalent to the expression A = B + 100.
Example 7 This example encodes a filter using the BETWEEN operator. The filter identifies all features where the DEPTH is between 100 and 200 meters.
Example 8 This example is similar to example 9 except that in this case the filter is checking to see if the SAMPLE_DATE property is within a specified date range. The dates are represented as described in the Annex B of the Web Map Service Implementation Specification [6].
Example 9 This example encodes a filter using the LIKE operation to perform a pattern matching comparison. In this case, the filter identifies all features where the value of the property named LAST_NAME begins with the letters "JOHN".
((FIELD1=10 OR FIELD1=20) AND (STATUS="VALID"). Example 10 In this example, a more complex scalar predicate is encoded using the logical operators AND and OR. The example is equivalent to the expression: ((FIELD1=10 OR FIELD1=20) AND (STATUS="VALID").
Example 11 The following example restricts the active set of objects to those instances of the Person type that are older than 50 years old and live in Toronto. This filter expression uses an XPath expression to reference the complex attributes of the Person type.
Common Catalogue Query
Example - Request
Response Type Brief, Summary and Full element sets defined Brief : dc:identifier, dc:title, dc:type, ows:BoundingBox Summary : Brief + dc:subject, dc:format, dc:relation, dct:modified, dct:abstract, dct:spatial Full : 전체
Example – Response(Full)
Example – Response(Summary)
Example – Response(Brief)
Reference OpenGIS® Filter Encoding Implementation Specification OpenGIS® Simple Features Specification OpenGIS Catalogue Service Implementation Specification