remisalmon / gpx-interpolate

Python function to interpolate GPX data using piecewise cubic Hermite splines
MIT License
49 stars 12 forks source link

Fixed number of points? #10

Closed thomergil closed 3 years ago

thomergil commented 3 years ago

@remisalmon, this is amazing and it's exactly what I needed. Thank you! Do you think it's easy to modify the code to specify the total number of points in the result? I'm asking this because I'm trying to match it up against another GPX file and need to ensure that the number of GPX points in both files is equal. Thank you.

remisalmon commented 3 years ago

You can easily do that by changing num = to the number of points you need in:

u_interp = np.linspace(0, np.sum(_gpx_dist), num = 1+int(np.sum(_gpx_dist)/res)) (line 57)

Feel free to open a PR if you would like this to be an option to gpx_interpolate()

thomergil commented 3 years ago

Thank you. https://github.com/remisalmon/gpx_interpolate/pull/11

remisalmon commented 3 years ago

Closed with bb76940c650f6ab9677d15f8768366ee6a98ff41