Opened 11 years ago
Closed 9 years ago
#5018 closed enhancement (fixed)
DIMAP driver enhancements
Reported by: | mats | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.11.2 |
Component: | GDAL_Raster | Version: | 1.9.2 |
Severity: | normal | Keywords: | DIMAP |
Cc: |
Description
Attached patch adds some enhancements to the DIMAP driver:
- Solves the issue when opening the DIMAP product metadata files, instead of the DIMAP delivery index file, as reported in ticket #4826 (DIMAP driver fails to open Pleiades HR datasets).
When opening the DIMAP delivery index file, only metadata from the first dataset in the the delivery was read, and opening the DIMAP product metadata files failed (as reported in defect #4826).
- Read geotransform from underlying raster if not available in metadata, just like it's done with spatial reference.
- Up to now it has been possible to access various DIMAP metadata specified in hardcoded translation tables with the DIMAPDataset::GetMetadata method.
The patch adds the ability to access additional metadata by using metadata translation tables specified in csv files. The files should be placed in the GDAL data directory (specified by the GDAL_DATA configuration option).
Example files with metadata translation tables for the DIMAP product metadata file and the DIMAP strip metadata file are attached:
dimap_metadata_translation_dim.csv and dimap_metadata_translation_strip.csv.
Attachments (4)
Change History (12)
by , 11 years ago
Attachment: | dimap_metadata_translation_dim.csv added |
---|
by , 11 years ago
Attachment: | dimap_metadata_translation_strip.csv added |
---|
follow-up: 2 comment:1 by , 11 years ago
by , 11 years ago
Attachment: | dimapdataset.cpp.patch added |
---|
comment:2 by , 11 years ago
Sorry about the problems with the previous path. I have prepared a new patch against trunk to replace the first one. It must have been the tabs and indentation adjustments that messed up the previous path. Since it's my first contribution I thought I'd be good and replaced all tabs with blanks as suggested in the developer guidelines (RFC8).
Regarding the CSV files, after we discovered that some of the DIMAP metadata we wanted (sun azimuth etc) wasn't returned by the driver's GetMetadata method, I noticed that just the metadata defined in the hardcoded metadata translation tables in the source code was returned.
I thought this solution was a (dynamic) way for the users to specify what metadata they wanted to access from the DIMAP dim and strip files. An alternative would have been to use the parameter "xml:dimap" to request the xml code, parse it, and extract the desired values.
My solution was just to make it possible for the users to manipulate which information that would be accessible from the DIMAP xml files, since the metadata translation mechanism was already there.
Regarding the user docs, what docs should be patched?
comment:3 by , 11 years ago
There is quite brief DIMAP documentation in gdal/frmts/frmts_various.html that should be extended with any notes about configuration files.
I'm a bit dubious about the .csv file approach. Is it that the items available varies in unpredictable ways for different products?
I do like the idea of exposing the full xml in a special subdomain though ideally users shouldn't need to dig into that in common cases.
comment:4 by , 11 years ago
Still a bit dubious about the CSV file approach? We have an application that needs certain metadata from satellite imagery from different sources. For example sun azimuth. When using the GDAL DIMAP driver we saw no easy way to aquire that information, the only available alternative seemed to be to parse the whole dim-file XML. But there were certain accessible metadata, not the one we needed though. So, what metadata was returned? The one specified in some hardcoded translation tables within the DIMAP driver. In our first approach we just expanded the tables with the items we needed and recompiled. Worked just as expected, we got what we wanted. But if our customers demanded other items in coming releases? That's why we put the metadata translation tables in CSV files. To meet future demands in new releases of our software. We left the original metadata translation tables in the driver though. So, as I tried to explain in one of my previous comments, the CSV file approach is a way to determine what metadata should be available to us when building our application whithout being forced to rebuild the GDAL lib as well.
by , 11 years ago
Attachment: | frmt_various.html.patch added |
---|
comment:5 by , 11 years ago
Patched the user docs as requested with information about the CSV configuration files.
comment:6 by , 10 years ago
comment:8 by , 9 years ago
Milestone: | → 1.11.2 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
I'm getting lots of failures trying to apply this in trunk:
Are you sure the patch was prepared against trunk? It also seems to have a lot of white space changes that make it hard to evaluate visually.
The provided CSV files should presumably live in gdal/data, right? Could you elaborate on their purpose? It seems like an override mechanism for people to fix up particular metadata formulations but without more detail it will be of limited value. Ideally the user docs should also be patched.