#owslib
Our favourite stack @ isric currently is #postgres #mapserver #pycsw #owslib #terriajs #qgis #postgraphile #virtuoso #cog running on #k8s, expect posts in that area...
November 18, 2024 at 11:42 PM
Using the Intersect filter in OWSlib to filter data between two WFS
I'm trying to use OWSLib to deal with multiple WSF features in python, for now, I'm trying to return all features in sfb WFS that intersects with the specifc feature retrieved in sicar WFS. from owslib.wfs import WebFeatureService, Authentication from owslib.fes2 import PropertyIsEqualTo, Intersects from owslib.etree import etree auth = Authentication() auth.verify = False sicar = WebFeatureService( url="https://geoserver.car.gov.br/geoserver/sicar/ows", auth=auth, version='2.0.0') sfb = WebFeatureService( 'http://sistemas.florestal.gov.br/geoserver/ows', version='2.0.0') car = 'MT-5103700-92A39DC62FDF4D88874F218D41BE1C7F' filter_car = PropertyIsEqualTo('cod_imovel', car).toXML() carInfo = sicar.getfeature(typename='sicar:sicar_imoveis_mt', filter=filter_car, method='post', outputFormat='json') The code above is working fine, the problem starts when i try to get the Intersects geom_property = 'geo_area_imovel'; carInfoStr = carInfo.read().decode('utf-8'); geom = json.loads(carInfoStr)['features'][0]['geometry']['coordinates'] #I'm trying to pass the the coordinates list to Intersects, but i tried with other keys of the object and with the xml response, but doesn't wotk as well. filter_contains = Intersects(geom_property, geom).toXML() intersected = sfb.getfeature(typename='CNFP_orig:APP_Total_simp', filter=filter_contains, outputFormat='json', method='post') The returned errors involve the toXML function, wich depends on the geometry i pass to the intersects, in this case its a string, but need to be the constructor of something of the owslib, but the lib only have Point constructor. I could pass a point if I could retrieve the centroid of geometry, but I don't now how to do this with this lib. BUT, even the example passed in a official PR is not working. the PR with example: https://github.com/geopython/OWSLib/pull/780 The error in this code: Traceback (most recent call last): File "/home/gabrielubuntu/repos/pygeogis/app.py", line 38, in filter_contains = Intersects(geom_property, geom).toXML() File "/home/gabrielubuntu/repos/pygeogis/.venv/lib/python3.10/site-packages/owslib/fes2.py", line 420, in toXML node.append(self.geometry.toXML()) AttributeError: 'dict' object has no attribute 'toXML'
gis.stackexchange.com
August 19, 2026 at 8:04 PM
Connecting to several WFS using python/OWSLIB/OGR2OGR
I'm trying to download a lot of datasets from different WFS URLs using ogr2ogr (and to an extent, owslib) in Python. My problem arises when I try to connect to a second WFS. In my test code, I have first tried connecting to one WFS, then downloading the layer. This went fine. Afterwards, I replaced the URL with a second WFS URL. this time I got the error: ConnectionError: ('Connection aborted.', ConnectionResetError(10054 An existing connection was forcibly closed by the remote host)). In the first part of the code I try to extract the version number from the WFS: import subprocess from owslib.wfs import WebFeatureService as wfsmod #connecting to second WFS using owslib url = 'http://wfs2-miljoegis.mim.dk/raastofpaahavet/ows? version=1.1.0&OUTPUTFORMAT=GML2' wfs = wfsmod(url) version = (wfs.identification.version) typenam ="rashavtilladelser20auktion" The connection error happens at line "wfs = wfsmod(url)". I also try to download a specific layer from this url using ogr2ogr/subprocesses: if str(version) == "2.0.0": #layername is the specific title of the layer on the WFS server. layername = "&TYPENAMES="+layername else: layername = "&TYPENAME="+layername cmd = [r"C:\OSGeo4W\bin\ogr2ogr.exe", "-f", "ESRI Shapefile", r"C:\havplan\havplan_data\wfs_downloads\havbrugszoner.shp", "WFS:"+url+"version="+str(version) +"&request=GetFeature"+layername] subprocess.check_call(cmd) as far as I understand, the error happens because I can only connect to one WFS at a time in Python. Is there some way to close the connection to a WFS in owslib and ogr2ogr using a command?
gis.stackexchange.com
July 21, 2026 at 2:02 PM
Ubuntu 22.04 OWSLib Important Info Exposure Vuln USN-8247-1 CVE-2023-27476 OWSLib could be made to expose sensitive information.

