Difference between revisions of "GDAL"

From openwfm
Jump to navigation Jump to search
 
(53 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Installation==
 
==Installation==
Best install using standard system package manager, such as apt-get (Ubuntu), yum (Fedora), or macports (OSX).
+
Best install using standard system package manager, such as apt-get (Ubuntu), yum (Fedora), or [https://www.macports.org/ macports] (OSX).
  
==Download of source code==
+
==Download==
The current download page is from http://download.osgeo.org/gdal/. However, web searches lead to dead links or irrelevant redirects.
+
The current download page is http://download.osgeo.org/gdal/. However, web searches for the code or documentation lead to many dead links to defuncts sites. In particular, almost all links leading inside https://gdal.org/ from internet search engines are dead.
  
 
==Documentation==
 
==Documentation==
* Some apparently legacy documentation is at https://trac.osgeo.org/gdal/wiki which appears to be legacy but as far as I can tell it is actually the current one, and also leads to another download page.
+
* Web searches for "gdal documentation" are futile, but there is index to just that at https://gdal.org and wiki https://trac.osgeo.org/gdal/wiki, which also links to alternative download pages. But that wiki seems old, there is a new wiki at https://wiki.osgeo.org/wiki/Main_Page.
* The documentation for version 2.4.0 was installed as described above [http://demo.openwfm.org/web/gdal-2.4.0/html/index.html here].
+
* The software installs without man pages and typing gdal utilities from the command line with -help gives only a brief list of options. But the following works:
 +
** Download the appropriate version of sources  as tar.gz file and expand the file
 +
** install doxygen if needed, and type doxygen in the top directory of the source
 +
** Open html/index.html in a web browser
 +
* Documentation was installed as described above for [http://demo.openwfm.org/web/gdal-2.4.0/html/index.html version 2.4.0] and [http://demo.openwfm.org/web/gdal-3.0.0/html/index.html version 3.0.0]
 +
* There is https://live.osgeo.org/en/quickstart/gdal_quickstart.html
 +
 
 +
==How to==
 +
===Subset a dataset===
 +
<pre>
 +
gdal_translate -projwin_srs '+proj=longlat +datum=WGS84 +no_defs' -projwin -120 39 -119 38 file.tif subset.tif
 +
gdal_translate -projwin_srs '+proj=stere +lat_0=38.5 +lon_0=-119.5 +datum=WGS84 +units=km +no_defs' -projwin -50 50 50 -50 file.tif subset.tif
 +
</pre>
 +
 
 +
==External links==
 +
* https://gis.stackexchange.com/questions/164853/reading-modifying-and-writing-a-geotiff-with-gdal-in-python
 +
* https://spatialreference.org/ translation of EPSG codes and proj4 etc.
 +
* https://medium.com/planet-stories/a-gentle-introduction-to-gdal-part-1-a3253eb96082
 +
* https://gis.stackexchange.com/questions/33330/how-do-i-extract-a-rasters-extent-in-python
 +
* [https://gis.stackexchange.com/questions/175293/difference-between-datum-and-ellipsoid-for-geodetic-coordinates Datum and ellipsoid are not the same thing]
 +
* [https://gis.stackexchange.com/questions/42584/how-to-call-gdal-translate-from-python-code How to call gdal translate from python code]
 +
* [https://automating-gis-processes.github.io/2016/Lesson7-read-raster.html Reading raster files with GDAL]
 +
* [http://erouault.blogspot.com/2015/10/gdal-and-ogr-utilities-as-library.html GDAL and OGR utilities as library]
 +
* [https://stackoverflow.com/questions/2922532/obtain-latitude-and-longitude-from-a-geotiff-file Obtain latitude and longitude from a GeoTIFF file]
 +
* [https://pcjericks.github.io/py-gdalogr-cookbook/ Python GDAL/OGR Cookbook]
 +
* https://stackoverflow.com/questions/50191648/gis-geotiff-gdal-python-how-to-get-coordinates-from-pixel
 +
* [https://wiki.osgeo.org/wiki/OSGeo_Python_Library OSGeo Python Library]
 +
* [https://trac.osgeo.org/gdal/wiki/GdalOgrInPython GDAL/OGR in Python (old wiki)]
 +
* https://stackoverflow.com/questions/52777153/convert-longitude-latitude-to-pixel-values-using-gdal
 +
* https://www.geos.ed.ac.uk/~smudd/TopoTutorials/html/tutorial_raster_conversion.html
 +
* https://pypi.org/project/geoio/
 +
* https://gisgeography.com/free-gis-software/
 +
* https://qgis.org
 +
* https://www.qgistutorials.com
 +
* [http://www.pkrc.net/wrf-lambert.html The pitfalls of Lambert conformal projection in WRF and MM5]
 +
* [https://fabienmaussion.info/2018/01/06/wrf-projection Map projections in WRF: it's easy to get it wrong] includes also examples of maps from WRF using [https://pypi.org/project/salem/ salem]
 +
* [https://gisgeography.com/wgs84-world-geodetic-system/ WGS84] [https://gisgeography.com/nad83-north-american-datum/ NAD83] simple explanations, not technical
 +
* https://www.codeguru.com/cpp/g-m/bitmap/viewers/article.php/c9187/2D--3D-Visualization-Techniques-for-GeoReferenced-Images.htm
 +
* http://pyproj4.github.io/pyproj/html/api/geod.html
 +
* https://janakiev.com/blog/gps-points-distance-python/
 +
* https://trac.osgeo.org/gdal/ticket/4267 on stereo projection
 +
 
 +
==Glossary==
 +
* WKT: [[wikipedia:Well-known text representation of coordinate reference systems|Well-known text representation of coordinate reference systems]] or [[wikipedia:Well-known_text_representation_of_geometry|Well-known text representation of geometry]], a text markup language for representing vector geometry objects
 +
* SRS: [[wikipedia:Spatial reference system|Spatial reference system]]: a complete set of parameters that determine how to associate a point on a map with a point on the Earth surface (system of coordinates, map projection, and datum).  
 +
* [[wikipedia:Latitude|Latitude]] - there is more than one because the Earth is not a sphere
 +
 
 +
==See also==
 +
* [[How to run WRF-Fire with real data]]
 +
* [[WPS with GeoTIFF support]]

Latest revision as of 22:27, 11 June 2019

Installation

Best install using standard system package manager, such as apt-get (Ubuntu), yum (Fedora), or macports (OSX).

Download

The current download page is http://download.osgeo.org/gdal/. However, web searches for the code or documentation lead to many dead links to defuncts sites. In particular, almost all links leading inside https://gdal.org/ from internet search engines are dead.

Documentation

How to

Subset a dataset

gdal_translate -projwin_srs '+proj=longlat +datum=WGS84 +no_defs' -projwin -120 39 -119 38 file.tif subset.tif
gdal_translate -projwin_srs '+proj=stere +lat_0=38.5 +lon_0=-119.5 +datum=WGS84 +units=km +no_defs' -projwin -50 50 50 -50 file.tif subset.tif

External links

Glossary

See also