SteveC | 22 May 20:15 2005

who?

who changed the background colour(s) to white, and why?

have fun,

SteveC steve <at> fractalus.com http://www.fractalus.com/steve/
SteveC | 22 May 20:44 2005

Re: who?

*  <at>  22/05/05 07:15:08 PM steve <at> fractalus.com wrote:
> who changed the background colour(s) to white, and why?

this sounded pissed off, but I'm not at all.

to elaborate - I think I stole, sorry, infringed the copyright of the
background colour from google maps or streetmap. or something, simply
because it looked nice.

Ideas on colours?

have fun,

SteveC steve <at> fractalus.com http://www.fractalus.com/steve/
SteveC | 22 May 21:38 2005

quick updates

you can now view the subversion archives using a whizzy html interface
here:

http://www.openstreetmap.org/WebSVN/

I've linked to it on the wiki.

I've got rid of the old 'getStreets' function and its database table.

Been asked a few times so I've started a little page on the concepts
behind getting data from the interface here:

http://www.openstreetmap.org/newwiki/index.php/GettingData

to explain getting nodes, then streets etc. Input welcome, of course.

have fun,

SteveC steve <at> fractalus.com http://www.fractalus.com/steve/
SteveC | 23 May 15:27 2005

drawing algorihtms

I've had to look at google maps a bit lately

looking closely at

http://maps.google.co.uk/maps?q=aberdeen+place+london&spn=0.015167,0.034171&hl=en

for example, I think it'd be possible to recreate that by starting with
a black background. dra your lines by iterating a pixel at a time down
the line drawing a filled white circle at each pixel. hence the rounded
edges in goole maps.

now you have a load of black islands. fill those with that white brown
colour and the black pixels which touch a white pixel the darker brown.
i think its approximately that simple, though there are details with the
white -> darkbrown -> lightbrown boundaries. the black/white colouring
is just to make it a clear description...

ideas?

have fun,

SteveC steve <at> fractalus.com http://www.fractalus.com/steve/
Rob . | 23 May 17:02 2005
Picon

Re: drawing algorihtms

>From an SVG perspective your algorithm is a bit too low-level. SVG has
primatives like: line, polyline, circle, path (supports beizer
curves). These can be styled using attributes like: stoke-width,
stroke-color, stroke-linecap, fill-color, etc.

Streets all one color, with no outline color, could be done in SVG as
a 'round join, as shown here:
http://zvon.org/xxl/svgReference/Output/exd0e19960.html

No exit streets can be done as 'round' cap lines:
http://zvon.org/xxl/svgReference/Output/exd0e19896.html

On Saturday, for outlined streets, Nick and I were looking at an
approach line this:
1) set background to that light brown color
2) draw thick white lines along the street vectors
3) draw separate dark brown outlines at the edge of the thick white
lines; when lines intersect:
   a) use the angle of intersection to calculate the appropriate place
to stop the dark brown outlines on side where intersection angle is
less than 180 degrees.
   b) if there is an intersection angle greater than 180 degrees then
calculate the start and end points of the arc needed to draw the
rounded edge outline.

I believe Nick has coded the algorithm to do the caculation for step 3(a).

Other drawing ideas welcome. :-)

Rob
(Continue reading)

Ben Gimpert | 23 May 17:40 2005

Re: who?

My bad, but umm -- that puke orange color was awful as the background 
of my desktop image. For now I hope we'll keep everything as basic 
shades of black/gray/white, and eventually ask someone with a good eye 
for this sort of thing to decide on a color scheme.

	Ben

On 22 May 2005, at 19:44, SteveC wrote:

> *  <at>  22/05/05 07:15:08 PM steve <at> fractalus.com wrote:
>> who changed the background colour(s) to white, and why?
>
> this sounded pissed off, but I'm not at all.
>
> to elaborate - I think I stole, sorry, infringed the copyright of the
> background colour from google maps or streetmap. or something, simply
> because it looked nice.
>
> Ideas on colours?
>
> have fun,
SteveC | 23 May 17:38 2005

