# Create a "rounded corner rectangle" polyline/polygon

• ### Question

• Hello guys,

I'd like to create a polygon/polyline with a curve in it. Just like a rectangle with rounded corners, for example.

This is of course basically a mathematical issue; but I don't know how to do that anyways. Perfect would be an algorithm with a "start point" and and "end point" and maybe even a target angle that defines the curve (Standard rectangle would be 90°, but it would be awesome to be also able to define a 70° angle etc...)

Do you have any sources or ideas how to achieve this?

Thanks and best regards,

Monday, September 3, 2012 8:18 AM

What I would suggest doing is converting the coordinates of your polygon to pixel coordinates on the map using the tryLocationToPixel method this way you are working with basic 2D data. Then run the algorithm to calculate the rounded corners. Then convert the pixel coordinates back to spatial coordinates using tryPixelToLocation.

http://rbrundritt.wordpress.com

Monday, September 3, 2012 9:50 AM

### All replies

What I would suggest doing is converting the coordinates of your polygon to pixel coordinates on the map using the tryLocationToPixel method this way you are working with basic 2D data. Then run the algorithm to calculate the rounded corners. Then convert the pixel coordinates back to spatial coordinates using tryPixelToLocation.

http://rbrundritt.wordpress.com

Monday, September 3, 2012 9:50 AM
• a huge thanks for your quick reply, I will evaluate this soonish :)
Thanks a lot and,

best regards from Stuttgart!