Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uMap Freezes when editing big >2mb OSRM-GPX traces #1966

Open
skyrl69 opened this issue Jul 2, 2024 · 4 comments
Open

uMap Freezes when editing big >2mb OSRM-GPX traces #1966

skyrl69 opened this issue Jul 2, 2024 · 4 comments
Labels

Comments

@skyrl69
Copy link

skyrl69 commented Jul 2, 2024

Describe the bug
This is maybe more an unresponsiveness behavior than a bug, literaly speaking :
When I try to edit an imported GPX trace >2mb, made with OSRM, uMap will freeze with CPU 100%. After ten seconds or so the browser signals that uMap is not responding, and ask to wait or reload the page. Depending on the size of the GPX trace, the page will recover responsiveness, or will lead to crash of the browser.

  • If I reload the page, all my modifications are lost. Obviously

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://umap.openstreetmap.fr/en/map/anonymous-edit/1089775:BrKRjkrNd8G6w-v0AX_7Gy5G8_7TMZhDyWFF-XikqgE (french instance of umap)
    or https://umap.openstreetmap.de/en/map/anonymous-edit/63092:Rhxx1irDhFVpNx-lNetLQo5ibufeyjHXnPuczC1s0M4 (german instance)
  2. Click Edit button on top right corner of the view
  3. Click on Import Button : It is the last button bottom-down the right edge of the screen (an upload arrow)
  4. Choose a GPX trace >2mb, computed and exported by OSRM tool (https://map.project-osrm.org/)
  5. The trace is quickly added to a new layer, and shown in uMap
  6. Zoom and click on that trace (left mouse button) : two small context buttons will show, a pencil and a trashbin
  7. Click on edit context button (the pencil) : Instantly the page is freezing

Expected behavior
Either :

  • Allow to edit the trace in matter of seconds
  • Says it will take too long to make the trace editable
  • Forbid point editing since the trace's too complex for edition
  • Offers a way to stop entering in edition mode
  • At least not freezing, or at least a way to recover unsaved data...

Desktop : Win10 x64 Brave 1.67.123 Chromium 126 x64

Screenshots of normal behavior
🆗 1) 56 nodes 2489bytes GPX
image

🆗 2) 1716 nodes, 62kb GPX trace from Namur to Liege
image

Screenshots of enhancable behavior

⚠3) 29878 nodes, 1.05mb GPX trace from Paris to Berlin
Took 70sec CPU 100% to compute ! Thread reached 1.7gb in memory heap. After that, Chrome is keeping is responsiveness
image

❌4) 59869 nodes, 2.00mb GPX trace from Paris to Riga, Moscow, Venise

Took 11 minutes to process, thread reached 3.5gb in memory heap
After what, UI is stalling, not responsive, objects are not shown correctly, and nothing can be done anymore until the tab is closed

a) image
b) image
c) image
d) image
ProcessExplorer :
image

Desktop : Win10 x64 Firefox 113 x64

❌4) Same but on Firefox (59869 nodes, 2.00mb GPX trace)

Took 16 minutes to process, thread reached 3go in memory heap
After what, Firefox is a little more responsive than Chromium, but it takes always two to five minutes for any action

a) image
b) image
c) image
d) image
ProcessExplorer :
image

Additional context
You'll find the GPX traces in example here in a zip file :
bug umap GPX.zip

@skyrl69 skyrl69 added the bug label Jul 2, 2024
@skyrl69 skyrl69 changed the title Editing imported OSRM traces make uMap freeze uMap Freezes when editing big >2mb OSRM-GPX traces Jul 2, 2024
@davidbgk
Copy link
Contributor

davidbgk commented Jul 4, 2024

Trying to display (and edit!) 30k+ nodes on a potentially moving map in a browser is probably a bad idea and even if it works for your configuration it might not be on another user's setup 🤷

@skyrl69
Copy link
Author

skyrl69 commented Jul 4, 2024

Trying to display (and edit!) 30k+ nodes on a potentially moving map in a browser is probably a bad idea and even if it works for your configuration it might not be on another user's setup 🤷

Thanks for your input,

You're right but yet, Google Maps is doing it perfectly fine ^^
And I think the examples I brought are classic holidays / road trip itinaries...

This is in the nature of route trace to generate a lot of nodes. The 30k+ nodes is only generated with a 2 points route : Paris to Berlin. But there's a lot of turnarounds in ~1000km distance.

But right, uMap is no Gmaps : Not handling 30k+ nodes is a thing I can understand. But freezing and crashing is another matter, don't you think ?

As a workaround, I found the idea to disable interaction for the whole layer. But neverless, one cannot edit those traces, even to change their properties, since editing the trace goes to crash. The only workaround to change aspect of the trace is to set the default settings for the layer encapsulating the trace...

Regards

@davidbgk
Copy link
Contributor

davidbgk commented Jul 4, 2024

There are a lot of tools to simplify tracks, for instance https://opengeo.tech/gpx-simplify-optimizer/

@yohanboniface
Copy link
Member

A few ideas:

  • differentiate editing the geometry and editing the properties
  • do not display that much nodes at this zoom level (no sure what kind of algo could be used here), as it's simply useless (even if the browser could handle the points, there is no way to edit a path with that much nodes close one to each other)
  • split the line in multilines (if it's not yet the case), and only edit one geometry line at a time
  • use canvas for vertex as low zoom levels
  • do not show nodes outside of bbox (so one may zoom in and then edit)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants