Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WFS interface for geometry access #465

Open
bekozi opened this issue Sep 21, 2017 · 0 comments
Open

Add WFS interface for geometry access #465

bekozi opened this issue Sep 21, 2017 · 0 comments

Comments

@bekozi
Copy link
Contributor

bekozi commented Sep 21, 2017

Working with geometries retrieved from a WFS (web feature service) requires formatting a URL and creating a geometry dictionary. This could be streamlined by supporting WFS URLs similar to how shapefile/geodatabase access is handled in ocgis.

Some example code and recommendations from @huard:

conn = WebFeatureService(url=geoserver, version='2.0.0')
resp = conn.getfeature([typename], featureid=features,outputFormat='application/json')
feature = json.loads(resp.read())
crs_code = owslib.crs.Crs(feature['crs']['properties']['name']).code
crs = ocgis.CoordinateReferenceSystem(epsg=crs_code)
geom = [
{'geom': shape(f['geometry']), 'crs': crs,
'properties': f['properties']}
for f in feature['features']]

Parameters to include at the very least: server, typename, featureid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant