ST_Polygon

Definición

La función del descriptor de acceso ST_Polygon toma una representación de texto conocida (WKT) y un Id. de referencia espacial (SRID) y genera un ST_Polygon.

NotaNota:

Cuando crea tablas espaciales que se utilizarán con ArcGIS, es mejor crear la columna como ST_Geometry en vez de especificar un subtipo de ST_Geometry, como ST_Polygon.

Sintaxis

Oracle

sde.st_polygon (wkt clob, srid integer)

PostgreSQL

sde.st_polygon (wkt clob, srid integer)
sde.st_polygon (esri_shape bytea, srid integer)

SQLite

st_polygon (wkt text, srid int32)

Tipo de devolución

ST_Polygon

Ejemplo

La siguiente declaración CREATE TABLE crea las tablas polygon_test, que tienen una única columna, p1. Después la declaración INSERT convierte un anillo (un polígono que es cerrado y simple) en un ST_Polygon y lo inserta en la columna p1 utilizando la función ST_Polygon.

Oracle

CREATE TABLE polygon_test (p1 sde.st_geometry);

INSERT INTO polygon_test VALUES (  
 sde.st_polygon ('polygon ((10.01 20.03, 20.94 21.34, 35.93 10.04, 10.01 20.03))', 4326)
);

PostgreSQL

CREATE TABLE polygon_test (p1 sde.st_geometry);

INSERT INTO polygon_test VALUES (  
 sde.st_polygon ('polygon ((10.01 20.03, 20.94 21.34, 35.93 10.04, 10.01 20.03))', 4326)
);

SQLite

CREATE TABLE poly_test (id integerp1 geometryblob);

SELECT AddGeometryColumn(
 NULL,
 'poly_test',
 'p1',
 4326,
 'polygon',
 'xy',
 'null'
);

INSERT INTO poly_test VALUES (  
 1,
 st_polygon ('polygon ((10.01 20.03, 20.94 21.34, 35.93 10.04, 10.01 20.03))', 4326)
);

Temas relacionados

5/10/2014