mrcagney / geohexgrid

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

Missing row #2

Open kbrashem opened 1 day ago

kbrashem commented 1 day 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 1 day 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.