Skip to content

Latest commit

 

History

History
77 lines (52 loc) · 1.64 KB

File metadata and controls

77 lines (52 loc) · 1.64 KB

GDAL

Raster

Vector

Optimize GeoTIFF files

Create tiled file and build overview images

gdal_translate -of GTiff -co "TILED=YES" -co "TFW=YES" <source>.tif <file>.tif
gdaladdo -r average <file>.tif 2 4 8 16

See optimize_raster.py

Build raster tileindex

dir /s/b *.tif > list.txt
gdaltindex tiles.shp --optfile list.txt
del list.txt

Rasterize vector data

gdal_rasterize -l <file> -a <attribute> -tr <resolution>.0 <resolution>.0 -a_nodata 0 -ot Int32 <file>.shp <file>.tif

Polygonize raster grid

gdal_polygonize <file>.tif -f "ESRI Shapefile" <file> <file>

Convert raster data

GeoTIFF to Binary Terrain

gdal_translate -of bt <file>.tif <file>.bt

See convert_to_bt.py

Convert vector data

Usage

ogr2ogr -f "<format>" [options] <dst_datasource_name> <src_datasource_name>

Formats

  • ESRI Shapefile: ESRI Shapefile
  • GeoJSON: GeoJSON

Options

  • -t_srs: Reproject to SRS (-t_srs EPSG:<code>)
  • -select: List of fields (-select "<field1>, <field2>")
  • -where: Attribute query (-where "<field> = '<value>'")