#Ubuntu #Linux #Distribution #- #Security #Advisories

Origin | Interest | Match
Ubuntu 22.04 OWSLib Important Info Exposure Vuln USN-8247-1
Ubuntu OWSLib security update fixes sensitive info exposure issue. Ensure systems are updated to prevent data leaks.
linuxsecurity.com
May 7, 2026 at 2:08 PM
Using the Intersect filter in OWSlib to filter data between two WFS
I'm trying to use OWSLib to deal with multiple WSF features in python, for now, I'm trying to return all features in sfb WFS that intersects with the specifc feature retrieved in sicar WFS. from owslib.wfs import WebFeatureService, Authentication from owslib.fes2 import PropertyIsEqualTo, Intersects from owslib.etree import etree auth = Authentication() auth.verify = False sicar = WebFeatureService( url="https://geoserver.car.gov.br/geoserver/sicar/ows", auth=auth, version='2.0.0') sfb = WebFeatureService( 'http://sistemas.florestal.gov.br/geoserver/ows', version='2.0.0') car = 'MT-5103700-92A39DC62FDF4D88874F218D41BE1C7F' filter_car = PropertyIsEqualTo('cod_imovel', car).toXML() carInfo = sicar.getfeature(typename='sicar:sicar_imoveis_mt', filter=filter_car, method='post', outputFormat='json') The code above is working fine, the problem starts when i try to get the Intersects geom_property = 'geo_area_imovel'; carInfoStr = carInfo.read().decode('utf-8'); geom = json.loads(carInfoStr)['features'][0]['geometry']['coordinates'] #I'm trying to pass the the coordinates list to Intersects, but i tried with other keys of the object and with the xml response, but doesn't wotk as well. filter_contains = Intersects(geom_property, geom).toXML() intersected = sfb.getfeature(typename='CNFP_orig:APP_Total_simp', filter=filter_contains, outputFormat='json', method='post') The returned errors involve the toXML function, wich depends on the geometry i pass to the intersects, in this case its a string, but need to be the constructor of something of the owslib, but the lib only have Point constructor. I could pass a point if I could retrieve the centroid of geometry, but I don't now how to do this with this lib. BUT, even the example passed in a official PR is not working. the PR with example: https://github.com/geopython/OWSLib/pull/780 The error in this code: Traceback (most recent call last): File "/home/gabrielubuntu/repos/pygeogis/app.py", line 38, in filter_contains = Intersects(geom_property, geom).toXML() File "/home/gabrielubuntu/repos/pygeogis/.venv/lib/python3.10/site-packages/owslib/fes2.py", line 420, in toXML node.append(self.geometry.toXML()) AttributeError: 'dict' object has no attribute 'toXML'
gis.stackexchange.com
April 15, 2026 at 5:10 AM
Connecting to several WFS using python/OWSLIB/OGR2OGR
I'm trying to download a lot of datasets from different WFS URLs using ogr2ogr (and to an extent, owslib) in Python. My problem arises when I try to connect to a second WFS. In my test code, I have first tried connecting to one WFS, then downloading the layer. This went fine. Afterwards, I replaced the URL with a second WFS URL. this time I got the error: ConnectionError: ('Connection aborted.', ConnectionResetError(10054 An existing connection was forcibly closed by the remote host)). In the first part of the code I try to extract the version number from the WFS: import subprocess from owslib.wfs import WebFeatureService as wfsmod #connecting to second WFS using owslib url = 'http://wfs2-miljoegis.mim.dk/raastofpaahavet/ows? version=1.1.0&OUTPUTFORMAT=GML2' wfs = wfsmod(url) version = (wfs.identification.version) typenam ="rashavtilladelser20auktion" The connection error happens at line "wfs = wfsmod(url)". I also try to download a specific layer from this url using ogr2ogr/subprocesses: if str(version) == "2.0.0": #layername is the specific title of the layer on the WFS server. layername = "&TYPENAMES="+layername else: layername = "&TYPENAME="+layername cmd = [r"C:\OSGeo4W\bin\ogr2ogr.exe", "-f", "ESRI Shapefile", r"C:\havplan\havplan_data\wfs_downloads\havbrugszoner.shp", "WFS:"+url+"version="+str(version) +"&request=GetFeature"+layername] subprocess.check_call(cmd) as far as I understand, the error happens because I can only connect to one WFS at a time in Python. Is there some way to close the connection to a WFS in owslib and ogr2ogr using a command?
gis.stackexchange.com
March 21, 2026 at 1:04 PM
Using the Intersect filter in OWSlib to filter data between two WFS
I'm trying to use OWSLib to deal with multiple WSF features in python, for now, I'm trying to return all features in sfb WFS that intersects with the specifc feature retrieved in sicar WFS. from owslib.wfs import WebFeatureService, Authentication from owslib.fes2 import PropertyIsEqualTo, Intersects from owslib.etree import etree auth = Authentication() auth.verify = False sicar = WebFeatureService( url="https://geoserver.car.gov.br/geoserver/sicar/ows", auth=auth, version='2.0.0') sfb = WebFeatureService( 'http://sistemas.florestal.gov.br/geoserver/ows', version='2.0.0') car = 'MT-5103700-92A39DC62FDF4D88874F218D41BE1C7F' filter_car = PropertyIsEqualTo('cod_imovel', car).toXML() carInfo = sicar.getfeature(typename='sicar:sicar_imoveis_mt', filter=filter_car, method='post', outputFormat='json') The code above is working fine, the problem starts when i try to get the Intersects geom_property = 'geo_area_imovel'; carInfoStr = carInfo.read().decode('utf-8'); geom = json.loads(carInfoStr)['features'][0]['geometry']['coordinates'] #I'm trying to pass the the coordinates list to Intersects, but i tried with other keys of the object and with the xml response, but doesn't wotk as well. filter_contains = Intersects(geom_property, geom).toXML() intersected = sfb.getfeature(typename='CNFP_orig:APP_Total_simp', filter=filter_contains, outputFormat='json', method='post') The returned errors involve the toXML function, wich depends on the geometry i pass to the intersects, in this case its a string, but need to be the constructor of something of the owslib, but the lib only have Point constructor. I could pass a point if I could retrieve the centroid of geometry, but I don't now how to do this with this lib. BUT, even the example passed in a official PR is not working. the PR with example: https://github.com/geopython/OWSLib/pull/780 The error in this code: Traceback (most recent call last): File "/home/gabrielubuntu/repos/pygeogis/app.py", line 38, in filter_contains = Intersects(geom_property, geom).toXML() File "/home/gabrielubuntu/repos/pygeogis/.venv/lib/python3.10/site-packages/owslib/fes2.py", line 420, in toXML node.append(self.geometry.toXML()) AttributeError: 'dict' object has no attribute 'toXML'
gis.stackexchange.com
December 7, 2025 at 2:10 AM
Connecting to several WFS using python/OWSLIB/OGR2OGR
I'm trying to download a lot of datasets from different WFS URLs using ogr2ogr (and to an extent, owslib) in Python. My problem arises when I try to connect to a second WFS. In my test code, I have first tried connecting to one WFS, then downloading the layer. This went fine. Afterwards, I replaced the URL with a second WFS URL. this time I got the error: ConnectionError: ('Connection aborted.', ConnectionResetError(10054 An existing connection was forcibly closed by the remote host)). In the first part of the code I try to extract the version number from the WFS: import subprocess from owslib.wfs import WebFeatureService as wfsmod #connecting to second WFS using owslib url = 'http://wfs2-miljoegis.mim.dk/raastofpaahavet/ows? version=1.1.0&OUTPUTFORMAT=GML2' wfs = wfsmod(url) version = (wfs.identification.version) typenam ="rashavtilladelser20auktion" The connection error happens at line "wfs = wfsmod(url)". I also try to download a specific layer from this url using ogr2ogr/subprocesses: if str(version) == "2.0.0": #layername is the specific title of the layer on the WFS server. layername = "&TYPENAMES="+layername else: layername = "&TYPENAME="+layername cmd = [r"C:\OSGeo4W\bin\ogr2ogr.exe", "-f", "ESRI Shapefile", r"C:\havplan\havplan_data\wfs_downloads\havbrugszoner.shp", "WFS:"+url+"version="+str(version) +"&request=GetFeature"+layername] subprocess.check_call(cmd) as far as I understand, the error happens because I can only connect to one WFS at a time in Python. Is there some way to close the connection to a WFS in owslib and ogr2ogr using a command?
gis.stackexchange.com
November 15, 2025 at 2:04 PM
Using the Intersect filter in OWSlib to filter data between two WFS
I'm trying to use OWSLib to deal with multiple WSF features in python, for now, I'm trying to return all features in sfb WFS that intersects with the specifc feature retrieved in sicar WFS. from owslib.wfs import WebFeatureService, Authentication from owslib.fes2 import PropertyIsEqualTo, Intersects from owslib.etree import etree auth = Authentication() auth.verify = False sicar = WebFeatureService( url="https://geoserver.car.gov.br/geoserver/sicar/ows", auth=auth, version='2.0.0') sfb = WebFeatureService( 'http://sistemas.florestal.gov.br/geoserver/ows', version='2.0.0') car = 'MT-5103700-92A39DC62FDF4D88874F218D41BE1C7F' filter_car = PropertyIsEqualTo('cod_imovel', car).toXML() carInfo = sicar.getfeature(typename='sicar:sicar_imoveis_mt', filter=filter_car, method='post', outputFormat='json') The code above is working fine, the problem starts when i try to get the Intersects geom_property = 'geo_area_imovel'; carInfoStr = carInfo.read().decode('utf-8'); geom = json.loads(carInfoStr)['features'][0]['geometry']['coordinates'] #I'm trying to pass the the coordinates list to Intersects, but i tried with other keys of the object and with the xml response, but doesn't wotk as well. filter_contains = Intersects(geom_property, geom).toXML() intersected = sfb.getfeature(typename='CNFP_orig:APP_Total_simp', filter=filter_contains, outputFormat='json', method='post') The returned errors involve the toXML function, wich depends on the geometry i pass to the intersects, in this case its a string, but need to be the constructor of something of the owslib, but the lib only have Point constructor. I could pass a point if I could retrieve the centroid of geometry, but I don't now how to do this with this lib. BUT, even the example passed in a official PR is not working. the PR with example: https://github.com/geopython/OWSLib/pull/780 The error in this code: Traceback (most recent call last): File "/home/gabrielubuntu/repos/pygeogis/app.py", line 38, in filter_contains = Intersects(geom_property, geom).toXML() File "/home/gabrielubuntu/repos/pygeogis/.venv/lib/python3.10/site-packages/owslib/fes2.py", line 420, in toXML node.append(self.geometry.toXML()) AttributeError: 'dict' object has no attribute 'toXML'
gis.stackexchange.com
August 6, 2025 at 12:07 AM
Connecting to several WFS using python/OWSLIB/OGR2OGR
I'm trying to download a lot of datasets from different WFS URLs using ogr2ogr (and to an extent, owslib) in Python. My problem arises when I try to connect to a second WFS. In my test code, I have first tried connecting to one WFS, then downloading the layer. This went fine. Afterwards, I replaced the URL with a second WFS URL. this time I got the error: ConnectionError: ('Connection aborted.', ConnectionResetError(10054 An existing connection was forcibly closed by the remote host)). In the first part of the code I try to extract the version number from the WFS: import subprocess from owslib.wfs import WebFeatureService as wfsmod #connecting to second WFS using owslib url = 'http://wfs2-miljoegis.mim.dk/raastofpaahavet/ows? version=1.1.0&OUTPUTFORMAT=GML2' wfs = wfsmod(url) version = (wfs.identification.version) typenam ="rashavtilladelser20auktion" The connection error happens at line "wfs = wfsmod(url)". I also try to download a specific layer from this url using ogr2ogr/subprocesses: if str(version) == "2.0.0": #layername is the specific title of the layer on the WFS server. layername = "&TYPENAMES="+layername else: layername = "&TYPENAME="+layername cmd = [r"C:\OSGeo4W\bin\ogr2ogr.exe", "-f", "ESRI Shapefile", r"C:\havplan\havplan_data\wfs_downloads\havbrugszoner.shp", "WFS:"+url+"version="+str(version) +"&request=GetFeature"+layername] subprocess.check_call(cmd) as far as I understand, the error happens because I can only connect to one WFS at a time in Python. Is there some way to close the connection to a WFS in owslib and ogr2ogr using a command?
gis.stackexchange.com
July 17, 2025 at 2:15 PM
Using the Intersect filter in OWSlib to filter data between two WFS
I'm trying to use OWSLib to deal with multiple WSF features in python, for now, I'm trying to return all features in sfb WFS that intersects with the specifc feature retrieved in sicar WFS. from owslib.wfs import WebFeatureService, Authentication from owslib.fes2 import PropertyIsEqualTo, Intersects from owslib.etree import etree auth = Authentication() auth.verify = False sicar = WebFeatureService( url="https://geoserver.car.gov.br/geoserver/sicar/ows", auth=auth, version='2.0.0') sfb = WebFeatureService( 'http://sistemas.florestal.gov.br/geoserver/ows', version='2.0.0') car = 'MT-5103700-92A39DC62FDF4D88874F218D41BE1C7F' filter_car = PropertyIsEqualTo('cod_imovel', car).toXML() carInfo = sicar.getfeature(typename='sicar:sicar_imoveis_mt', filter=filter_car, method='post', outputFormat='json') The code above is working fine, the problem starts when i try to get the Intersects geom_property = 'geo_area_imovel'; carInfoStr = carInfo.read().decode('utf-8'); geom = json.loads(carInfoStr)['features'][0]['geometry']['coordinates'] #I'm trying to pass the the coordinates list to Intersects, but i tried with other keys of the object and with the xml response, but doesn't wotk as well. filter_contains = Intersects(geom_property, geom).toXML() intersected = sfb.getfeature(typename='CNFP_orig:APP_Total_simp', filter=filter_contains, outputFormat='json', method='post') The returned errors involve the toXML function, wich depends on the geometry i pass to the intersects, in this case its a string, but need to be the constructor of something of the owslib, but the lib only have Point constructor. I could pass a point if I could retrieve the centroid of geometry, but I don't now how to do this with this lib. BUT, even the example passed in a official PR is not working. the PR with example: https://github.com/geopython/OWSLib/pull/780 The error in this code: Traceback (most recent call last): File "/home/gabrielubuntu/repos/pygeogis/app.py", line 38, in filter_contains = Intersects(geom_property, geom).toXML() File "/home/gabrielubuntu/repos/pygeogis/.venv/lib/python3.10/site-packages/owslib/fes2.py", line 420, in toXML node.append(self.geometry.toXML()) AttributeError: 'dict' object has no attribute 'toXML'
gis.stackexchange.com
April 7, 2025 at 3:10 PM