urschrei / simplification

Very fast Python line simplification using either the RDP or Visvalingam-Whyatt algorithm implemented in Rust
Other
168 stars 18 forks source link

Before/After metadata when simplified points are returned #6

Closed telemmaite closed 4 years ago

telemmaite commented 5 years ago

Let`s say is we have of not only X,Y points but also heading and timestamp of the point. So input looks like [[X,Y,HEADING,TIMESTAMP]] After X,Y simplification, can we still return or somehow intersect with initial data-set ?

urschrei commented 5 years ago

No, because the foreign function (in https://github.com/georust/geo) doesn't currently return the indices of the retained points, only the points themselves. It's certainly possible to return the indices, but that's work that will have to be done on the Rust library.

eLvErDe commented 4 years ago

Hello,

+1 for this feature. In the meanwhile could you advice us how to workaround this ? Iterating over both array to re-add metadata will probably kill performances..

Thanks

urschrei commented 4 years ago

As I said, the underlying Rust library RDP implementation cannot currently return indices – I have a PR that enables it hopefully ready to merge, but there's no workaround until then.

eLvErDe commented 4 years ago

Nice, I see the PR has been merged :+1: