Supported_Sensors.rst 6.7 KB
Newer Older
1
2
3
4
5
6
7
8
9
Supported file formats
======================

OTB relies on `GDAL <https://gdal.org/>`_ for reading and writing data
(either raster or vector images). This means that all formats
supported by GDAL are theoretically also supported by OTB. That being
said, there are some limitations.

Raster images
10
-------------
11

12
13
14
Reading a raster image
~~~~~~~~~~~~~~~~~~~~~~

15
16
17
18
19
20
21
22
GDAL provides a very large panel of drivers to access metadata in
image files. OTB stores the metadata in a special dictionary called
otbImageMetadata. There is a metadata framework that uses interfaces
(ImageMetadataInterface) to link data read by GDAL to the
otbImageMetadata. Thus, to access metadata for a specific sensor, the
corresponding interface is required. As this time, available
interfaces are:

23
24
25
26
27
28
29
30
31
+------------------------+-------------------------+--------------------------------------------------------------------+
| Sensor                 | Format                  | Notes                                                              |
+========================+=========================+====================================================================+
| CosmoSkyMed            | HDF5 / TIFF             | See HDF particularity below                                        |
+------------------------+-------------------------+--------------------------------------------------------------------+
| Formosat               | DIMAP / TIFF            | N/A                                                                |
+------------------------+-------------------------+--------------------------------------------------------------------+
| Ikonos                 | TIFF                    | N/A                                                                |
+------------------------+-------------------------+--------------------------------------------------------------------+
32
| Pleiades               | JPEG2000 / TIFF         | Don't use the DIMAP file, it causes a 0.5 pixel shift              |
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
+------------------------+-------------------------+--------------------------------------------------------------------+
| QuickBird              | TIFF                    | N/A                                                                |
+------------------------+-------------------------+--------------------------------------------------------------------+
| Radarsat 2             | TIFF                    | N/A                                                                |
+------------------------+-------------------------+--------------------------------------------------------------------+
| Sentinel 1             | TIFF                    | Use the tiff file, not the manifest                                |
+------------------------+-------------------------+--------------------------------------------------------------------+
| Spot 5                 | DIMAP / TIFF            | RPC not available                                                  |
+------------------------+-------------------------+--------------------------------------------------------------------+
| Spot 6                 | DIMAP / JPEG2000 / TIFF | N/A                                                                |
+------------------------+-------------------------+--------------------------------------------------------------------+
| TerraSarX              | COS                     | Use the cos file, not the main XML. MGD products are not supported |
+------------------------+-------------------------+--------------------------------------------------------------------+
| WorldView 2            | TIFF                    | N/A                                                                |
+------------------------+-------------------------+--------------------------------------------------------------------+
48
49
50
51
52
53
54
55
56

Sensors not in this list can still be used with OTB, but the metadata
won't be accessible.

Full products generally contain multiple files (image files, manifest,
metadata files, etc). For SAR products, OTB takes necessarily an image
file. For optical sensor, OTB can also take the manifest file as
input. In that case, OTB will consider all the bands of the product.

57
58
59
60
61
Writing a raster image
~~~~~~~~~~~~~~~~~~~~~~

OTB uses a correspondence table to link a specific file extension to a
GDAL driver. This means that formats not present in this table can't
Julien Osman's avatar
Julien Osman committed
62
be written, even if the driver exists in GDAL. The formats available in
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
OTB for writing a raster are:

- GTiff (.tif / .tiff)

- ENVI (.hdr)

- HFA (.img)

- NITF (.ntf)

- PNG (.png)

- JPEG (.jpg / .jpeg)

- PCIDSK (.pix)

- ISIS2 (.lbl / .pds)

- JP2OpenJPEG / JP2KAK / JP2ECW (.j2k / .jp2 / .jpx)

83
84
85
86
A particularity of HDF datasets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When reading a HDF dataset, one needs to select the right subdataset
87
88
89
90
using the :ref:`Extended Filename <extended-filename-sdataidx>`
``&sdataidx=<(int)idx>``.  For example, in some CosmoSkyMed products,
the first subDataset is a quicklook, and the actual product is the
second subdataset.
91
92


93
Vector data
94
-----------
95

Julien Osman's avatar
Julien Osman committed
96
OTB can read all vector formats supported by OGR. But the writing
97
process is a little tricky. OTB implements two ways of dealing with
Julien Osman's avatar
Julien Osman committed
98
writing vector data. The first one uses OGR::Datasource. The second
99
100
101
102
one uses otb::VectorData. Depending on which class is used by the
application, different formats are available. This is confusing, and
we plan on fixing this. For now, formats fully supported
(IE. supported by all applications) are:
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117

- ESRI Shapefile (.shp)

- MapInfo File (.tab)

- Geographical Markup Language (.gml)

- GPS Exchange Format (.gpx)

- SQLite (.sqlite)

- Keyhole Markup Language (.kml)

- GeoPackage (.gpkg)

Julien Osman's avatar
Julien Osman committed
118
119
Digital Elevation Model
-----------------------
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154

OTB also relies on GDAL to access DEM data. Therefore, any raster
format supported by GDAL can be used as DEM. Several DEM tiles can be
provided at the same time by providing a directory. All raster from
the input directory will be opened by GDAL.

It is the same for the geoid. 

A note on the egm96.grd file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In previous OTB versions (using Ossim) it was common to use the
egm96.grd file as geoid. This file cannot be opened by GDAL. However
it is still possible to use it by using the following egm96.grd.hdr
file::

  ENVI
  samples = 1441
  lines   = 721
  bands   = 1
  header offset = 24
  file type = ENVI Standard
  data type = 4
  interleave = bsq
  sensor type = Unknown
  byte order = 1
  wavelength units = Unknown
  map info = {Geographic Lat/Lon, 1, 1,-0.125, 90.125, 0.25, 0.25,WGS-84}
  coordinate system string = {GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]}
  band names = {
  Band 1}


With this file attached, GDAL will be able to read the egm96.grd file
as a ENVI dataset.