基于python的栅格矢量转换
raster 栅格数据 —> vector 矢量数据
对于ArcGIS来做这件事情相当容易,但是如果想用开源软件实现栅格->矢量的转换,并且做一点空间分析,那么用python是再好不过的。我使用的是python-gdal中的gdal_polygonize.py,注意两点,1)栅格和矢量的目录必须已经产生,2)如果要生成矢量数据,请注意它的类型编码,可以在http://www.gdal.org/ogr/ogr_formats.html查到。下面是使用的log:
usage:
gdal_polygonize [-o name=value] [-nomask] [-mask filename] raster_file [-b band]
[-q] [-f ogr_format] out_file [layer] [fieldname]
Microsoft Windows [版本 6.0.6001] 版权所有 (C) 2006 Microsoft Corporation。保留所有权利。
C:\Windows\system32>f:
F:\>cd PyWorkspace\polygonizing\src\
F:\PyWorkspace\polygonizing\src>python gdal_polygonize.py -h
gdal_polygonize [-o name=value] [-nomask] [-mask filename] raster_file [-b band]
[-q] [-f ogr_format] out_file [layer] [fieldname]
F:\PyWorkspace\polygonizing\src>python gdal_polygonize.py ..\input\year2000.tif ..\output\gml\year2000.gml
Creating output ..\output\gml\year2000.gml of format GML.
0…10…20…30…40…50…60…70…80…90…100 – done.
F:\PyWorkspace\polygonizing\src>python gdal_polygonize.py ..\input\year2000.tif -f “ESRI SHAPEFILE” ..\output\gml\year2000.shp
Creating output ..\output\gml\year2000.shp of format ESRI SHAPEFILE.
0…10…20…30…40…50…60…70…80…90…100 – done.
Related posts:
About this entry
You’re currently reading “基于python的栅格矢量转换,” an entry on Geoinformatics
- Published:
- 5.13.09 / 1下午
Ajax ArcGIS Dreams Flex Geography Geoinformatics GeoRSS GIS Google Hardware Harvard History Jquery Linux Love Map MapServer NASA OGC OpenGIS OSGeo PHP Politics PostGIS PostgreSQL Python R Social Network SVG Ubuntu Web WebGIS Wordpress 中国 历史地理 宋朝 开源 新儒学 生活 遥感
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.














赵 博 (Bo Zhao),
参与或主持的项目
No comments
Jump to comment form | comments rss [?] | trackback uri [?]