Skip to content

Problem in isochrone_polygon_with_alpha_shape #4

Description

@sblandin2018

Hello,

I tried to use isochrone_polygon_with_alpha_shape method but I get a TypeError like the following:

~\AppData\Local\Continuum\anaconda3\envs\ultra-np\lib\site-packages\geonetworkx\tools\isochrones.py in isochrone_polygon_with_alpha_shape(graph, source, limit, weight, alpha_quantile, remove_holes, tolerance)
    204     ego_graph = gnx.extended_ego_graph(graph, source, limit, distance=weight)
    205     edge_as_lines = ego_graph.get_edges_as_line_series()
--> 206     discretized_lines, _ = gnx.discretize_lines(edge_as_lines)
    207     alpha_shape = get_alpha_shape_polygon(discretized_lines, alpha_quantile)
    208     alpha_shape = alpha_shape.buffer(tolerance)

TypeError: discretize_lines() missing 1 required positional argument: 'discretization_tol'

You can reproduce the issue with the following code:

import geonetworkx as gnx
import osmnx as ox
g = ox.get_digraph(ox.graph_from_bbox(45.64890, 45.58723, 8.88880, 8.80244))
gg = gnx.read_geograph_with_coordinates_attributes(g)
gnx.fill_length_attribute(gg)
iso_poly = gnx.isochrone_polygon_with_alpha_shape(gg, 2321989260, 500)

It seems that discretize_lines function needs an additional discretization_tol parameter to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions