mrcagney / geohexgrid

A Python library for making geographic flat-top hexagon grids like QGIS's `create grid` function
12 stars 0 forks source link

Missing row #2

Closed kbrashem closed 1 month ago

kbrashem commented 2 months ago

First, off thanks for the awesome work on this repo! I was looking for a means of creating hexgrids outside of postgis and this does the trick.

I noticed in initial testing of the tool that the top row was missing. I'm using python 3.12.5

image

import geopandas as gpd
from shapely.geometry import MultiLineString
import matplotlib.pyplot as plt
import geohexgrid as ghg

gdf = gpd.GeoDataFrame({"geometry": [MultiLineString([[(0, 0), (1, 0), (1, 1), (0, 1)]])]})

hex = ghg.make_grid_from_gdf(gdf, R=.1)

fig, ax = plt.subplots()
gdf.plot(ax=ax, color="red")
hex.plot(ax=ax, color="blue", alpha=0.5)
plt.show()
araichev commented 2 months ago

Thanks for the compliment and bug report @kbrashem . I'll look into the issue as soon as i can, which is probably this week.

araichev commented 1 month ago

Fixed in release 2.1.0.