ST_GeomFromShape |
|
Release 9.3 |
NOTE: Spatial type for PostgreSQL only
st_geomfromshape (esri_shape bytea, srid integer)
CREATE TABLE geoshape (id integer, g1 st_geometry, g2 bytea);
INSERT INTO geoshape (id, g1) VALUES (
1,
st_geometry ('point (10 10)', 0)
);
INSERT INTO geoshape (id, g1) VALUES (
2,
st_geometry ('linestring (10 10, 20 20, 30 30)', 0)
);
UPDATE geoshape
SET g2 = st_asshape (g1)
WHERE id = 1;
UPDATE geoshape
SET g2 = st_asshape (g1)
WHERE id = 2;
SELECT id, st_astext (st_geomfromshape (g2, 0))
FROM geoshape;
id st_astext
1 POINT ( 10 10)
2 LINESTRING ( 10 10, 20. 20, 3 30)