<repository> <id>osgeo</id> <name>OSGeo Release Repository</name> <url>https://repo.osgeo.org enabled></snapshots> <releases><enabled>true</enabled></releases> </repository> <repository> <id>osgeo-snapshot </id> <name>OSGeo Snapshot Repository</name> <url>https://repo.osgeo.org/repository/snapshot/</
conda多环境管理 首先安装内核管理工具 pip install ipykernel 创建虚拟环境的内核(使用命令创建以后就可以在Jupyter中看到新创建的内核了) source activate osgeo python -m ipykernel install --user --name osgeo --display-name "Python (osgeo)" 查看创建的虚拟环境内核 jupyter kernelspec list 删除创建的虚拟环境内核 jupyter kernelspec uninstall osgeo
基本思路 使用GDAL创建Shapefile数据的基本步骤如下: 使用osgeo.ogr.Driver的CreateDataSource()方法创建osgeo.ogr.DataSource矢量数据集 使用osgeo.ogr.DataSource的CreateLayer()方法创建一个图层 使用osgeo.ogr.FieldDefn()定义Shapefile文件的属性字段 创建osgeo.ogr.Feature 对象,设置每个属性字段的值,使用Feature对象的SetGeometry()定义几何属性 创建Feature对象以后,使用osgeo.ogr.Layer的CreateFeature()添加Feature from osgeo import ogr from osgeo import osr import json import os os.environ['SHAPE_ENCODING'] = "utf
whitebox-gat-geospatial-analysis-toolbox/ SAGA:https://saga-gis.sourceforge.io/en/index.html https://www.osgeo.org https://www.mapwindow.org/ ILWIS:https://www.itc.nl/ilwis/ DIVA GIS:http://swww.diva-gis.org/ OSGeo :https://www.osgeo.cn/ 全国地理信息资源目录服务系统:https://www.webmap.cn/main.do?
参见一个小程序: from osgeo import gdal file_path = '/home/theone/Data/GreatKhingan/DEM/Slope_GreatKhingan_500m.tif dataset.GetMetadata() print(metadata) projection = dataset.GetProjection() print(projection) 运行结果: <class 'osgeo.gdal.Dataset
,可以使用颜色列表创建 colormap: from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt from osgeo basemap 读取并使用这种文件的例子: from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt from osgeo 注1:http://matplotlib.org/api/colors_api.html#matplotlib.colors.Colormap 注2:http://grass.osgeo.org/grass64
兼容信息可以查看: http://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS $ wget http://download.osgeo.org /gdal/2.2.3/gdal-2.2.3.tar.gz $ wget http://download.osgeo.org/proj/proj-4.8.0.tar.gz $ wget http://download.osgeo.org /geos/geos-3.3.3.tar.bz2 $ wget http://download.osgeo.org/postgis/source/postgis-2.2.6.tar.gz 2.2 解压编译安装
兼容信息可以查看: http://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS $ wget http://download.osgeo.org /gdal/2.2.3/gdal-2.2.3.tar.gz $ wget http://download.osgeo.org/proj/proj-4.8.0.tar.gz $ wget http://download.osgeo.org /geos/geos-3.3.3.tar.bz2 $ wget http://download.osgeo.org/postgis/source/postgis-2.2.6.tar.gz 2.2 解压编译安装
MapServer服务器 官方地址:https://mapserver.org/ MapServer与GeoServer的区别:https://www.osgeo.cn/tutorial/k8b24 下载地址 QGIS的区别,这篇文章有介绍:http://t.csdn.cn/t7GAR QGIS下载地址:https://www.qgis.org/zh-Hans/site/ QGIS介绍:https://www.osgeo.cn /page/qgis QGIS教程:https://www.osgeo.cn/qgis-tutorial/ QGIS文档:https://docs.qgis.org/3.28/zh-Hans/docs/ downloading-sample-data 有各平台版本的下载(这里我选择Win 3.28): 可以直接安装发行版(https://zhuanlan.zhihu.com/p/370633306),如下: 也可通过OSGeo4W
GDALVectorTranslate(),Python中是gdal.VectorTranslate() 使用GDAL提供的基本API进行实现 如果要自己利用基本API函数实现的话,基本思路如下: 利用osgeo.ogr.Driver.CreateDataSource ()创建输出数据 根据源文件创建目标文件的属性字段定义 利用osgeo.osr.CoordinateTransformation对象将源文件中的Geometry对象转为目标文件中的Geometry对象( 其实质是进行不同投影系统下空间几何体的坐标转换) 遍历源文件,依次将所有几何体的Geometry及其属性写入目标文件 代码实现 调用gdal.VectorTranslate()命令行工具的包装函数实现: from osgeo src_file) src_layer = src_ds.GetLayer(0) src_srs = src_layer.GetSpatialRef() # 输入数据投影 调用基本API函数实现 from osgeo import ogr from osgeo import osr import os os.environ['SHAPE_ENCODING'] = "utf-8" src_file = 'China.shp
Python python中有多个库提供了处理NetCDF文件的功能,比如专门处理nc数据的netCDF4-python,scipy,osgeo,PyNIO(Linux)等。 netCDF4-python 相同 lon = data.variables["XLONG"] lat = data.variables["XLAT"] sst = data.variables["SST"] osgeo.gdal 模块 具体的应用见这里 Basemap系列教程:读取WRF模式数据 # 加载模块 from osgeo import gdal # 读取方式略有不同 # 'NETCDF:"' + filename wrfout_v2_Lambert.nc" + '":SST') 但是按照上述方式读取出变量之外,无法直接用于绘图和其他处理,因为变量类型和之前的方法输出的变量类型不同: type(lon) Out[106]: osgeo.gdal.Dataset
from osgeo import gdal import numpy as np from osgeo import osr #使用gdal.Warp对MODIS数据进行重投影。 from osgeo import gdal import numpy as np from osgeo import osr #使用gdal.Warp对MODIS数据进行重投影。
译注: 读取 NetCDF文件也可以使用 netcdf4 库 绘制域 from osgeo import gdal from mpl_toolkits.basemap import Basemap import from osgeo import gdal from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt wrf_out_file 地图的边界和数据的边界并没有很好的匹配 Wind barbs Basemap 有函数可以很容易绘制 wind barbs(不像其它 gis 库) from osgeo import gdal from
true boundlessgeo http://repo.boundlessgeo.com/main osgeo http://download.osgeo.org/webdav/geotools install src/
/www.lfd.uci.edu/~gohlke/pythonlibs/#gdal 有些老版本gdal的引入方式是直接import: import gdal 新版本的gdal引入方式如下: from osgeo import gdal 行列数和波段数 下面的示例读取了一张tif遥感图片,输出该栅格数据的行列数和波段数: from osgeo import gdal data = gdal.Open("xdu.tif rows:37787 cols:36805 bands:4 坐标转换参数 GetGeoTransform()方法返回栅格数据的坐标转换参数,即行列坐标与空间坐标的转换参数,示例: from osgeo ”,NORTH],AUTHORITY[“EPSG”,“32649”]] 栅格数据转数组 ReadAsArray()方法可实现将栅格数据转换成数组(Array)形式,以便后续处理,示例: from osgeo 对于多波段栅格数据,ReadAsArray()函数返回(bands, rows, columns) 按块读取栅格 ReadAsArray同样支持按块读取栅格信息,即读取部分区域图像信息,示例: from osgeo
Conda的使用 新建虚拟环境(Managing environments) conda create -n osgeo 切换到新建的虚拟环境 source activate osgeo (Linux 和macOS) activate osgeo (Windows) 退出虚拟环境 source deactivate (Linux和macOS) deactivate (Windows) 实用命令:
代码如下: from osgeo import ogr import os, sys from osgeo import gdal from osgeo.gdalconst import * import
对于nmake64.opt,修改的内容为: #INSTDIR=C:\OSGeo4W64 INSTDIR=C:\OSGeo4W64 而对于makefile64.vc,修改的内容为: # CFLAGS = -Iheaders -IC:\OSGeo4W64\include $(OPTFLAGS) CFLAGS = /nologo -I. \lib\iconv.lib \ C:\OSGeo4W64\lib\libexpat.lib \ C:\OSGeo4W64\lib\libminizip.lib \ C:\OSGeo4w64 可以使用这篇文章中提供了一个源代码版本,然后按需修改nmake64.opt: #INSTDIR=C:\OSGeo4W64 INSTDIR=C:\Work\3rdparty 同样修改makefile64. vc: #CFLAGS = /nologo -IC:\OSGeo4W64\include -I.
flask还是django,掌握SQLAlchemy多可以让你的开发更为高效 一些资源 官方地址:https://www.sqlalchemy.org 1.4Beta版中文文档:https://www.osgeo.cn port> 为Mysql数据库的访问ip及端口 <dbname>为要访问的数据库 <options> 为可选项参数 其他实例就不一一写了,大家可以直接看beta版的中文文档如下 https://www.osgeo.cn
version >= 3.4.0; export PATH=/Bioinfo/Pipeline/SoftWare/gcc-4.8.5/bin:$PATH wget https://download.osgeo.org export PATH=/Bioinfo/Pipeline/SoftWare/gcc-4.8.5/bin:$PATH wget https://download.osgeo.org/proj/proj- $enabledevtoolset4 wget http://download.osgeo.org/gdal/2.2.0/gdal-2.2.0.tar.gz tar zvxf gdal-2.2.0.tar.gz