我有很多多边形需要手动绘制然后获取地理坐标。
我需要获取 GeoJSON 格式绘制的多边形的坐标。
在这种格式中:
"{"type":"MultiPolygon","coordinates":[[[[37.4653933,55.3959159]...}"
"{"type":"Polygon","coordinates":[[[37.475738525390625,55.41420507450017]...}"
或者在这个:
"{"type":"GeometryCollection","geometries":[{"type":"Polygon","coordinates":[[[-98.0419921875,39.027718840211605]...}]}"
我在以下位置绘制多边形http://geojson.io/ http://geojson.io/。
但从这个网站我只能获取FeatureCollection类型格式的数据。
我找到了另一个网站——https://rodic.fr/blog/online-conversion- Between-geometric-formats/ https://rodic.fr/blog/online-conversion-between-geometric-formats/,我可以在其上转换为 GeoJSON 格式,但该网站只能转换类型 GeometryCollection。
我找不到如何将 FeatureCollection 转换为 GeometryCollection 或 MultiPolygon 或 Polygon。
怎么解决?
非常感谢!
要获取 geojson 格式的坐标,您可以使用以下代码片段:
WITH geojson_featurecollection AS (
SELECT ''::json AS fc
)
SELECT (json_array_elements(fc->'features'))->>'geometry'
FROM geojson_featurecollection;
您可以在其中粘贴整个FeatureCollection定义(来自http://geojson.io http://geojson.io编辑后的网站)在引号内
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)