geopython / geopython/OWSLib

integration with ipython/jupyter and geopandas/shapely

Open
#1,044 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
428
Forks
284
Avg merge
6h 45m
Merged PRs (30d)
1

Description

i wonder if we can implement some of the internals of geopandas and ipython, to have better integrations with those libraries
this came up while preparing the geopython training

for example:

## shapely

implements a _repr_svg_() method on geometries, this is picked up by ipython, to display the svg whenever the variable is logged (in jupyter etc)

## geopandas

implements a _repr_html_() on dataframes, so whenever the dataframe is logged a nice table structure is displayed (in jupyter etc)
i wonder if we could implement that function on owslib responses

## wfs

to capture a wfs response in a geodataframe, i can use the raw gml response in gpd.read_file

```
gdf = geopandas.read_file(wfs11.getfeature(typename='ms:cities'))
```

## ogc-api-features

to capture a ogcapi-features response in a geodataframe, i can benefit from the fact they are a list of geo-features, this should also work for ogcapi-records

```
gdf = gpd.GeoDataFrame.from_features(lakes_query['features'])
```

## csw

to capture the response of a csw query in a dataframe, this works ok-ish

```
gdf = geopandas .GeoDataFrame([r.__dict__ for r in thecsw.records.values()])
```
Maybe we can provide a table or json view of returned records which can instantly be loaded in a dataframe?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the WFS, OGC API Features/Records, and CSW response examples in the issue, then review how their returned objects could be represented for IPython and consumed by GeoPandas. Done should be a clearly scoped integration approach covering the requested notebook display and dataframe-loading use cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter, jupyter-notebook, python
Domain
api, data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.