Follow

What's the state of the art for doing processing in in the browser?

e.g. I have a ~60km GPX file, ~100 points, and I wanna know the nearest distance of each point to the line.
I know exactly how to do this in postgis, or even by hand. I know basic JS. How can I do this in JS on a webpage? (pref. non nodejs)

I could write a programme to do this, but I can't do _everything_ in rust.

OR CAN I?

@spacekookie I am trying to resist the siren song of finally learning rust & wasm.

@spacekookie OTOH I have been burned by the trainwreck of nodejs/npm packaging, so WHY NOT SOLVE IT PROPERLY! :)

@amapanda "Your scientists were so preoccupied with whether or not they could, they didn’t stop to think if they should."

@amapanda well if you know how to do it by hand you just need to convert it to JavaScript. You can use the console to write the functions and run them directly in the browser.

If that is too difficult, you could try writing your own script.

Basically you will need to do `document.getElementById()` or class or tag name and bind everything to those items. No nodejs or backend needed.

@barefootstache I like to check if there's a library to do all this, before i spend time writing all the code myself. 😉

@amapanda checkout turfjs. It's not perfect, but contains most of what uou need. It speaks geojson though, so you'll have yo convert your gpx

Sign in to participate in the conversation
En OSM Town | Mapstodon for OpenStreetMap

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!