-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwfs1.py
30 lines (20 loc) · 1.02 KB
/
wfs1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'''
pdok wfs:
http://geodata.nationaalgeoregister.nl/bestuurlijkegrenzen/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=bestuurlijkegrenzen:gemeenten&SRSNAME=EPSG:28992&BBOX=0,300000,300000,600000
http://geodata.nationaalgeoregister.nl/bestuurlijkegrenzen/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities
'''
import osgeo
from osgeo import gdal,ogr
def main():
#ERROR 4: Unable to open EPSG support file gcs.csv.Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.
osgeo.gdal.SetConfigOption("GDAL_DATA", 'C:\Gis\OSGeo4W64\share\gdal')
layer_list = []
driver = ogr.GetDriverByName('WFS')
wfsurl = driver.Open('http://geodata.nationaalgeoregister.nl/bestuurlijkegrenzen/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities')
for i in range(0, wfsurl.GetLayerCount()):
layer = wfsurl.GetLayerByIndex(i)
layer_list.append(layer.GetName())
wfsurl.Destroy()
print layer_list
if __name__ == '__main__':
main()