[gdal-dev] support for Czech Exchange Format for Land Consolidation

Even Rouault even.rouault at spatialys.com
Thu Feb 4 01:42:48 PST 2016


Le jeudi 04 février 2016 10:30:55, Martin Landa a écrit :
> Hi,
> 
> 2016-02-04 0:00 GMT+01:00 Martin Landa <landa.martin at gmail.com>:
> >> Have a look at the "Getting XML attributes as OGR fields" section of
> >> http://gdal.org/drv_gml.html
> > 
> > oh, thanks, I overlooked this part. Ma
> 
> after various experiments I still must miss something. The input data:
> 
>   <ucastnici>
>     <uca id="0" />
>     <uca id="1" />
>  </ucastnici>
> 
> GFS:
> 
> <GMLFeatureClassList>
>   <!-- ucastnici -->
>   <GMLFeatureClass>
>     <Name>ucastnici</Name>
>     <ElementPath>ucastnici|uca</ElementPath>
>     <GeometryType>100</GeometryType>
>     <PropertyDefn>
>       <Name>id</Name>
>       <ElementPath>@id</ElementPath>
>       <Type>Integer</Type>
>     </PropertyDefn>
>   </GMLFeatureClass>
> </GMLFeatureClassList>
> 
> I tried:
> 
>       <ElementPath>uca at id</ElementPath>
> 
> But the attribute is still null.
> 
> When I try
> 
>     <ElementPath>ucastnici|uca</ElementPath>
> ...
>       <ElementPath>uca at id</ElementPath>

Ah, you want to get an attribute of the root element of the feature ? Hum, 
from a quick test with 

<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
     xmlns:ogr="http://ogr.maptools.org/"
     xmlns:gml="http://www.opengis.net/gml">
  <gml:featureMember>
    <ogr:poly fid="poly.0" foo="bar">
      <baz baw="yeah"/>
    </ogr:poly>
  </gml:featureMember>
</ogr:FeatureCollection>

and

<GMLFeatureClassList>
  <GMLFeatureClass>
    <Name>poly</Name>
    <ElementPath>poly</ElementPath>
    <PropertyDefn>
      <Name>foo</Name>
      <ElementPath>@foo</ElementPath>
      <Type>String</Type>
    </PropertyDefn>
    <PropertyDefn>
      <Name>baw</Name>
      <ElementPath>baz at baw</ElementPath>
      <Type>String</Type>
    </PropertyDefn>
  </GMLFeatureClass>
</GMLFeatureClassList>

it looks indeed that the @xxxx syntax isn't supported on the root node. It 
could likely be implemented


> 
> then I am still getting 0 features.
> 
> Thanks, Martin

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list