I am having a bit of trouble with attempting a GetFeature Request against a
Geoserver 2.0.1 WFS, using OWSLib Trunk on Ubuntu 10.04/ Python 2.6.5

The following lines in OWSLib/trunk/owslib/feature/wfs100.py seem to be the
problem:

185            if method == 'Post':
186                u = urlopen(base_url, data=data)
187            else:
188                u = urlopen(base_url + data)

Whether GETing or POSTing, the URL's are mangled:

e.g GET -> GET
/geoserver/wfs?request=GetFeatureservice=WFS&maxfeatures=5&propertyname=%2A&request=GetFeature&typename=openafis%3Akruger_burn_blocks&version=1.0.0

e.g. POST -> GET
/geoserver/wfs&service=WFS&maxfeatures=5&propertyname=%2A&request=GetFeature&typename=openafis%3Akruger_burn_blocks&version=1.0.0

and an error is caused (Service Exception in GET case  and HTTP 404 in the
case of POST)

For GET, reason seems to be that there is a missing ampersand between
request=GetFeatureservice=WFS

For POST, reason seems to be that the GetFeature method parameter expects a
full '{http://www.opengis.net/wfs}Post' string, yet in Line 185, the
unqualified string is tested for, is never found and falls through to
generating a faulty GET request

This statement hack seems to fix the problem for me:

        if method == '{http://www.opengis.net/wfs}Post':
            u = urlopen(base_url, data=data)
        else:
            u = urlopen(base_url + '&' + data)

Has this kind of thing been noticed before?

Regards
Graeme McFerren
_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community

Reply via email to