Opened 9 years ago

Last modified 9 years ago

#13361 closed enhancement

[Patch] What is the bbox of an incomplete OSM primitive? — at Version 2

Reported by: GerdP Owned by: team
Priority: normal Milestone: 16.12
Component: Core Version:
Keywords: Cc: bastiK, simon04, michael2402

Description (last modified by Don-vip)

I stumbled over this while analysing performance problems in the QuadBuckets.search(BBox searchBbox) method.

I noticed that incomplete primitives have quite confusing bboxes:
1) an incomplete node has
xmin = xmax = ymin = ymax = 0;
2) an incomplete way has

xmin = Double.POSITIVE_INFINITY
xmax = Double.NEGATIVE_INFINITY
ymin = Double.POSITIVE_INFINITY
ymax = Double.NEGATIVE_INFINITY

if all nodes are incomplete, else it will be the bbox of the complete node(s).
3) a relation with eg. just two node members where one is complete at (10,40) and the other is incomplete will span a huge area from

xmin = 0
xmax = 40
ymin = 0
ymax = 10

I would expect that the bbox of a relation is only calculated using the complete nodes.

I'd also prefer when the bbox of incomplete nodes would not be located at (0,0), but I assume that there are good reasons for this.

Change History (3)

by GerdP, 9 years ago

Attachment: 13361_v1.patch added

comment:1 by GerdP, 9 years ago

Summary: What is the bbox of an incomplete OSM primitive?[Patch] What is the bbox of an incomplete OSM primitive?

Attached patch 13361_v1.patch will fix the bbox calculation for relations.
It should speed up rendering when you have downloaded an area and zoom in
as fewer relations are selected.

comment:2 by Don-vip, 9 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.