I need to draw a maximum inscribed circle in a polygon. I found a library - https://github.com/PieceMaker/max-inscribed-circle - after little of googling. I have to do something wrong as my interpretation returns wrong result ( the circle should be more on right and radius looks strange to me ):
var coords = [
[49.0138, 15],
[49.0138, 15.0167],
[49.0153, 15.0167]
];
var polygon = {
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [coords]
},
"properties": {
"id": 1
}
};
console.log(maxInscribedCircle(polygon, 7));
returns
{
geometry: {
coordinates: [49.0143, 15.011133333333333],
type: "Point"
},
properties: {
radius: 0.0004823742421792941,
units: "degrees"
}
}
I tried to switch [lat, lon] order, but I get same results.
The question Largest circle inside a non-convex polygon doesn't solve this issue as it describes different algorithm - it doesn't use https://github.com/PieceMaker/max-inscribed-circle library.
Any idea, why position is wrong? How to properly interpret radius - how can "degrees" be length units?