muthubuntu commented on issue #32127: URL: https://github.com/apache/superset/issues/32127#issuecomment-4709898758
I have been using a method to use ST_Dump(multipolygon_geom) as taken from this post: https://stackoverflow.com/a/64783553 Basically: **SINGLEPART** GEOM ``` SELECT *, json_build_object( 'type', 'Polygon', 'geometry', ST_AsGeoJSON(geom)::json)::text as geoJSON FROM <my-schema>.<my-table>; ``` **MULTIPART / MULTIPOLYGONS** (will this also work for multilines and multipoints?) ``` SELECT *, json_build_object( 'type', 'Polygon', 'geometry', ST_AsGeoJSON((ST_DUMP(geom)).geom::geometry(Polygon, 27700))::json)::text as geoJSON FROM <my-schema>.<my-table>; ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
