arcgis多面体数据转面_PostGIS-将多面转换为单面

Is it possible to import a shape file containing multipolygons into single polygon in PostGIS? Whenever I try importing a shape file of a polygon, it is stored as a multipolygon (as opposed to a single polygon) in a geom column. Thus, I am unable to extract it as a single polygon value from the multipolygon.

All helpful suggestions much appreciated

解决方案

You can use ST_GeometryN together with ST_NumGeometries and the generate_series function to obtain what you need.

Let's assume you have the table from Jakub's example:

CREATE TABLE multi AS(

SELECT 1 as id, 2 as test, ST_GeomFromText('MULTIPOLYGON(((0 0,4 0,4 4,0 4,0 0)),((1 1,2 1,2 2,1 2,1 1)), ((-1 -1,-1 -2,-2 -2,-2 -1,-1 -1)))') AS geom

);

This one contains a multipolygon, an id and another column.

To get each single polygon from the table including all other attributes try something like:

SELECT id, test, ST_GeometryN(geom, generate_series(1, ST_NumGeometries(geom))) AS geom

FROM multi

"id" and "test" are the values for each row in the original table.

generate_series creates a series of numbers from 1 to the number of geometries in each row.

Therefore you will split each multi geometry in its separate single geometry parts and the values in the other columns remain the same.

Just replace the columns and table in the example with the columns from your exported shapefile and you will get the table with the single polygons.

Hope this answers your question.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
wrf_hydro_arcgis-preprocessor是一个用于WRF-Hydro模型的预处理工具,它集成了WRF(Weather Research and Forecasting)模型和ArcGIS(地理信息系统软件),以便进行水文模拟和分析。 该预处理工具主要用于将大气和水文数据准备为WRF-Hydro模型所需的输入格式。它能够导入地理空间数据,包括高程(DEM)、土地利用、土壤类型等,并将这些数据转换为与WRF-Hydro模型所需的格式相匹配的GIS地图。此外,还可以导入大气数据,如降水、蒸发、风速等,并对其进行处理,以便在水文模拟中使用。 wrf_hydro_arcgis-preprocessor还提供了一些功能来帮助用户进行水文模拟的准备工作。例如,它可以生成网格参数文件,用于定义计算网格的空间分辨率和拓扑关系。它还可以根据用户的需求设置模型的时间和空间范围,并对输入数据进行剪切和插值。 另外,该工具还提供了一些可视化和分析功能,以帮助用户理解和评估模型的输出结果。用户可以使用ArcGIS中的地图工具来查看模拟结果,如地表径流、地下径流、土壤湿度等。此外,还可以通过绘制图表和统计数据来分析模拟结果,以便进行水资源管理和决策制定。 总之,wrf_hydro_arcgis-preprocessor是一个方便实用的工具,它能够帮助用户准备数据并进行水文模拟和分析。它的集成了WRF和ArcGIS的功能,使得用户可以更加便捷地进行水文研究和实践。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值