[mapserver-users] WFS multiple typenames in request, only one in reply

Attila BERÉNYI aberenyi at burken.hu
Tue Apr 13 07:41:21 EDT 2010


Hello,

Thanks, I've finally solved the problem.
It was OpenLayers, not MapServer related, anyway your help was very useful!

BR,
Attila

2010.04.09. 15:08 keltezéssel, Yewondwossen Assefa írta:
> Hi There,
>
> wfs post request should look like this:
>
> <?xml version="1.0" ?>
> <wfs:GetFeature service="WFS" version="1.1.0" outputFormat="text/xml; 
> subtype=gml/3.1.1" xmlns:wfs="http://www.opengis.net/wfs" 
> xmlns:ogc="http://www.opengis.net/ogc" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xsi:schemaLocation="http://www.opengis.net/wfs ../wfs/1.1.0/WFS.xsd">
> <wfs:Query typeName="my_name">
> <ogc:Filter>
> ...
> </ogc:Filter>
> </wfs:Query>
> <wfs:Query typeName="my_layer2">
> <ogc:Filter>
> ....
> </ogc:Filter>
> </wfs:Query>
> </wfs:GetFeature>
>
> You can check the xsds for more details at 
> http://schemas.opengis.net/wfs/
>
> regards,
>
> Attila BERÉNYI wrote:
>> Hi,
>>
>> Thank you for your response, I'm able to request data from both 
>> layers (typenames) this way, however I'd like to achieve this in 
>> OpenLayers. So I've created a small demo application which uses 
>> XMLHttp to request data from Mapserver.
>> http://webgis.fmt.bme.hu/gfi/xml.html
>> The requests are hard coded, please take a look at the source.
>>
>> How could I achieve the below described functionality with XML 
>> request(s)?
>>
>> Thanks in advance,
>>
>> BR,
>>
>> Attila
>>
>> 2010.04.06. 15:42 keltezéssel, Yewondwossen Assefa írta:
>>> The following URL on your server gives the output for the 2 
>>> typenames I believe:
>>>
>>> http://webgis.fmt.bme.hu/cgi-bin/mvmNew?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=elteresek,elteresek2&Filter=%28%3Cogc:Filter%20xmlns:ogc=%22http://www.opengis.net/ogc%22%3E%3Cogc:BBOX%3E%3Cogc:PropertyName%3EmsGeometry%3C/ogc:PropertyName%3E%3Cgml:Envelope%20xmlns:gml=%22http://www.opengis.net/gml%22%20srsName=%22EPSG:23700%22%3E%3Cgml:lowerCorner%3E649971.6696%20236508.4728%3C/gml:lowerCorner%3E%3Cgml:upperCorner%3E651559.1688%20237919.5832%3C/gml:upperCorner%3E%3C/gml:Envelope%3E%3C/ogc:BBOX%3E%3C/ogc:Filter%3E%29%28%3Cogc:Filter%20xmlns:ogc=%22http://www.opengis.net/ogc%22%3E%3Cogc:BBOX%3E%3Cogc:PropertyName%3EmsGeometry%3C/ogc:PropertyName%3E%3Cgml:Envelope%20xmlns:gml=%22http://www.opengis.net/gml%22%20srsName=%22EPSG:23700%22%3E%3Cgml:lowerCorner%3E649971.6696%20236508.4728%3C/gml:lowerCorner%3E%3Cgml:upperCorner%3E651559.1688%20237919.5832%3C/gml:upperCorner%3E%3C/gml:Envelope%3E%3C/ogc:BBOX%3E%3C/ogc:Filter%3E%29 
>>>
>>>
>>> Attila BERÉNYI wrote:
>>>> Thank you guys, I've tried with comma and brackets as well, no 
>>>> success so far :(
>>>>
>>>> 2010.04.06. 14:46 keltezéssel, Yewondwossen Assefa írta:
>>>>> bartvde at osgis.nl wrote:
>>>>>> Hi,
>>>>>>
>>>>>> you need to repeat your filter (comma-separated) IIRC.
>>>>>>
>>>>> I believe it should be brackets instead of comma: something like 
>>>>> ...&FILTER=(<Filter>...</Filter>)(<Filter>...</Filter>)
>>>>>> Best regards,
>>>>>> Bart
>>>>>>
>>>>>>> Dear All,
>>>>>>>
>>>>>>> I've two layers (elteresek and elteresek2), and I'd like to get 
>>>>>>> features
>>>>>>> from both of them using WFS GetFeature request.
>>>>>>> If I apply one typename at a time, it works correct, but if I 
>>>>>>> include
>>>>>>> two typenames in the request only the first is processed and 
>>>>>>> included in
>>>>>>> the response.
>>>>>>> This works correct (note TYPENAME=elteresek):
>>>>>>> http://webgis.fmt.bme.hu/cgi-bin/mvmNew?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=elteresek&Filter=<ogc:Filter 
>>>>>>>
>>>>>>> xmlns:ogc="http://www.opengis.net/ogc"><ogc:BBOX><ogc:PropertyName>msGeometry</ogc:PropertyName><gml:Envelope 
>>>>>>>
>>>>>>> xmlns:gml="http://www.opengis.net/gml"
>>>>>>> srsName="EPSG:23700"><gml:lowerCorner>649971.6696
>>>>>>> 236508.4728</gml:lowerCorner><gml:upperCorner>651559.1688
>>>>>>> 237919.5832</gml:upperCorner></gml:Envelope></ogc:BBOX></ogc:Filter> 
>>>>>>>
>>>>>>>
>>>>>>> This works correct (note TYPENAME=elteresek2) as well:
>>>>>>> http://webgis.fmt.bme.hu/cgi-bin/mvmNew?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=elteresek2&Filter=<ogc:Filter 
>>>>>>>
>>>>>>> xmlns:ogc="http://www.opengis.net/ogc"><ogc:BBOX><ogc:PropertyName>msGeometry</ogc:PropertyName><gml:Envelope 
>>>>>>>
>>>>>>> xmlns:gml="http://www.opengis.net/gml"
>>>>>>> srsName="EPSG:23700"><gml:lowerCorner>649971.6696
>>>>>>> 236508.4728</gml:lowerCorner><gml:upperCorner>651559.1688
>>>>>>> 237919.5832</gml:upperCorner></gml:Envelope></ogc:BBOX></ogc:Filter> 
>>>>>>>
>>>>>>>
>>>>>>> But the reply for this link includes only the first typename (in 
>>>>>>> this
>>>>>>> case elteresek):
>>>>>>> http://webgis.fmt.bme.hu/cgi-bin/mvmNew?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=elteresek,elteresek2&Filter=<ogc:Filter 
>>>>>>>
>>>>>>> xmlns:ogc="http://www.opengis.net/ogc"><ogc:BBOX><ogc:PropertyName>msGeometry</ogc:PropertyName><gml:Envelope 
>>>>>>>
>>>>>>> xmlns:gml="http://www.opengis.net/gml"
>>>>>>> srsName="EPSG:23700"><gml:lowerCorner>649971.6696
>>>>>>> 236508.4728</gml:lowerCorner><gml:upperCorner>651559.1688
>>>>>>> 237919.5832</gml:upperCorner></gml:Envelope></ogc:BBOX></ogc:Filter> 
>>>>>>>
>>>>>>>
>>>>>>> What am I doing wrong?
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Attila
>>>>>>> _______________________________________________
>>>>>>> mapserver-users mailing list
>>>>>>> mapserver-users at lists.osgeo.org
>>>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> mapserver-users mailing list
>>>>>> mapserver-users at lists.osgeo.org
>>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100413/86369c1e/attachment.html


More information about the mapserver-users mailing list