<div dir="ltr">Hi Even,<div><br></div><div>Thank you, that could indeed solve the problem.</div><div><br></div><div>Best regards,</div><div><br></div><div>Tamas</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-10-20 0:10 GMT+02:00 Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On jeudi 19 octobre 2017 23:56:29 CEST Tamas Szekeres wrote:<br>
> It looks like DOWNLOAD_SCHEMA=NO would do the trick, but if I use this in a<br>
> VRT file this way it crashes GDAL.<br>
<br>
</span>Just fixed the crash (related to the HTTP driver and GDAL_OF_SHARED open flag)<br>
<br>
You can also prefix the URL with /vsicurl_streaming/ to avoid full ingestion<br>
into memory<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> <OGRVRTDataSource><br>
> <OGRVRTLayer name="OKCounties"><br>
> <SrcDataSource><br>
> <a href="http://cstest.coordinatesolutions.com/geoserver/wfs?VERSION=1.1.0&REQUES" rel="noreferrer" target="_blank">http://cstest.<wbr>coordinatesolutions.com/<wbr>geoserver/wfs?VERSION=1.1.0&<wbr>amp;REQUES</a><br>
> T=GetFeature&TYPENAME=ogi:<wbr>okcounties&SRSNAME=EPSG:<wbr>900913<br>
> </SrcDataSource><br>
> <OpenOptions><br>
> <OOI key="DOWNLOAD_SCHEMA">NO</OOI><br>
> </OpenOptions><br>
> <LayerSRS>EPSG:900913</<wbr>LayerSRS><br>
> <SrcSQL>SELECT *,<br>
> 'BRUSH(fc:#00000000);PEN(c:#<wbr>008000,w:3px);LABEL(f:"Arial",<wbr>c:#008000,s:14px,t<br>
> :{name})' as OGR_STYLE from "okcounties"</SrcSQL><br>
> </OGRVRTLayer><br>
> </OGRVRTDataSource><br>
><br>
> 2017-10-19 23:18 GMT+02:00 Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>>:<br>
> > On jeudi 19 octobre 2017 22:55:50 CEST Tamas Szekeres wrote:<br>
> > > Hi all,<br>
> > ><br>
> > > It looks like whenever we have a dataset (shapefile,db table,etc...)<br>
> ><br>
> > which<br>
> ><br>
> > > has a<br>
> > > column with such names like "description", "name", "location" GeoServer<br>
> > > maps it to the elements in the gml namespace (in a 1.1 request),<br>
> > > therefore DescribeFeatureType doesn't contain these attributes.<br>
> > ><br>
> > > For example this response doesn't include the name attribute<br>
> > ><br>
> > > <a href="http://cstest.coordinatesolutions.com/geoserver/wfs?VERSION=1.1.0&" rel="noreferrer" target="_blank">http://cstest.<wbr>coordinatesolutions.com/<wbr>geoserver/wfs?VERSION=1.1.0&</a><br>
> ><br>
> > SERVICE=WF<br>
> ><br>
> > > S&REQUEST=DescribeFeatureType&<wbr>TYPENAME=ogi:okcounties<br>
> > ><br>
> > > However that attribute is returned in the GetFeature request in the<br>
> > > gml:name section, like:<br>
> > ><br>
> > > <a href="http://cstest.coordinatesolutions.com/geoserver/wfs?VERSION=1.1.0&" rel="noreferrer" target="_blank">http://cstest.<wbr>coordinatesolutions.com/<wbr>geoserver/wfs?VERSION=1.1.0&</a><br>
> ><br>
> > REQUEST=Ge<br>
> ><br>
> > > tFeature&TYPENAME=ogi:<wbr>okcounties<br>
> > ><br>
> > > But as the result of this behaviour the WFS driver doesn't include this<br>
> > > item in the layer definition. Is that possible to retrieve these<br>
> ><br>
> > attributes<br>
> ><br>
> > > from the WFS driver as OGR fields for example to use them in SQL<br>
> > > expressions?<br>
> ><br>
> > Hi Tamas,<br>
> ><br>
> > If your need is to filter on the server, then you'll need to compose the<br>
> > full<br>
> > URL at hand.<br>
> > If you want to post-filter, you can downloader the GetFeature request and<br>
> > open<br>
> > the GML file with the DOWNLOAD_SCHEMA=NO open option (or<br>
> > GML_DOWNLOAD_WFS_SCHEMA=NO configuration option)<br>
> > This will prevent the GML driver from trying to use the schema, and then<br>
> > it<br>
> > will discover the gml:name element.<br>
> ><br>
> > OGRFeature(okcounties):155<br>
> ><br>
> > gml_id (String) = okcounties.155<br>
> > name (String) = BEAVER<br>
> > state (Integer) = 40<br>
> > county (Integer) = 7<br>
> > stateplane (String) = N<br>
> > MULTIPOLYGON (((-100.945566 ....)))<br>
> ><br>
> > The XSD parser used by the WFS and GML drivers could also possibly be<br>
> > modified<br>
> > to hard-code the definition of those few GML fields (although they might<br>
> > depend on the GML version).<br>
> ><br>
> ><br>
> > Otherwise you can also use the GMLAS driver, but the result will be a bit<br>
> > inconvenient to use as it will create a dedicated layer for the name<br>
> > attribute<br>
> > (as gml:name can be repeated):<br>
> ><br>
> > $ ogrinfo GMLAS:out.xml<br>
> > INFO: Open of `GMLAS:out.xml'<br>
> ><br>
> > using driver `GMLAS' successful.<br>
> ><br>
> > 1: okcounties (Multi Surface)<br>
> > 2: okcounties_metadataproperty (None)<br>
> > 3: okcounties_name (None)<br>
> > 4: location (None)<br>
> ><br>
> > OGRFeature(okcounties):1<br>
> ><br>
> > ogr_pkid (String) = 213FC01A8AA5FA1E1ADC65B21904DA<wbr>34_okcounties_1<br>
> > id (String) = okcounties.155<br>
> > state (Integer64) = 40<br>
> > county (Integer64) = 7<br>
> > stateplane (String) = N<br>
> > MULTIPOLYGON (((-100.945566....)))<br>
> ><br>
> > OGRFeature(okcounties_name):1<br>
> ><br>
> > ogr_pkid (String) = 213FC01A8AA5FA1E1ADC65B21904DA<wbr>34_okcounties_1_name_1<br>
> > parent_ogr_pkid (String) = 213FC01A8AA5FA1E1ADC65B21904DA<wbr>34_okcounties_1<br>
> > value (String) = BEAVER<br>
> ><br>
> > Even<br>
> ><br>
> ><br>
> > --<br>
> > Spatialys - Geospatial professional services<br>
> > <a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
<br>
<br>
--<br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
</div></div></blockquote></div><br></div>