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

BUG: CellAligment bug with enclosed tessellation #252

Open
AleFeli opened this issue Jan 14, 2021 · 2 comments
Open

BUG: CellAligment bug with enclosed tessellation #252

AleFeli opened this issue Jan 14, 2021 · 2 comments
Labels
bug Something isn't working needs info

Comments

@AleFeli
Copy link
Contributor

AleFeli commented Jan 14, 2021

When computing CellAlignment on enclosed tessellation, a Length mismatch error is generated. This seems to depend on the fact that enclosed tessellation, unlike "traditional" tessellation features polygons that do not contain building geometries. A way around this could be excluding empty cells or assigning NaN/0 values?

@martinfleis martinfleis added the bug Something isn't working label Jan 14, 2021
@martinfleis martinfleis added this to the 0.4.2 milestone Jan 14, 2021
@martinfleis martinfleis changed the title CellAligment bug with enclosed tessellation BUG: CellAligment bug with enclosed tessellation Jan 14, 2021
@martinfleis
Copy link
Member

Hey @AleFeli, I am not able to reproduce this. With the following code, which results in 144 buildings and 153 cells, CellAlignment works as intended. Can you send the full Traceback or find out which situation causes the failure?

import geopandas as gpd
import momepy as mm

roads = gpd.read_file(mm.datasets.get_path('bubenec'), layer='streets')
blg = gpd.read_file(mm.datasets.get_path('bubenec'), layer='buildings')

enclosures = mm.enclosures(roads, gpd.GeoSeries([roads.unary_union.convex_hull]))
et = mm.Tessellation(blg, 'uID', enclosures=enclosures)
tess = et.tessellation

ca = mm.CellAlignment(blg, tess, mm.Orientation(blg).series, mm.Orientation(tess).series, 'uID', 'uID')

@AleFeli
Copy link
Contributor Author

AleFeli commented Jan 25, 2021

No failure in this case. I will try to find out more using the data I was working with when I found the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs info
Projects
None yet
Development

No branches or pull requests

2 participants