[gdal-dev] How to give additional WFS parameters right?

Even Rouault even.rouault at mines-paris.org
Wed Aug 15 05:08:23 PDT 2012


> I found also another not totally obvious demand when writing the XML file.
> The value of TYPENAME must include the namespace part.
> This setting works
> <URL>http://hip.latuviitta.org/cgi-bin/tinyows?
> TYPENAME=lv:municipalities&MAXFEATURES=2</URL>
> 
> But this lazy written definition without namespace does not
> <URL>http://hip.latuviitta.org/cgi-bin/tinyows?
> TYPENAME=municipalities&MAXFEATURES=2</URL>
> 
> What makes it not obvious is that namespace is not needed if command is
> sent directly without using the XML definition file
> ogrinfo "wfs:http://hip.latuviitta.org/cgi-bin/tinyows?maxfeatures=2"
> municipalities
> 
> If behaviour cannot be changed (or is not wise to change) so that namespace
> is not necessary then it would be good to edit documentation a little bit:

Added to the doc : "The name provided to the TYPENAME parameter must be 
exactly the layer name reported by OGR,
in particular with its namespace prefix when its exists."

The fact that you can use the short name in GetLayerByName() (which is what is 
invoked by 'ogrinfo datasource layername') is just some syntaxic sugar that 
you happened to discover. But it is already a bit difficult to manage it in the 
code (For example if you had foo:some_name and bar:some_name, it will be 
disabled), so I almost regret it to have added it and I would prefer not 
extending it to other places of the driver, in particular in TYPENAME which is 
an advanced use of the driver.

> 
> Finally, could it be so that a list of values is not properly supported as
> TYPENAME or am I writing it somehow wrong again? Ogrinfo does not find any
> layers if I write the following into XML file, instead of two layers as I
> expected.

Specifying several names wasn't supported actually, but it is an easy and 
natural addition compliant with the WFS spec, so it is now. Added to the doc : 
"Note: starting with GDAL 2.0, several type names can be provided and 
separated by comma."



More information about the gdal-dev mailing list