Is there a function to inverse the ST_MAKEPOLYGON and get a linestring from a polygon?
The best option I have found so far is to modify the geometry at the WKB level.
with data AS (
SELECT ST_MAKEPOLYGON(ST_MAKELINE([
ST_GEOGPOINT(7.48,6.74),
ST_GEOGPOINT(7.50,6.73),
ST_GEOGPOINT(7.47,6.76),
ST_GEOGPOINT(7.48,6.74)
])) AS my_polygon
)
SELECT
ST_GEOGFROMWKB(CONCAT(b'\x01\x02',SUBSTR(ST_ASBINARY(my_polygon),7)))
FROM data
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.