It is interesting, reading into this topic of calculating length of the centerline ," Voronoi " method calculation comes up a lot.
Excited about your solution to this .
Hi ,
Any update or hope that this will be available anytime soon?
Otherwise we will have to look for other means to solve this issue of ours.
Best Regards
Mehmet
Yes, we have updates, we released feature âMakeVoronoiGraphâ in our GeoTools. So, now we can build âVoronoiâ diagram for collection of points.
Next step is calculate centerline length. We are going to release this in march.
Please check out our âMakeVoronoiGraphâ feature. I hope it will be useful for you.
Fantastic news about the âMakeVoronoiGraphâ feature in GeoTools!
Excited to explore its potential. Looking forward to the centerline length calculation release in March.
Hi @Alexander.Matveev ,
Could you provide more details or documentation on how to use this new feature?
I couldnât find any release notes and it seems I have missed some releases ? image.png (15.9 KB)
Apply âVoronoiâ polygon to find lines equidistant from points. On start we have collection of points, using method we get collection of edges voronoi diagram.
Please use map.Render to see results.
These code examples for you:
List<Point> sites = new List<Point>();
sites.Add(new Point(100, 100));
sites.Add(new Point(200, 200));
sites.Add(new Point(200, 100));
sites.Add(new Point(100, 200));
var edges = Gis.GeoTools.GeometryOperations.MakeVoronoiGraph(sites);
var map = ProduceVoronoiMap(edges, sites);
map.Render(MakePath("square") + ".map.png", Renderers.Png);
private Map ProduceVoronoiMap(List<LineString> edges, List<Point> sites, int mapSize = 300, int startExtent = 0)
{
// sites layer
var sitesLayer = Drivers.InMemory.CreateLayer();
foreach (var site in sites)
{
Feature feature = sitesLayer.ConstructFeature();
feature.Geometry = site;
sitesLayer.Add(feature);
}
// edges layer
var edgesLayer = Drivers.InMemory.CreateLayer();
foreach (var edge in edges)
{
Feature feature = edgesLayer.ConstructFeature();
feature.Geometry = edge;
edgesLayer.Add(feature);
}
var map = new Map(mapSize - startExtent, mapSize - startExtent);
map.Extent = new Extent(startExtent, startExtent, mapSize, mapSize);
map.BackgroundColor = Color.Beige;
map.Padding = 0;
map.Add(sitesLayer, new MixedGeometrySymbolizer()
{
PolygonSymbolizer = new SimpleFill() { FillColor = Color.Transparent, StrokeColor = Color.DimGray },
});
map.Add(edgesLayer, new MixedGeometrySymbolizer()
{
LineSymbolizer = new SimpleLine() { Width = 2, Color = Color.Green }
});
return map;
}
Hi, @mcanavar
We made upgrade and released new functions âBuildCenterlineâ and âGetCenterlineLengthâ in our GeoTools! To build centerline you need set polygon or collection of points.
Please check it out and let me know if you need something
Thank you for the update!
It would be beneficial to have release notes or documentation containing some samples or examples demonstrating how to utilize this new feature.
At this point, I cannot find any documentation to get started with.
Could you please provide a link if itâs available?
Hi, @mcanavar
Unfortunately there is no article yet. It will be prepare in a couple of days.
These simple code examples:
// for right triangle
List sites = new List
{
new Point(100, 100),
new Point(200, 200),
new Point(200, 100)
};
var length = Gis.GeoTools.GeometryOperations.GetCenterlineLength(sites);
or
//need to set input polygon
var length = Gis.GeoTools.GeometryOperations.GetCenterlineLength(polygon);
I have updated to the latest version of Aspose.GIS, version 24.3.0, using NuGet. However, I am encountering conflicts in the existing codebase. For example:
*The âColorTranslatorâ class exists in both âAspose.GISâ and âSystem.Drawingâ.
*âNewtonsoft.Json.Formattingâ exists in both âAspose.GISâ and âNewtonsoft.Jsonâ.
Using the full name or aliases does not resolve the conflicts, and I am unable to compile my existing project.
Do you have any solutions to resolve these conflicts?
Version of Newtonsoft.Json is 13.0.3
<Project Sdk="Microsoft.NET.Sdk.Web">
<TargetFramework>net7.0-windows</TargetFramework>
System.Drawing.Common : nuget version : 8.0.3