[gdal-dev] Using VRTDataSource/UnionLayer for S57 thematic layers

Andre Vautour andre.vautour at caris.com
Fri Oct 18 07:29:10 PDT 2013


Hi all,

I recently updated to GDAL 1.10.1 and I am looking into possibly using 
the VRT data source to have a data source with S57 thematic layers (e.g. 
skin of the earth, obstructions, etc.) instead of one layer per object 
acronym (feature). I have a collection of ENC files, so my current .vrt 
file looks something like:

<OGRVRTDataSource>
   <OGRVRTUnionLayer name="SkinOfTheEarth">
     <OGRVRTLayer name="SOMEENC_DEPARE">
       <SrcDataSource relativeToVRT="1" 
shared="1">someEnc.000</SrcDataSource>
       <SrcLayer>DEPARE</SrcLayer>
     </OGRVRTLayer>
     <OGRVRTLayer name="SOMEENC_LNDARE">
       <SrcDataSource relativeToVRT="1" 
shared="1">someEnc.000</SrcDataSource>
       <SrcLayer>LNDARE</SrcLayer>
     </OGRVRTLayer>
     <OGRVRTLayer name="SOMEOTHERENC_DEPARE">
       <SrcDataSource relativeToVRT="1" 
shared="1">someOtherEnc.000</SrcDataSource>
       <SrcLayer>DEPARE</SrcLayer>
     </OGRVRTLayer>
     <OGRVRTLayer name="SOMEOTHERENC_LNDARE">
       <SrcDataSource relativeToVRT="1" 
shared="1">someOtherEnc.000</SrcDataSource>
       <SrcLayer>LNDARE</SrcLayer>
     </OGRVRTLayer>
     <!-- ... -->
   </OGRVRTUnionLayer>
   <OGRVRTUnionLayer name="Obstructions">
     <OGRVRTLayer name="SOMEENC_WRECKS">
       <SrcDataSource relativeToVRT="1" 
shared="1">someEnc.000</SrcDataSource>
       <SrcLayer>WRECKS</SrcLayer>
     </OGRVRTLayer>
     <!-- ... -->
   </OGRVRTUnionLayer>
   <!-- ... -->
</OGRVRTDataSource>

Each thematic layer has several object acronyms. Each thematic layer has 
several S57 sources from which to retrieve those acronyms (layers).

Having to specify each individual contributing layer with its source 
separately, while very flexible, is fairly verbose and error-prone in my 
particular case. Is there a way to specify wildcards/rules for the 
sources/layers to load? If not, has such an approach been considered?

Also, is there a way to create a union layer without going through the 
VRT file format? That is, through the OGR API, is there a way for a 
client application to union layers that it already opened?

Thanks,
André




More information about the gdal-dev mailing list