Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

areacenter doesn't handle two-node "areas" #998

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 2 comments
Closed

areacenter doesn't handle two-node "areas" #998

openstreetmap-trac opened this issue Jul 23, 2021 · 2 comments

Comments

@openstreetmap-trac
Copy link

Reporter: berteun[at]gmail.com
[Submitted to the original trac issue database at 12.17pm, Tuesday, 1st July 2008]

A small OSM file illustrating the problem (with only one way) is attached to this message. It is taken from: http://api.openstreetmap.org/api/0.5/map?bbox=5.31123,52.3975,5.31779,52.40068

The road is tagges as 'highway=residential', but also as 'landuse=residential', obviously, this does not make much sense, but it leads to a corrupt SVG file if rendered with: osmarender -r osm-map-features-z17.xml

Because of the landuse=residential, it will add a label. It's too hard for me to understand the XSLT trickery. Ideally maps do not contain such errors, but since humans are prone to make them, I think it would be better to change the transformation rules such that the SVG outputted is at least valid (a strict renderer such as Batik will not accept it).

@openstreetmap-trac
Copy link
Author

Author: bob[at]cakebox.net
[Added to the original trac issue at 11.09pm, Friday, 11th July 2008]

The problem here is that it will try to run the areacenter algorithm on a two-point polygon, which it won't handle (and it doesn't make sense).

The algorithm could probably be wrapped with logic to specially handle ways with 1 and 2 nodes, good luck to whoever finds the time to do it.

@openstreetmap-trac
Copy link
Author

Author: bobkare
[Added to the original trac issue at 5.38pm, Friday, 8th August 2008]

(In [9575]) The areaBBOXCenter fallback made it easy to handle 2-node areas as well (not that they make any sense). Fixes #998

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

No branches or pull requests

1 participant