Oracle_Spatial
This little regex script which removes the Z and M elements from a WKT (Well known text)
SELECT
--below contains X, Y, Z, M
sde.st_astext(shape)
--below contains just X and Y
,REGEXP_REPLACE(replace(replace(sde.st_astext(shape),'-',''),'ZM ','') ,
'(( [0-9]+\.[0-9]{8}){2})( [0-9]+\.[0-9]{8}){2}', '\1') geo_text
FROM MY_ESRI_GEOTABLE;
This would (for example) convert the following WKT text, from this:
LINESTRING ZM ( 582998.53240000 4612664.46140000 0.00000000 15.59552480, 582994.14500000 4612880.96500000 0.00000000 15.73008122)
to this:
LINESTRING ( 582998.53240000 4612664.46140000, 582994.14500000 4612880.96500000)
SELECT
--below contains X, Y, Z, M
sde.st_astext(shape)
--below contains just X and Y
,REGEXP_REPLACE(replace(replace(sde.st_astext(shape),'-',''),'ZM ','') ,
'(( [0-9]+\.[0-9]{8}){2})( [0-9]+\.[0-9]{8}){2}', '\1') geo_text
FROM MY_ESRI_GEOTABLE;
This would (for example) convert the following WKT text, from this:
LINESTRING ZM ( 582998.53240000 4612664.46140000 0.00000000 15.59552480, 582994.14500000 4612880.96500000 0.00000000 15.73008122)
to this:
LINESTRING ( 582998.53240000 4612664.46140000, 582994.14500000 4612880.96500000)
Comments
Post a Comment