码迷,mamicode.com
首页 > 其他好文 > 详细

Shape comparison language

时间:2015-11-22 14:01:27      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:

?

形状比较语言, 九交模型

In this topic

技术分享

About shape comparison language

In the interest of supporting the Open Geodata Interoperability Specification (OGIS) and SQL3/MM initiatives, ESRI is implementing in SDE a language syntax for the evaluation of relationships between shapes, which will eventually replace the use of SDE search methods and search masks for defining search criteria, and for expressing?relationships between shapes. The syntax of the?shape?comparison language (SCL)?is based on the Calculus-Based Method (CBM) as described and defined by?Clementini and Felice, with extensions.


The CBM defines shape relationships by the intersection of their boundary,?interior, and exterior, taking the dimensionality of the intersection into?account. The following?are the five basic relationships: Touch, Overlap, In, Cross, and?Disjoint. These relationships are defined such that for any two given shapes,?only one of these five relationships is true. In addition, SCL supports?the additional relationship of?IDENTICAL, which is true only when two shapes are geometrically identical and share correct topological integrity.

? ?

The CBM and SCL perform relationship comparison to a maximum of two?dimensions, thus SCL can only be used to describe zero, one, and two dimensional?relationships. This is consistent with previous versions of SDE wherein the SDE?search methods only described?two dimensional?relationships.

?

Dimensionality

To use SCL you must understand the following concepts of shape?boundary and interior, as well as dimensionality:

? ?

The previous is true for SCL regardless that the shape may or may not?have z-coordinates or that it may have measures.

?

Extensions to the CBM

The CBM does not differentiate between an intersection that occurs at a shape?vertice and an intersection that occurs between shape vertices. Because it is?often crucial to maintain topological integrity between shapes, and to know?when there is a lack of topological integrity between shapes, SCL has been?extended as follows:

? ?

SCL syntactical

SCL is used to describe the relationship between two specific or?in the case of?spatial searches, hypothetical shapes. SCL expressions evaluate to?true or?false, except in the case of the DIM functions, which evaluate to a dimension?value.

The general form of an SCL statement consists of one or more spatial?assertions. Multiple assertions may be connected into a single assertion using?the logical connecting operators AND, OR, and XOR. Parenthetical expression?hierarchy is supported. SCL expressions are not case dependent.


SCL uses the numeric constants TRUE, FALSE, POINT, LINEAR, AREA, NIL, and?NULL, rather than numeric literals. SCL does not support user variables or?numeric literals. The terms NIL and NULL?can be used interchangeably and are?used to refer to a lack of a specific type of intersection.

? ?

SCL allows binary spatial relationships to be expressed as a function or as an?operation between the two shape constants G1 and G2. For example, the?expression G1 cross G2 is equivalent to the expression cross (g1, g2) =?true. The expression G1 not cross G2 is equivalent to the expression cross?(g1, g2) = false or cross (g1, g2) != true.


In SCL, the DIM function is two different functions, depending upon?the number of arguments. If there is only one argument, it returns the?dimensionality of a shape or shape component, such as dim (g1) or dim?(g1.boundary). If there are two arguments, the dim function returns the dimension?of intersection between the two expressed shapes or shape components, such as dim (g1, g2) or dim (g1.interior, g2.boundary).

?

Dimension functions

The dimension functions are the most powerful functions in SCL for the?assertion of spatial relationships. The dimension function DIM takes one or two spatial object arguments?and performs a different function depending on the number of arguments used.?All of the Clementini relationship operators can?be defined using these two DIM functions.


The spatial object modifiers boundary, interior, and exterior?can only be used as modifiers for the spatial entity arguments to the DIM?function. The modifier use form is:?<spatial entity?reference><period><spatial-modifier> in the form g1.boundary.

? ?

DIM function form 1

Returns the spatial dimension of a spatial entity or a component (boundary,?interior, or exterior) of a spatial entity.


Returns the spatial dimension of the referenced spatial object, which evaluates to one of the following supported dimension constants:

NIL, NULL (-1)
POINT 0
LINEAR 1
AREA 2
Usage examples:
"dim (g1.interior) >= linear"
"dim (g1) = dim(g2)"
"dim (g1) >= dim(g2.interior)"

? ?

DIM function form 2

Returns the spatial dimension of intersection between two spatial?entities or components (boundary, interior, or exterior) of the entities.

? ?

Returns the spatial dimension of intersection between the referenced?spatial objects, which evaluates to one of the following supported dimension?constants:

NULL (-1)
POINT 0
LINEAR 1
AREA 2
Usage examples:
"dim(g1.interior,g2) >= linear"
"dim(g1,g2) = dim(g2)"
"dim(g1.boundary,g2.boundary)?> point"

?

Spatial relationship functions and expressions

The CBM and SCL are not intuitive. It is essential to?commit the following definitions to memory before using SCL. The following are the?criteria for relationship evaluation:

? ?

TOUCH spatial relation?
Applies to area/area, line/line, line/area, point/area, and point/line groups with the following criteria:


"G1 TOUCH G2" is equivalent to the following statement: "dim(g1.interior, g2.interior) = null and dim(g1,g2) != null."

? ?

The following are expression options and examples:

"G1 TOUCH G2"
"G1 TOUCHES G2"
"G1 =* G2"
"TOUCH (G1,G2) = TRUE"
"TOUCHES (G1,G2) = TRUE"

? ?

CROSS spatial relation?
Applies to line/line, line/area, point/area, and point/line groups with the following criteria:


"G1 CROSS G2" is equivalent to the following statement: "dim(g1.interior, g2.interior) != NIL and (dim(g1.interior, g2.interior) <?dim(g1.interior) or dim(g1.interior, g2.interior)?< dim(g2.interior)) and?dim(g1, g2.exterior) != NIL and dim(g2, g1.exterior) != NIL."


The following are expression options and examples:

"G1 CROSS G2"
"G1 CROSSS G2"
"G1 =/ G2"
"CROSS (G1, G2) = TRUE"

"CROSSES (G1, G2) = TRUE"

? ?

IN or CONTAIN spatial relations?
Applies to all group types with the following criteria:

? ?

"G2 IN G1" is equivalent to the following statement: "dim (g2, g1.exterior) = null and dim (g1.interior, g2.interior) != null"


The following are expression options and examples:

<P>"G1 IN G2"
<P>"G1 INSIDE G2"
<P>"G1 CONTAIN G2"
<P>"G1 CONTAINS G2"
<P>"G1 =@ G2"
<P>"IN (G1, G2) = TRUE" /* g1 contained by g2 */
<P>"INSIDE (G1, G2) = TRUE" /* g1 contained by g2 */
<P>"CONTAIN (G1, G2) = TRUE" /* g2 contained by g1 */
<P>"CONTAINS (G1, G2) = TRUE" /* g2 contained by g1 */

? ?

OVERLAP spatial relation

Applies to area/area, line/line, and point/point groups with the following criteria:


"G1 OVERLAP G2" is equivalent to the following statement: "dim (g1) = dim (g2) and dim (g1) = dim (g1.interior, g2.interior) and dim?(g1, g2.exterior) != NULL and dim (g2, g1.exterior) != NULL."

? ?

The following are expression options and examples:

"G1 OVERLAP G2"
"G1 OVERLAPS G2"
"G1 =&amp; G2"
"OVERLAP (G1, G2) = TRUE"
"OVERLAPS (G1, G2) = TRUE"

? ?

IDENTICAL spatial relation
Applies to area/area, line/line, and point/point groups with the following criteria:

? ?

"G1 IDENTICAL G2" is equivalent to the following statement: "dim (g1) = dim (g2) and dim (g1,g2.exterior) = null and dim (g2,g1.exterior)?= null and topoform = true."

? ?

The expression "G1 contains G2 and G2 contains G1" can be true in cases where there is a lack of topological integrity. If so,?the?expression "G1 identical G2" is false.


The following are expression options and examples:

"G1 IDENTICAL G2"
"G1 = G2"
"G1 == G2"
"IDENTICAL (G1, G2) = TRUE"


DISJOINT spatial relation?
Applies to all group types with the following criteria:


"G1 DISJOINT G2" is equivalent to "dim (g1, g2) = NULL."

The following are expression options and examples:

"G1 DISJOINT G2"
"G1 =! G2"
"DISJOINT (G1, G2) = TRUE"

? ?

INTERSECT spatial relation?
Applies to all group types. The INTERSECT relation allows the use of?modifiers with its spatial arguments. These modifiers are BOUNDARY, INTERIOR,?and EXTERIOR with the following criteria:


"G1 INTERSECT G2" is equivalent to "dim (g1, g2) != NULL."


The following are expression options and examples:

"G1 INTERSECT G2.BOUNDARY"
"G1 =? G2"
"INTERSECT (G1.INTERIOR, G2.INTERIOR) = TRUE"

? ?

TOPOFORM spatial relation?
Applies to all group types. This is a unary spatial relation that evaluates to TRUE or FALSE and must be?compared with an equality operator and truth constant for evaluation.

? ?

The following are expression options and examples:

"TOPOFORM = TRUE"

?

Spatial relate function

The RELATE function is supported as unary function for testing against the?entire 9IM array. The 9IM array has nine elements of comparison—three?elements of each shape versus three elements of the other shape. These elements?are boundary, interior, and exterior.

? ?

Each element for the first shape (G1)?can be tested against each element of the?second shape (G2) for truth or falsehood. Selected array elements?can be?selectively ignored.

RELATE is a unary function and is not compared to true or false.


In the?previous example, shapes G1 and G2 are compared. The string ‘FFFTTT***‘?delimited in single quotes, is used to specify whether the intersection of each?of the elements in the 9IM array is true (T), false (F), or not tested (*).?There are exactly nine elements in the string which correspond, from left to right, to the following nine relationships:

? ?

1

G1.interior

G2.interior

2

G1.interior

G2.boundary

3

G1.interior

G2.exterior

4

G1.boundary

G2.interior

5

G1.boundary

G2.boundary

6

G1.boundary

G2.exterior

7

G1.exterior

G2.interior

8

G1.exterior

G2.boundary

9

G1.exterior

G2.exterior

? ?

In the previous example, relationships 1–3 must be false, relationships 4–6 must?be true, and relationships 7–9 are not tested. The truth criteria for any given?shape element relationship is that the dimension of intersection between the?shape elements is not null. This function does not evaluate the dimension of intersection?between the shape elements, whether the intersection exists or not.

? ?

Any two shapes exteriors always intersect and the dimension of?intersection is 2 (area).


It is not necessary to list G1 and G2 in that order in the syntax. See the following example, if you list?G2 first:

? ?

"relate (g2, g1, ‘****T****‘)"

then simply juxtapose G2 for G1 in the above table, and vice-versa.

? ?

SCL usage examples


This statement requires that the two shapes must have a?co-linear boundary, but?their interiors do not intersect.

"g1.interior intersects g2"

-or-

"dim (g1.interior, g2)?> null"

? ?

Shapes?can intersect at many different locations and these?intersections?can occur in different dimensions. Wherever a dimension of?intersection is referred to herein, it refers to the maximum dimension of?intersection?that exists.

SCL keywords and operators

The following are SCL keywords and operators:

? ?

AND

AREA
BOUNDARY
CONTAIN
CONTAINS
CROSS
CROSSES
DIM
DISJOINT
EQUAL
EQUALS
EXTERIOR
FALSE
G1
G2
IDENTICAL
IN
INSIDE
INTERIOR
INTERSECT
INTERSECTS
INTERSECTION
LINEAR
NIL
NOT
NULL
OR
OVERLAP
OVERLAPS
POINT
TOPOFORM
TOUCH
TOUCHES
TRUE
XOR

? ?

Equality operators?
The following are equality operators:

? ?

Spatial operators?
These operators?can be used in?place of the actual spatial relation word in the?expression of spatial relations (not functions):

? ?

Thus the expression "G1 =? G2" is equivalent to "G1 INTERSECT G2."

Shape comparison language

标签:

原文地址:http://www.cnblogs.com/xiexiaokui/p/4985667.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!