<font size=2 face="sans-serif">Got it! Lots of fun!</font>
<br><font size=2 face="sans-serif">Good links for python</font>
<br><a href="http://pcjericks.github.io/py-gdalogr-cookbook/vector_layers.html#get-wfs-layer-and-iterate-over-features"><font size=2 color=blue face="sans-serif">http://pcjericks.github.io/py-gdalogr-cookbook/vector_layers.html#get-wfs-layer-and-iterate-over-features</font></a>
<br>
<br><font size=2 face="sans-serif">Thousand thanks</font>
<br>
<p>
<p>
<br>
<br>
<br>
<table width=100% style="border-collapse:collapse;">
<tr valign=top height=8>
<td width=40% style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=1 face="sans-serif"><b>Even
Rouault <even.rouault@spatialys.com>@lists.osgeo.org</b> </font>
<br><font size=1 face="sans-serif">Envoyé par : gdal-dev-bounces@lists.osgeo.org</font>
<p><font size=1 face="sans-serif">2014-12-12 15:42</font>
<td width=59% style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;">
<table width=100% style="border-collapse:collapse;">
<tr valign=top height=21>
<td width=57 style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;">
<div align=right><font size=1 face="sans-serif">A</font></div>
<td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=1 face="sans-serif">gdal-dev@lists.osgeo.org</font>
<tr valign=top height=21>
<td width=57 style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;">
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=1 face="sans-serif">Steve.Toutant@inspq.qc.ca</font>
<tr valign=top height=21>
<td width=57 style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;">
<div align=right><font size=1 face="sans-serif">Objet</font></div>
<td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size=1 face="sans-serif">Re:
[gdal-dev] Parse GML without geometry</font></table>
<br>
<table width=393 style="border-collapse:collapse;">
<tr valign=top height=8>
<td width=57 style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;">
<td width=336 style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"></table>
<br></table>
<br>
<br>
<br>
<br>
<br><tt><font size=2>Le vendredi 12 décembre 2014 21:38:06, Steve.Toutant@inspq.qc.ca
a écrit :<br>
> thanks Kyle<br>
> <br>
> I ended up with<br>
> geom=osgeo.ogr.CreateGeometryFromGML(wfs_response)<br>
> Returns ERROR 1: Unrecognised geometry type <FeatureCollection><br>
> <br>
> If I understand well, I think my question now is<br>
> How do I parse the feature collection with ogr?<br>
<br>
With the WFS driver:<br>
<br>
ogrinfo "WFS:</font></tt><a href="http://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&REQUEST=GetFeature&version=1.1.0&Typename=continents&maxfeatures=10&propertyname=(NA2DESC)"><tt><font size=2>http://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&REQUEST=GetFeature&version=1.1.0&Typename=continents&maxfeatures=10&propertyname=(NA2DESC)</font></tt></a><tt><font size=2>
" -ro -al<br>
<br>
You can read the OGR API tutorial to see how to use a OGR datasource, layer,
feature<br>
<br>
Regarding gemetry or not geometry, it won't matter. Actually as generated
by mapserver, there's a geometry column declared, but not filled. Won't
be an issue:<br>
<br>
$ wget "</font></tt><a href="http://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&REQUEST=DescribeFeatureType&VERSION=1.1.0&TYPENAME=continents&"><tt><font size=2>http://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&REQUEST=DescribeFeatureType&VERSION=1.1.0&TYPENAME=continents&</font></tt></a><tt><font size=2>"
-O -<br>
<br>
<schema<br>
   targetNamespace="</font></tt><a href=http://mapserver.gis.umn.edu/mapserver><tt><font size=2>http://mapserver.gis.umn.edu/mapserver</font></tt></a><tt><font size=2>"
<br>
   xmlns:ms="</font></tt><a href=http://mapserver.gis.umn.edu/mapserver><tt><font size=2>http://mapserver.gis.umn.edu/mapserver</font></tt></a><tt><font size=2>"
<br>
   xmlns:ogc="</font></tt><a href=http://www.opengis.net/ogc><tt><font size=2>http://www.opengis.net/ogc</font></tt></a><tt><font size=2>"<br>
   xmlns:xsd="</font></tt><a href=http://www.w3.org/2001/XMLSchema><tt><font size=2>http://www.w3.org/2001/XMLSchema</font></tt></a><tt><font size=2>"<br>
   xmlns="</font></tt><a href=http://www.w3.org/2001/XMLSchema><tt><font size=2>http://www.w3.org/2001/XMLSchema</font></tt></a><tt><font size=2>"<br>
   xmlns:gml="</font></tt><a href=http://www.opengis.net/gml><tt><font size=2>http://www.opengis.net/gml</font></tt></a><tt><font size=2>"<br>
   elementFormDefault="qualified" version="0.1"
><br>
<br>
  <import namespace="</font></tt><a href=http://www.opengis.net/gml><tt><font size=2>http://www.opengis.net/gml</font></tt></a><tt><font size=2>"<br>
          schemaLocation="</font></tt><a href=http://schemas.opengis.net/gml/3.1.1/base/gml.xsd><tt><font size=2>http://schemas.opengis.net/gml/3.1.1/base/gml.xsd</font></tt></a><tt><font size=2>"
/><br>
<br>
  <element name="continents" <br>
           type="ms:continentsType"
<br>
           substitutionGroup="gml:_Feature"
/><br>
<br>
  <complexType name="continentsType"><br>
    <complexContent><br>
      <extension base="gml:AbstractFeatureType"><br>
        <sequence><br>
          <element name="msGeometry"
type="gml:GeometryPropertyType" minOccurs="0" maxOccurs="1"/><br>
          <element name="NA2DESC"
type="string"/><br>
          <element name="NA3DESC"
type="string"/><br>
        </sequence><br>
      </extension><br>
    </complexContent><br>
  </complexType><br>
<br>
</schema><br>
<br>
<br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> Kyle Shannon <kyle@pobox.com><br>
> 2014-12-12 14:47<br>
> <br>
> A<br>
> Steve.Toutant@inspq.qc.ca<br>
> cc<br>
> GDAL Developers <gdal-dev@lists.osgeo.org><br>
> Objet<br>
> Re: [gdal-dev] Parse GML without geometry<br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> Steve,<br>
> <br>
> On Fri, Dec 12, 2014 at 12:35 PM,  <Steve.Toutant@inspq.qc.ca>
wrote:<br>
> > Hi,<br>
> > I need to parse the GML returned by this query, to make a list
of unique<br>
> > value of NA2DESC tag using python<br>
> <br>
> </font></tt><a href="http://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&REQUEST=GetFeature&versio"><tt><font size=2>http://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&REQUEST=GetFeature&versio</font></tt></a><tt><font size=2><br>
> n=1.1.0&Typename=continents&maxfeatures=10&propertyname=(NA2DESC)<br>
> <br>
> > I could not make it with a XML parser yet. I consider using ogr
API but<br>
> <br>
> can<br>
> <br>
> > I use it even if there is no geometry?<br>
> <br>
> This one has a geometry, or so ogr thinks so:<br>
> <br>
> kyle@kyle-workstation:~$ ogrinfo -so -al -ro<br>
> "/vsicurl_streaming/http://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&REQUE<br>
> ST=GetFeature&version=1.1.0&Typename=continents&maxfeatures=10&propertyname<br>
> =(NA2DESC)" INFO: Open of<br>
> `/vsicurl_streaming/http://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&REQUE<br>
> ST=GetFeature&version=1.1.0&Typename=continents&maxfeatures=10&propertyname<br>
> =(NA2DESC)' using driver `GML' successful.<br>
> <br>
> Layer name: continents<br>
> Geometry: Unknown (any)<br>
> Feature Count: 10<br>
> Extent: (-90.000000, -180.000000) - (83.627419, 180.000000)<br>
> Layer SRS WKT:<br>
> GEOGCS["WGS 84",<br>
>     DATUM["WGS_1984",<br>
>         SPHEROID["WGS 84",6378137,298.257223563,<br>
>             AUTHORITY["EPSG","7030"]],<br>
>         AUTHORITY["EPSG","6326"]],<br>
>     PRIMEM["Greenwich",0,<br>
>         AUTHORITY["EPSG","8901"]],<br>
>     UNIT["degree",0.0174532925199433,<br>
>         AUTHORITY["EPSG","9122"]],<br>
>     AUTHORITY["EPSG","4326"]]<br>
> Geometry Column = msGeometry<br>
> gml_id: String (0.0)<br>
> NA2DESC: String (0.0)<br>
> NA3DESC: String (0.0)<br>
> <br>
> > If ogr api is a good option, any link to examples or tutorial
would be<br>
> > appreciated since I never used the API.<br>
> <br>
> API tutorials:<br>
> <br>
> For gdal 2.x:<br>
> <br>
> </font></tt><a href=http://gdal.org/ogr_apitut.html><tt><font size=2>http://gdal.org/ogr_apitut.html</font></tt></a><tt><font size=2><br>
> <br>
> For gdal 1.x (the vector side is ogr):<br>
> <br>
> </font></tt><a href=http://gdal.org/1.11/ogr/ogr_apitut.html><tt><font size=2>http://gdal.org/1.11/ogr/ogr_apitut.html</font></tt></a><tt><font size=2><br>
> <br>
> > Thanks!<br>
> > <br>
> > <br>
> > _______________________________________________<br>
> > gdal-dev mailing list<br>
> > gdal-dev@lists.osgeo.org<br>
> > </font></tt><a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev"><tt><font size=2>http://lists.osgeo.org/mailman/listinfo/gdal-dev</font></tt></a><tt><font size=2><br>
> <br>
> kss<br>
<br>
-- <br>
Spatialys - Geospatial professional services<br>
</font></tt><a href=http://www.spatialys.com/><tt><font size=2>http://www.spatialys.com</font></tt></a><tt><font size=2><br>
_______________________________________________<br>
gdal-dev mailing list<br>
gdal-dev@lists.osgeo.org<br>
</font></tt><a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev"><tt><font size=2>http://lists.osgeo.org/mailman/listinfo/gdal-dev</font></tt></a>
<br>
<br>
<br>