ST_GeomFromShape

NotaNota:

ST_Geometry para PostgreSQL solamente

Definición

ST_GeomFromShape construye un objeto ST_Geometry de una forma de Esri.

Sintaxis

st_geomfromshape (esri_shape bytea, srid integer)

Tipo de devolución

ST_Geometry

Ejemplo

En el siguiente ejemplo, se introduce un registro en la tabla geoshape con un Id. y dos columnas de geometría.

CREATE TABLE geoshape (id integer, g1 sde.st_geometry, g2 bytea);

Las declaraciones INSERT introducen los datos en las columnas de la tabla geoshape. La declaración SELECT al final garantiza que los datos se introducen en la columna g1.

INSERT INTO geoshape (id, g1) VALUES ( 1,  sde.st_geometry ('point (10 10)', 0) );  INSERT INTO geoshape (id, g1) VALUES ( 2, sde.st_geometry ('linestring (10 10, 20 20, 30 30)', 0) );  UPDATE geoshape SET g2 = sde.st_asshape (g1) WHERE id = 1;  UPDATE geoshape SET g2 = sde.st_asshape (g1) WHERE id = 2;  SELECT id, sde.st_astext (sde.st_geomfromshape (g2, 0)) FROM geoshape;  id    st_astext 1	POINT ( 10 10) 2	LINESTRING ( 10 10, 20. 20, 3 30)
9/11/2013