for the past couple of days I have been trying to consume a WFS through Python.
I was using owslib but I noticed that the client only uses version 1.0.0 and i tried to apply cql_filters by doing like this
from owslib.wfs import WebFeatureService from osgeo import gdal import arcpy from owslib.fes import * from xml.etree import ElementTree as ET filter = PropertyIsLike(propertyname='cql_filter', literal='sorgun', wildCard='*') filterxml = etree.tostring(filter.toXML()).decode("utf-8") wfs_link= 'somelink here' wfs = WebFeatureService(url=wfs_link, version='1.0.0', username = "userX", password = "pw2") request_data = {"typename":["X:Y"], "srsname": "EPSG:4326"} data = wfs.getfeature(filter= filterxml, **request_data) So I realized that ows only starts to support to filters with the version of '1.1.0', I cannot apply any filters which does not help me. I tried to give it as a request_data parameter but it gives me error.
Is there any other way to do so or any other library that I can use to consume WFS?
Edit1:
So I discarded the first part of the URL, but the request should look something like this:
http://someservice/tkgm.ows/wfs?REQUEST=GetFeature&%3BSERVICE=WFS&%3BSRSNAME=EPSG%3A4326&%3BTYPENAME=TKGM%3Amahalleler&%3Bcql_filter=(tapumahallead%20ilike%20%27sorgun%27)