@@ -56,7 +56,8 @@ directory.
56
56
You will then find a NaturalEarth Raster file and a .tfw World-file at:
57
57
::
58
58
59
- ls /home/user/gdal_natural_earth/HYP_50M_SR_W.*
59
+ cd /home/user/gdal_natural_earth
60
+ ls HYP_50M_SR_W.*
60
61
61
62
62
63
.. tip :: Open the file with a Desktop GIS like QGIS, and have a look.
@@ -68,28 +69,35 @@ Get information about the raster data with gdalinfo
68
69
gdalinfo HYP_50M_SR_W.tif
69
70
Driver: GTiff/GeoTIFF
70
71
Files: HYP_50M_SR_W.tif
71
- HYP_50M_SR_W.tfw
72
72
Size is 10800, 5400
73
- Coordinate System is `'
73
+ Coordinate System is:
74
+ GEOGCRS["WGS 84",
75
+ ENSEMBLE["World Geodetic System 1984 ensemble",
76
+ ...
74
77
Origin = (-179.999999999999972,90.000000000000000)
75
78
Pixel Size = (0.033333333333330,-0.033333333333330)
76
79
Metadata:
77
- TIFFTAG_SOFTWARE=Adobe Photoshop CS3 Macintosh
78
- TIFFTAG_DATETIME=2009:09:19 10:13:17
80
+ TIFFTAG_SOFTWARE=Adobe Photoshop CS5 Macintosh
81
+ TIFFTAG_DATETIME=2012:07:16 09:16:14
79
82
TIFFTAG_XRESOLUTION=342.85699
80
83
TIFFTAG_YRESOLUTION=342.85699
81
84
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
85
+ AREA_OR_POINT=Area
82
86
Image Structure Metadata:
87
+ SOURCE_COLOR_SPACE=YCbCr
88
+ COMPRESSION=YCbCr JPEG
83
89
INTERLEAVE=PIXEL
90
+ JPEG_QUALITY=90
91
+ JPEGTABLESMODE=3
84
92
Corner Coordinates:
85
- Upper Left (-180.0000000, 90.0000000)
86
- Lower Left (-180.0000000, -90.0000000)
87
- Upper Right ( 180.0000000, 90.0000000)
88
- Lower Right ( 180.0000000, -90.0000000)
89
- Center ( -0.0000000, 0.0000000)
90
- Band 1 Block=10800x1 Type=Byte, ColorInterp=Red
91
- Band 2 Block=10800x1 Type=Byte, ColorInterp=Green
92
- Band 3 Block=10800x1 Type=Byte, ColorInterp=Blue
93
+ Upper Left (-180.0000000, 90.0000000) (180d 0' 0.00"W, 90d 0' 0.00"N)
94
+ Lower Left (-180.0000000, -90.0000000) (180d 0' 0.00"W, 90d 0' 0.00"S)
95
+ Upper Right ( 180.0000000, 90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"N)
96
+ Lower Right ( 180.0000000, -90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"S)
97
+ Center ( -0.0000000, 0.0000000) ( 0d 0' 0.00"W, 0d 0' 0.00"N)
98
+ Band 1 Block=256x256 Type=Byte, ColorInterp=Red
99
+ Band 2 Block=256x256 Type=Byte, ColorInterp=Green
100
+ Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
93
101
94
102
Note:
95
103
* Driver is "GTiff/GeoTIFF"
@@ -103,19 +111,21 @@ Note:
103
111
Simple format translation
104
112
=========================
105
113
106
- First get to know your drivers. The `--formats ` commandline switch of
114
+ First get to know your drivers. The `--formats ` command line switch of
107
115
gdal_translate can be used to see a list of available format drivers.
108
116
109
- Each format reports if it is
110
- * read only (ro),
111
- * read/write (rw) or
112
- * read/write/update (rw+).
117
+ Each format reports if it supports the following features:
118
+ * read only (ro)
119
+ * read/write (rw)
120
+ * read/write/update (rw+)
121
+ * supports virtual file systems (v)
122
+ * supports subdatasets (s)
113
123
114
124
::
115
125
116
126
gdal_translate --formats
117
127
118
- The `--format ` commandline switch can be used to query details about a
128
+ The `--format ` command line switch can be used to query details about a
119
129
particular driver, including creation options, and permitted data types.
120
130
121
131
::
@@ -193,31 +203,29 @@ will learn more about ogrinfo later in this tutorial)
193
203
using driver `ESRI Shapefile' successful.
194
204
195
205
Layer name: index_natural_earth
206
+ Metadata:
207
+ DBF_DATE_LAST_UPDATE=2025-05-13
196
208
Geometry: Polygon
197
209
Feature Count: 2
198
210
Extent: (-180.000000, -90.000000) - (180.000000, 90.000000)
199
- Layer SRS WKT: (unknown)
200
- location: String (255.0)
211
+ Layer SRS WKT:
212
+ GEOGCRS["WGS 84",
213
+ ...
214
+ location: String (254.0)
201
215
OGRFeature(index_natural_earth):0
202
- location (String) = east .tif
203
- POLYGON ((-0.00000000001796 90.0,179.999999999964047 90.0,179.999999999964047 -89.999999999982009,-0.00000000001796 -89.999999999982009,-0.00000000001796 90.0))
216
+ location (String) = west .tif
217
+ POLYGON ((-180 90.0,-0.000000000017963 90.0,-0.000000000017963 -89.999999999982,-180 -89.999999999982,-180 90.0))
204
218
205
219
OGRFeature(index_natural_earth):1
206
- location (String) = west .tif
207
- POLYGON ((-179.999999999999972 90.0,-0.00000000001796 90.0,-0.00000000001796 -89.999999999982009,-179.999999999999972 -89.999999999982009,-179.999999999999972 90.0))
220
+ location (String) = east .tif
221
+ POLYGON ((-0.000000000017963 90.0,179.999999999964 90.0,179.999999999964 -89.999999999982,-0.000000000017963 -89.999999999982,-0.000000000017963 90.0))
208
222
209
223
210
224
Reprojecting
211
225
============
212
226
213
227
For this process we assume that HYP_50M_SR_W.tif has been properly
214
- created with bounds. As we saw before with gdainfo no coordinate system
215
- was set. So we assign WGS84 as coordinate system to the image in the
216
- first step.
217
-
218
- ::
219
-
220
- gdal_translate -a_srs WGS84 HYP_50M_SR_W.tif HYP_50M_SR_W_4326.tif
228
+ created with bounds.
221
229
222
230
The gdalwarp command can be used to reproject images. Here we reproject
223
231
the WGS84 geographic image to the Mercator projection:
@@ -285,18 +293,19 @@ Get information about the vector data with ogrinfo
285
293
ogrinfo -ro /home/user/gdal_natural_earth
286
294
INFO: Open of `/home/user/gdal_natural_earth'
287
295
using driver `ESRI Shapefile' successful.
288
- 1: ne_10m_populated_places (3D Point)
289
- 2: ne_10m_geography_regions_polys (3D Polygon)
290
- 3: ne_10m_admin_1_states_provinces_shp (3D Polygon)
291
- 4: ne_10m_urban_areas (3D Polygon)
292
- 5: ne_10m_geography_marine_polys (3D Polygon)
293
- 6: ne_10m_land (3D Polygon)
294
- 7: ne_10m_geography_regions_elevation_points (3D Point)
295
- 8: ne_10m_admin_0_countries (3D Polygon)
296
- 9: ne_10m_rivers_lake_centerlines (3D Line String)
297
- 10: ne_10m_lakes (3D Polygon)
298
- 11: ne_10m_geography_regions_points (3D Point)
299
- 12: ne_10m_ocean (3D Polygon)
296
+ 1: ne_10m_geography_regions_polys (Polygon)
297
+ 2: ne_10m_populated_places (Point)
298
+ 3: ne_10m_urban_areas (Polygon)
299
+ 4: ne_10m_geography_marine_polys (Polygon)
300
+ 5: ne_10m_admin_1_states_provinces_shp (Polygon)
301
+ 6: ne_10m_admin_0_countries (Polygon)
302
+ 7: ne_10m_ocean (Polygon)
303
+ 8: ne_10m_rivers_lake_centerlines (Line String)
304
+ 9: ne_10m_land (Polygon)
305
+ 10: index_natural_earth (Polygon)
306
+ 11: ne_10m_geography_regions_elevation_points (Point)
307
+ 12: ne_10m_geography_regions_points (Point)
308
+ 13: ne_10m_lakes (Polygon)
300
309
301
310
302
311
Get a summary about your data with ogrinfo together with `-so `.
@@ -308,15 +317,15 @@ Get a summary about your data with ogrinfo together with `-so`.
308
317
using driver `ESRI Shapefile' successful.
309
318
310
319
Layer name: ne_10m_admin_0_countries
311
- Geometry: 3D Polygon
320
+ Metadata:
321
+ DBF_DATE_LAST_UPDATE=2012-11-05
322
+ Geometry: Polygon
312
323
Feature Count: 254
313
324
Extent: (-180.000000, -90.000000) - (180.000000, 83.634101)
314
325
Layer SRS WKT:
315
- GEOGCS["GCS_WGS_1984",
316
- DATUM["WGS_1984",
317
- SPHEROID["WGS_84",6378137.0,298.257223563]],
318
- PRIMEM["Greenwich",0.0],
319
- UNIT["Degree",0.0174532925199433]]
326
+ GEOGCRS["WGS 84",
327
+ DATUM["World Geodetic System 1984",
328
+ ...
320
329
scalerank: Integer (4.0)
321
330
featurecla: String (30.0)
322
331
labelrank: Real (16.6)
0 commit comments