holoviz / holoviz/hvplot

While plotting a geojson Polygon with `geodataframe.hvplot.paths(geo=True)`, the Polygon is not enclosed in the resulting Bokeh plot

Open
#704 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
124
Avg merge
1d 18h
Merged PRs (30d)
1

Description

#### ALL software version info

hvplot '0.7.3'
Python 3.10.0
bokeh 2.4.2
geoviews 1.9.3

#### Description of expected behavior and the observed behavior
I'm trying to plot a geojson Polygon as paths. But the Bokeh plot doesn't enclose the polygon.

#### Complete, minimal, self-contained example code that reproduces the issue

Here's the code to produce the behaviour:

```python
import geopandas as gpd
import hvplot.pandas

import warnings
warnings.filterwarnings('ignore')

geojson = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
85.6167984008789,
20.149751564715373
],
[
85.66426277160645,
20.149751564715373
],
[
85.66426277160645,
20.166913620901816
],
[
85.6167984008789,
20.166913620901816
],
[
85.6167984008789,
20.149751564715373
],
]
]
}
}
]
}

aoi = gpd.GeoDataFrame.from_features(geojson["features"])
geopath = aoi.hvplot.paths(geo=True, line_width=5)
geopath

```

#### Screenshots or screencasts of the bug in action

Here's screenshot of the resulting Bokeh plot:

![image](https://user-images.githubusercontent.com/1142203/153631360-d8c935f6-2528-4df7-b31d-88c7c0c50542.png)

Plotting the same Polygon with matplotlib results in a bounded box:

![image](https://user-images.githubusercontent.com/1142203/153631533-eece996e-235e-4ad5-9ac9-8e55c38f6c8f.png)

The same polygon also renders fine when `geo=False`:
![image](https://user-images.githubusercontent.com/1142203/153632722-f76ab1d2-4daf-4ebc-98b6-d690548c919b.png)


Let me know if I can provide any more info or if I'm doing something wrong while plotting.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.