GDAL 筆記二:python for GDAL
介紹
Github上找到的好東西,煮書主要還是覆蓋了創(chuàng)建數(shù)據(jù)類型,統(tǒng)計數(shù)據(jù)量,轉(zhuǎn)換數(shù)據(jù)等鉴吹。
個人感覺基于GDAL的二次開發(fā)姨伟,比ArcGIS Engine更加實用,因為更加基礎(chǔ)豆励,更加抽象夺荒,更加底層。
例子
gdal的安裝目錄內(nèi)置了很多腳本良蒸,其中包括gcp2vec.py
技扼,gdal_auth.py
,gdal_calc.py
嫩痰,gdal_edit.py
剿吻,gdal_fillnodata.py
,gdal_merge.py
串纺,gdal_polygonize.py
丽旅,gdal_proximity.py
,gdal_retile.py
纺棺,gdal_sieve.py
榄笙,gdal2tiles.py
,gdal2xyz
祷蝌,gdalchksum
茅撞,gdalcompare
,gdalident.py
,gdalimport.py
米丘,gdalmove.py
等剑令。
gdal2tiles.py是一個gdal的擴展插件,運用gdal的數(shù)據(jù)接入口蠕蚜,將柵格圖片切成小瓦片和元數(shù)據(jù)尚洽,遵循OSGeo TMS標(biāo)準(zhǔn)。讓你自己的數(shù)據(jù)在openlayers和googlemap靶累,方便你展示空間數(shù)據(jù)腺毫。
注意:瓦片編號為谷歌圖片編號,如果需要給leaflet等使用挣柬,Y軸需要進行數(shù)據(jù)轉(zhuǎn)換潮酒。
Y(Tencent) + Y(Google) = Math.pow(2,zoom) - 1
邪蛔,參考騰訊與百度地圖瓦片規(guī)則分析急黎。
gdal2tiles.py [-p profile] [-r resampling] [-s srs] [-z zoom]
[-e] [-a nodata] [-v] [-q] [-h] [-k] [-n] [-u url]
[-w webviewer] [-t title] [-c copyright]
[-g googlekey] [-b bingkey] input_file [output_dir]
**-p** *PROFILE*, –profile=*PROFILE*:
Tile cutting profile (mercator,geodetic,raster) - default 'mercator' (Google Maps compatible).
**-r** *RESAMPLING*, –resampling=*RESAMPLING*:
Resampling method (average,near,bilinear,cubic,cubicspline,lanczos,antialias) - default 'average'.
**-s** *SRS*, –s_srs=*SRS*:
The spatial reference system used for the source input data.
**-z** *ZOOM*, –zoom=*ZOOM*:
Zoom levels to render (format:'2-5' or '10').
**-e**, –resume:
Resume mode. Generate only missing files.
**-a** *NODATA*, –srcnodata=*NODATA*:
NODATA transparency value to assign to the input data.
**-v, –verbose**
Generate verbose output of tile generation.
**-q, –quiet**
Disable messages and status to stdout (GDAL >= 2.1).
**-h, –help**
Show help message and exit.
**--version**
Show program's version number and exit.
**KML (Google Earth) options:**
Options for generated Google Earth SuperOverlay metadata
**-k, –force-kml**
Generate KML for Google Earth - default for 'geodetic' profile and 'raster' in EPSG:4326. For a dataset with different projection use with caution!
**-n, –no-kml**:
Avoid automatic generation of KML files for EPSG:4326.
**-u** *URL*, –url=*URL*:
URL address where the generated tiles are going to be published.
**Web viewer options:**
Options for generated HTML viewers a la Google Maps
**-w** *WEBVIEWER*, –webviewer=*WEBVIEWER*:
Web viewer to generate (all,google,openlayers,leaflet,none) - default 'all'.
**-t** *TITLE*, –title=*TITLE*:
Title of the map.
**-c** *COPYRIGHT*, –copyright=*COPYRIGHT*:
Copyright for the map.
**-g** *GOOGLEKEY*, –googlekey=*GOOGLEKEY*:
Google Maps API key from [http://code.google.com/apis/maps/signup.html](http://code.google.com/apis/maps/signup.html).
**-b** *BINGKEY*, –bingkey=*BINGKEY*:
Bing Maps API key from [https://www.bingmapsportal.com/](https://www.bingmapsportal.com/)
GDAL for .NET
在.NET平臺GDAL有很多坑,不建議使用侧到,已排雷勃教。
This directory in the GDAL project tree has some C# examples, specifically this one that might suit your needs.
You can find the GDAL API documentation here
There is an GDAL API tutorial here
The OGR API documentation is here
The OSR API documentation is here
All the links you need for GDAL can be reached from http://www.gdal.org/
All the links you need for OGR/OSR can be reached from http://www.gdal.org/ogr/
轉(zhuǎn)載,請表明出處匠抗。總目錄Awesome GIS