ST_Entity

HinweisHinweis:

Nur Oracle und SQLite

Definition

Mit ST_Entity wird der räumliche Entitätstyp eines Geometrieobjekts zurückgegeben. Der räumliche Entitätstyp ist der im Entitätsmitgliedsfeld des Geometrieobjekts gespeicherte Wert.

Syntax

Oracle

sde.st_entity (geometry1 sde.st_geometry)

SQLite

st_entity (geometry1 geometryblob)

Rückgabetyp

Es wird eine Zahl (Oracle) oder Ganzzahl (SQLite) zurückgegeben, die die folgenden Entitätstypen darstellt:

0

NIL-Shape

1

Punkt

2

Linie (umfasst Spagettilinien)

4

Linestring

8

Fläche

257

Multipoint

258

Multiline (umfasst Spagettilinien)

260

Multilinestring

264

Multiarea

Beispiel

Im folgenden Beispiel wird eine Tabelle erstellt und es werden drei Geometrietypen eingefügt. Anschließend wird "ST_Entity" ausgeführt, um den Geometrie-Subtype jedes Datensatzes in der Tabelle zurückzugeben.

Oracle

CREATE TABLE sample_geos (
 id integer,
 geometry sde.st_geometry
);

INSERT INTO sample_geos (id, geometry) VALUES (
 1901,
 sde.st_geometry ('point (1 2)', 4326)
);

INSERT INTO sample_geos (id, geometry) VALUES (
 1902,
 sde.st_geometry ('linestring (33 2, 34 3, 35 6)', 4326)
);

INSERT INTO sample_geos (id, geometry) VALUES (
 1903,
 sde.st_geometry ('polygon ((3 3, 4 6, 5 3, 3 3))', 4326)
);

SELECT sde.st_entity (geometry) entity, UPPER (sde.st_geometrytype (geometry)) TYPE
 FROM sample_geos;

    ENTITY        TYPE

    1    ST_POINT
    4    ST_LINESTRING
    8    ST_POLYGON

SQLite

CREATE TABLE sample_geos (
 id integer primary key autoincrement not null
);

SELECT AddGeometryColumn (
 NULL,
 'sample_geos',
 'geometry',
 4326,
 'geometry',
 'xy',
 'null'
);

INSERT INTO sample_geos (geometry) VALUES (
 st_geometry ('point (1 2)', 4326)
);

INSERT INTO sample_geos (geometry) VALUES (
 st_geometry ('linestring (33 2, 34 3, 35 6)', 4326)
);

INSERT INTO sample_geos (geometry) VALUES (
 st_geometry ('polygon ((3 3, 4 6, 5 3, 3 3))', 4326)
);

SELECT st_entity (geometry) AS "entity",
 st_geometrytype (geometry) AS "type"
 FROM sample_geos;

entity    type

1         ST_POINT
4         ST_LINESTRING
8         ST_POLYGON

Verwandte Themen

5/10/2014