File tree Expand file tree Collapse file tree 3 files changed +69
-0
lines changed
parts/01.Introduction-to-GDAL Expand file tree Collapse file tree 3 files changed +69
-0
lines changed Original file line number Diff line number Diff line change
1
+ ### Retrieving Information from Raster Data
2
+
3
+ > gdalinfo srtm_37_02.tif <ENTER >
4
+
5
+ ### Retrieve Information from Vector Data
6
+
7
+ > ogrinfo -al roads.shp | more <ENTER >
8
+
9
+ > ogrinfo -al gem_2011_gn1.shp | more <ENTER >
10
+
Original file line number Diff line number Diff line change
1
+ ### Reproject Raster Data
2
+
3
+ > gdalwarp -t_srs EPSG:... <input > <output >
4
+
5
+ > gdalwarp -t_srs EPSG: XXXXX srtm_37_02.tif dem_rd.tif
6
+
7
+ > gdalwarp -t_srs EPSG:28992 srtm_37_02.tif dem_rd.tif <ENTER >
8
+
9
+ ### Reproject Vector Data
10
+
11
+ > ogr2ogr -t_srs EPSG: XXXXX <output > <input >
12
+
13
+ > ogr2ogr -t_srs EPSG:28992 roadsreprojected.shp roads.shp
14
+
Original file line number Diff line number Diff line change
1
+ ### Convert Raster Formats
2
+
3
+ > gdal_translate -of FORMAT inputFile outputFile
4
+
5
+ > gdal_translate -of SAGA dem_rd.tif dem_rd.sdat
6
+
7
+ > gdal_translate -of PCRaster -ot Float32 -mo "VS_SCALAR" dem_rd.tif dem_rd.map
8
+
9
+ ### Convert Vector Formats
10
+
11
+ > ogr2ogr -f <"Format"> <output > <input >
12
+
13
+ > ogr2ogr -f "KML" gem.kml gem_2011_gn1.shp
14
+
15
+ ### Spatial Queries of Vector Data
16
+
17
+ > ogr2ogr -f "ESRI Shapefile" -where GM_NAAM='Delft' -a_srs EPSG:28992 delft.shp gem_2011_gn1.shp
18
+
19
+ > ogr2ogr -clipsrc delft.shp roadsdelft.shp roadsreprojected.shp
20
+
21
+ ### Convert Comma Separated Values (CSV)
22
+
23
+ > ogr2ogr -t_srs EPSG:28992 -f "CSV" locations_reprojected.csv locations.vrt -lco GEOMETRY=AS_XY
24
+
25
+ > ogr2ogr -f "ESRI Shapefile" -t_srs EPSG:28992 locations.shp locations.vrt
26
+
27
+ ### Batch Conversion
28
+
29
+ - ` landuse.zip `
30
+
31
+ > gdal_translate -of GTiff 01_State19900101.rst 01_State19900101.tif
32
+
33
+ ` rst2tif.bat `
34
+
35
+ ``` bat
36
+
37
+ for %%f in (*.rst) do (
38
+ echo %%~nf
39
+ gdal_translate -of GTiff %%f %%~nf.tif
40
+ )
41
+
42
+ ```
43
+
44
+ > rst2tif <ENTER >
45
+
You can’t perform that action at this time.
0 commit comments