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
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.