[gdal-dev] GFS with condition on the second last element

Even Rouault even.rouault at spatialys.com
Wed Jun 24 09:11:15 PDT 2020


On mercredi 24 juin 2020 17:14:50 CEST Raymond Nijssen wrote:
> Hi list,
> 
> I'm trying to read a complex gml file that includes values that need to
> be selected on an xml attribute. This is possible to do with a condition
> in the gfs file, but the example only covers having the attribute on the
> last element in the elementPath:
> 
> https://gdal.org/drivers/vector/gml.html#using-conditions-on-xml-attributes
> 
> 
> But mine is on the 2nd last element, like this:
> 
> ```
>          <imaer:result>
>              <imaer:Result resultType="DEPOSITION" substance="NH3">
>                  <imaer:value>0.01909</imaer:value>
>              </imaer:Result>
>          </imaer:result>
>          <imaer:result>
>              <imaer:Result resultType="DEPOSITION" substance="NOX">
>                  <imaer:value>0.001341</imaer:value>
>              </imaer:Result>
>          </imaer:result>
> ```
> 
> So I'd like to do something like this in my gfs:
> 
> ```
>      <PropertyDefn>
>        <Name>nh3</Name>
>        <ElementPath>result|Result|value</ElementPath>
>        <Condition>result|Result at substance='NH3'</Condition>
>        <Type>Real</Type>
>      </PropertyDefn>
> ```
> 
> to only catch the value where substance = NH3. I've been trying many
> options but no success yet.
> 
> 
> Is this even possible?

No, this isn't possible. As documented, Condition capabilities are limited to filtering on an 
attribute of the same element whose value you want to retrieve.

You would probably have more capabilities by using the GMLAS driver, and filtering on its 
output.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200624/f4ae89ad/attachment.html>


More information about the gdal-dev mailing list