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

TypeError: GeometryCollection geom type not compatible (l155 - osmgt/geometry/geom_helpers.py in convert_to_polygon(polygon_geom)) #17

Open
amauryval opened this issue Jan 29, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@amauryval
Copy link
Owner

Exception returned due to GeometryCollection type.

Workflow used:

from osmgt import OsmGt
from shapely.geometry import Point
import geopandas as gpd

pt = Point(3.930914582537432, 43.612687207093416)
source_nodes = gpd.GeoDataFrame(index=[0], crs='epsg:4326', geometry=[pt])

isochrones_polygon_values = {
    250: "#d9ef8b",
    500: "#fee08b",
    750: "#f46d43"
}

isochrones_lines_values = {
    250: "#668100",
    500: "#e2a803",
    750: "#962603"
}

trip_speed = 3.6  # km/h

location_points = list(source_nodes["geometry"])
# location_points.extend(location_points)

isochrones_polygons, isochrones_lines = OsmGt.isochrone_distances_from_nodes(
    location_points,
    list(isochrones_polygon_values.keys()),
    trip_speed,
    mode="pedestrian"
)

GeometryCollection should be supported ! (extract [multi]polygon(s) parts ?)

@amauryval amauryval self-assigned this Jan 29, 2022
@amauryval amauryval added the bug Something isn't working label Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant