﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
17388	[WIP PATCH] gpx_distance() is slow when there are many gpx points	taylor.smock	team	"I added a bunch of gpx tracks to josm, and then ran a validator.

The total distance covered was in excess of 400 km (so probably about 13,000 gpx points and around 180,000 primitives for around 2,340,000,000 operations per `gpx_distance()` call) and it was a conglomeration of several different tracks.

I'm thinking that a possible solution would be to make bounding boxes for the gpx tracks and iterate through them to find the closest bounding box (probably find the bounding boxes that overlap with the closest bounding box) and iterate through the bounding boxes.

The reason it is slow is due to an n^2^ algorithm (for each osm primitive, we have to loop through the gpx tracks at least once).

Workaround: Reduce the number of osmprimitives/gpx points that are loaded at any one time.

I probably should have tested something like this, but I didn't think to do so."	enhancement	new	normal		Core			mapcss	
