How to calculate Polygon points from a simple string for a specific width?

I am currently developing an application that creates polygons from strings, and I am experiencing a small problem:

I have a set of points representing a line. I would like to create a polygon that displays a line with a specific width (e.g. for the street). I have some ideas on how to calculate the outside points of a polygon, but I think they are too complicated ...

My best idea was presented in the figure below: each point of the line should be projected onto at least two points: both points should be 90 ° in the next segment of the line and have a distance of half the preferred width of the polygon.

Highway rendering width problem

, . : . , . .

? , .

- ( ) ?

: openstreetmap, , Mapnik, .

+3
1

, , ( ). , , , : / (, ) .

Maperitive. , , , : enter image description here

( , ):

  • , L , .
  • . .
  • , .

:

  • , .
  • , , ( ).
  • , ( ).
+4

All Articles