![](https://img-blog.csdnimg.cn/20200403142711320.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
GDAL/OGR中文手册
python GDAL/OGR中文翻译手册
英文地址:http://pcjericks.github.io/py-gdalogr-cookbook/
llc的足迹
print("hello csdn!")
展开
-
GDAL/OGR中文手册——完整版
项目地址:Github欢迎指正!原创 2021-05-29 14:09:40 · 4670 阅读 · 2 评论 -
1 GDAL/OGR一般使用
检测安装from osgeo import gdal查看版本gdal.VersionInfo('VERSION_NUM')# '2040100'开启python异常默认情况下,发生错误时,GDAL/OGR Python绑定不会引发异常。相反,它们返回错误值(例如None),并将错误消息写入sys.stdout。你可以通过调用UseExceptions()函数来开启异常:from...翻译 2020-03-08 16:16:59 · 1804 阅读 · 0 评论 -
2 几何
创建点from osgeo import ogrpoint = ogr.Geometry(ogr.wkbPoint)point.AddPoint(1198054.34, 648493.09)print(point.ExportToWkt())创建线from osgeo import ogrline = ogr.Geometry(ogr.wkbLineString)line.Add...翻译 2020-03-08 16:22:47 · 436 阅读 · 0 评论 -
3 矢量图层
删除文件from osgeo import ogrimport osDriverName = "ESRI Shapefile" # e.g.: GeoJSON, ESRI ShapefileFileName = 'test.shp'driver = ogr.GetDriverByName(DriverName)if os.path.exists(FileName): ...翻译 2020-03-09 16:52:37 · 1096 阅读 · 0 评论 -
4 栅格图层
关闭栅格数据from osgeo import gdal# 打开数据ds = gdal.Open('test.tif')# 关闭数据(非必须)ds = None获取元数据from osgeo import gdalgtif = gdal.Open( "merge.tif" )print (gtif.GetMetadata())波段融合from osgeo import...翻译 2020-03-10 11:41:30 · 756 阅读 · 5 评论 -
5 投影
创建投影from osgeo import osrspatialRef = osr.SpatialReference()spatialRef.ImportFromEPSG(4326) #WGS84重投影from osgeo import ogrfrom osgeo import osrsource = osr.SpatialReference()source.ImportFro...翻译 2020-03-10 14:09:37 · 267 阅读 · 0 评论