Monday, 4 June 2018

How to create a Polygon around a Linestring as a GeoFence in C# .NET


I'm looking for a .net library that will help to create a polygon that I can use as a Geo-fence around a route on a map.


The following image demonstrates the result I'm after. Imagine that this polygon was projected from a line string that defined a route on a map.




I've not done any GIS mapping work before, so I'm really quite lost even as where or what to look for.


UPDATE


Ok, I've had a quick look and seem to have something working. The code to generate a polygon as a buffer around the linestring is pretty simple.


var line = new LineString(points);
var bufferOp = new BufferOp(line);
var buffer = (Polygon)bufferOp.GetResultGeometry(.00001);

But what confuses me now is the distance parameter to GetResultGeomotry. In the above code I'm specifying .00001 as the distance.. this is the only way I could get a reasonable result.


What unit of measure is that?





No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...