Skip to content

Commit 29a4fda

Browse files
committed
part 01 added
1 parent ab7b312 commit 29a4fda

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+

0 commit comments

Comments
 (0)