Hi Jukka and Even<div><br></div><div>I also thought about this, i.e. to delay the determination of the geometry type check to the first occurrence, in case when the abstract <span style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">gml:</span><span style="font-size:13px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">GeometryPropertyType </span>has been announced in DescribeFeature. </div>
<div><br></div><div><span style="font-family:Calibri,sans-serif;font-size:11pt">I know that QGIS, ArcGIS Desktop and Gaia clients can read the WFS mentioned below. And </span>I'm almost sure they don't read the whole data stream in order to determine that's a polygon type. It's only OGR in my test suite which can't cope with this an needs a manual configuration ("<span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">-nlt POLYGON") which is no option for me since it's inside an automated script.</span></div>
<div><br></div><div>On the other hand and from a higher level perspective something it's clear to me: The original feature set (here e.g. svo_zonen) is of type gml:Polygon. If the WFS doesn't expose and explain this as gml:Polygon to others, there's a problem with this server.</div>
<div><br></div><div>Yours, Stefan</div><div> <br><br><div class="gmail_quote">2013/4/22 Jukka Rahkonen <span dir="ltr"><<a href="mailto:jukka.rahkonen@mmmtike.fi" target="_blank">jukka.rahkonen@mmmtike.fi</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">Even Rouault <even.rouault <at> <a href="http://mines-paris.org" target="_blank">mines-paris.org</a>> writes:<br>

<br>
<br>
><br>
> Yes, when examining the<br>
><br>
><br>
"<a href="http://maps.zh.ch/wfs/FnsNSWFS?TYPENAME=svo_zonen&SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType" target="_blank">http://maps.zh.ch/wfs/FnsNSWFS?TYPENAME=svo_zonen&SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType</a>"<br>

<br>
> you can see :<br>
><br>
>           <element name="msGeometry" type="gml:GeometryPropertyType"<br>
> minOccurs="0" maxOccurs="1"/><br>
><br>
> So the geometry type is undefined. OGR then reports a unknown geometry type.<br>
> There could be a mix of geometries in such a layer.<br>
<br>
</div>Just for information, it is not uncommon that WFS servers advertise a<br>
general geometry type "gml:GeometryPropertyType" even the layer contains<br>
only one geometry type and therefore WFS clients should be aware of this.<br>
General geometry type comes more or less automatically when setting up a WFS<br>
service on top of Oracle because by default Oracle can hold any geometries<br>
in the geometry column. It is possible to set a geometry type constraint<br>
when creating a spatial index but it is not important for Oracle and<br>
therefore the constraint is often missing. Even if it exists it is a bit<br>
complicated to query. For example Geoserver knows how to do this check but<br>
GDAL OCI driver does not. If someone gets interested in improving the OCI<br>
driver, here is a basic part of the query.<br>
<br>
select idxmeta.sdo_layer_gtype from all_sdo_index_info idxinfo,<br>
all_sdo_index_metadata idxmeta<br>
where idxinfo.index_name=idxmeta.sdo_index_name<br>
and idxinfo.table_name='TABLE_NAME'<br>
<br>
If WFS client cannot handle mixed geometry types on one layer then it could<br>
perhaps take the first not empty geometry from the WFS response and initiate<br>
the layer to use that geometry type. To be on a safe side it might create a<br>
multipolygon or multilinestring layer even if the first feature is simple.<br>
Another geometry type appearing later in the data will lead to an error but<br>
it cannot be avoided anyway if client cannot handle mixed layers.<br>
<br>
-Jukka Rahkonen-<br>
<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div><br></div>