Re: drawing algorihtms

so something like

looking at the attached png:

6 lines represented by letters

b and e are street segments connected by the node represented by the
circle, of radius r. distance between adjacent lines is r also., hence
they are parallel and glance the circle.

the b - e intersection Ill call p

angle b-p-e is the angle between lines, get that by dot product of p-b
and p-e. call that angle t for theta.

point g is where b crosses the circle. transform the circle to the
origin. make point g the complex coordinate r*exp(i t), where r=radius,
t = theta.

multiply complex g by exp[i Pi] rotates it 90 degrees left which gets
the point where a glances the circle. multiply by exp[i -Pi] to get
where c glances. do the same for the other end of the node to get a and
c in the first place if you want.

do the same for d and f.

now you just need where d crosses c which is a line intersection test,
so you have your arc and all the points to draw in brown

now make it an algorithm where you can add an arbitrary number of lines,
(Continue reading)

SteveC | 23 May 17:39 2005

Re: drawing algorihtms

and this time I'll actually attach the png

*  <at>  23/05/05 04:38:23 PM steve <at> fractalus.com wrote:
> so something like
> 
> looking at the attached png:
> 
> 6 lines represented by letters
> 
> b and e are street segments connected by the node represented by the
> circle, of radius r. distance between adjacent lines is r also., hence
> they are parallel and glance the circle.
> 
> the b - e intersection Ill call p
> 
> angle b-p-e is the angle between lines, get that by dot product of p-b
> and p-e. call that angle t for theta.
> 
> point g is where b crosses the circle. transform the circle to the
> origin. make point g the complex coordinate r*exp(i t), where r=radius,
> t = theta.
> 
> multiply complex g by exp[i Pi] rotates it 90 degrees left which gets
> the point where a glances the circle. multiply by exp[i -Pi] to get
> where c glances. do the same for the other end of the node to get a and
> c in the first place if you want.
> 
> do the same for d and f.
> 
> now you just need where d crosses c which is a line intersection test,
(Continue reading)

Matt Amos | 23 May 22:54 2005
Picon

Re: drawing algorihtms

On Monday 23 May 2005 16:39, SteveC wrote:
> and this time I'll actually attach the png

this is cool.

i've been looking at the problem in a different way... (without loss 
of generality etc...) considering regions as closed polygons:

initial.png: shows the "initial" state - just lines downloaded from 
OSM.

step1.png: inset the lines by x+y pixels where x is the road width, y 
is the "outer" line width.

step2.png: start with a black background and fill the inset polygons, 
make the road lines have round joins and caps (stroked in white), as 
Rob was saying.

step 3.png: add text on the road lines.

now, the maximum complexity is the same as steve was saying, but in 
general, with closed non-overlapping polygons, you only have to 
consider the left and right lines of the polygon at each vertex...

cya,

matt
(Continue reading)

Tom Carden | 24 May 02:12 2005
Picon

Re: drawing algorihtms

(Apologies to Matt who got two copies of this).

Here's a demo in Processing which shows how to do it without inventing 
our own clever line stroking algorithms.

http://www.tom-carden.co.uk/p5/osm_lines/applet/

Click to add nodes.  Click and drag to join nodes.  Space to clear. 
Apologies for lack of interface feedback, but I'm sure you get the idea.

It draws thick black strokes with rounded caps, then thinner white 
strokes with rounded caps.  Viola! Outlined roads, without computing 
stacks of intersections.

Java2d can definitely do this (Processing uses Java2d behind the scenes).

Since I emailed Matt, I realised that this would need some tweaking if 
it was to work for bridges etc.  Still, it's a start.

Cheers,

Tom.

Matt Amos wrote:
> On Monday 23 May 2005 16:39, SteveC wrote:
> 
>>and this time I'll actually attach the png
> 
> 
> this is cool.
(Continue reading)


Gmane