Skip to content

Use interpolated points along LineStrings for sampling #1

@veniversum

Description

@veniversum

coordinates = json.loads(geojson)['coordinates']
values = []
for coord in coordinates:
values.append(provider.get_value(*coord))

Currently, our sampling algorithm uses the coordinates (points) in LineString objects. This poses an issue since LineStrings can contain different number of points, and the points may not be at evenly spaced intervals.

A better sampling algorithm can sample values from N equally spaced, points along the LineString, which should provide a better estimate of the value of the LineString overall.

The following function in the Shapely library could be useful:
https://toblerity.org/shapely/manual.html#object.interpolate

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions