1

I have to draw a circle with N meters diameter around some geolocation.

I could able to generate coordinates for vertically oriented ellipse only.

C#

using NetTopologySuite;
//
const int SRID = 4326;
var fact = new GeometryFactory(new PrecisionModel(), SRID);
var point = fact.CreatePoint(new Coordinate(lat, long));
var bufferParameters = new BufferParameters();
var poly = point.Buffer(0.0005, bufferParameters) as NetTopologySuite.Geometries.Polygon;
    
var coords = new List<BasicGeoposition>();
foreach (var cItem in poly.Coordinates)
{
    coords.Add(new BasicGeoposition() { Latitude = cItem.X, Longitude = cItem.Y });
}

Please help me to understand how to set the radius and make circle instead of an ellipse.

enter image description here

codewario
  • 19,553
  • 20
  • 90
  • 159
NoWar
  • 36,338
  • 80
  • 323
  • 498
  • I think part of the problem is that your coordinates are in a different unit system than meters. I would suggest to use an SRID with UTM zone (which has its coordinate system in meters rather than degrees). Then reproject it into 4326. Otherwise, do a rough conversion: https://stackoverflow.com/questions/58363982/nettopologysuite-distance-is-returning-odd-results-in-net-core-3 – tval Nov 29 '21 at 23:48

0 Answers0