# [OSM-talk] Maximum segment length?

Scott Walde scott at waldetech.ca
Thu Mar 22 03:16:58 GMT 2007

```Lars Aronsson wrote:
> Scott Walde wrote:
>
>> But, this causes me to ask the question... how long can a
>> segment be?  Around here, highways can go on in a straight line
>> for many, many kilometers.  (One problem stretch was about
>> 50km.)
>>
>
> This is related to the use of Bezier curves and map projections.
> When you have a line segment, you say node A and B should be
> connected.  But how?  If the two nodes are at the same latitude,
> should the connecting road run at a constant latitude?

Yes. :-)  (I do see the ambiguity, though.)
> That means
> it will look straight on a Mercator projector map, but on the real
> Earth surface it will be a long, smooth curve (unless that
> latitude is the Equator).

Exactly.  That's how our east/west roads are built here.  Our
north/south try to follow longitudes, but require correction lines every
so often.  Of course, if I were mapping all the grid roads, we wouldn't
be having this conversation, as I'd have a node every 1.6km.  (1 mile)
(A huge area of my province is covered by a grid of roads spaced on 1
mile centers.)
>   For reasonably short segments (say 500
> metres), the difference will be far smaller than the GPS accuracy
> (5 metres), so it doesn't matter to us.  But how much off can the
> middle of a 50 km segment be?

None, as explained above.
> Do you even know how to compute
> that?

If you mean, how much off a shortest distance connection would be from a
"follow the latitude" connection, I'm sure I could have a few years
back, but it's not the type of thing I do daily, so it would probably
take me a while.  Basically, it's just calculating the arcs made by
intersecting two planes through a sphere.
>   Or should you stick to shorter segments?
>

Not for this reason.  To keep the renderers happy, I'm happy to keep my
segments shorter.  It would be handy, however, to have a function in
JOSM that would automagically break a long segment into a series of
appropriately short segments.  It would be simpler, and cleaner than
manually eyeballing adding nodes to a long segment, or alternatively,
trying to build a 50km straight line piece by piece.
> We once (April 2006) had (and maybe we still have?) somebody (Jörg
> Osterman) who checked the weekly dump for long segments (there
> were plenty in Russia), so that we could go in and add nodes to
> make segments shorter

That's too bad, really.  Long segments are efficient.  The problem,
really, is that we're trying to render small parts of the map -- and
that the software seems to be built by people who live in countries
smaller than my 50km segment.  ;-)

ttyl
srw

```