[CG] : add parameter version
This commit is contained in:
parent
1d6fe399a0
commit
6edf13a56d
@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
from owslib.wfs import WebFeatureService
|
from owslib.wfs import WebFeatureService
|
||||||
|
|
||||||
def get_wfs(url, layer, bbox=None):
|
def get_wfs(url, layer, version:str='1.0.0', bbox=None):
|
||||||
from geopandas import read_file
|
from geopandas import read_file
|
||||||
from requests import Request
|
from requests import Request
|
||||||
wfs = WebFeatureService(url=url)
|
wfs = WebFeatureService(url=url,version=version,)
|
||||||
item = dict(wfs.items())[layer]
|
item = dict(wfs.items())[layer]
|
||||||
crs = item.crsOptions[0].getcode()
|
crs = item.crsOptions[0].getcode()
|
||||||
params = dict(service='WFS', version=wfs.version, request='GetFeature',
|
params = dict(service='WFS', version=wfs.version, request='GetFeature',
|
||||||
@ -18,7 +18,7 @@ def get_wfs(url, layer, bbox=None):
|
|||||||
data.to_crs(epsg=2154, inplace=True)
|
data.to_crs(epsg=2154, inplace=True)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def list_layer(url):
|
def list_layer(url,version:str='1.0.0'):
|
||||||
wfs = WebFeatureService(url=url)
|
wfs = WebFeatureService(url=url,version=version)
|
||||||
lst = list(wfs.contents)
|
lst = list(wfs.contents)
|
||||||
return lst
|
return lst
|
||||||
Loading…
x
Reference in New Issue
Block a user