Get Centerline length of (multi)polygon (collection)

In the meantime: question :
How to go from “pollygon” , “multipolygon”, to : sites input for the method MakeVoronoiGraph?

      var edges = Gis.GeoTools.GeometryOperations.MakeVoronoiGraph(sites);
      var map = ProduceVoronoiMap(edges, sites);
      map.Render(MakePath("square") + ".map.png", Renderers.Png);

Hi, @mcanavar
please use this code:

var sites = new List<IPoint>(polygon.ExteriorRing);
if (polygon.InteriorRingsCount > 0)
   	for (int i = 0; i < polygon.InteriorRingsCount; ++i)
       	var ring = polygon.GetInteriorRing(i);
       	if (ring.IsEmpty)

Hi @mcanavar
I guess in this case better use method “BuildCenterline” (which is based on Voronoi Diagram)! Here as result we get collection of edges voronoi diagram restricted by input polygon.

1 Like

Hi @Alexander.Matveev

Could you please provide some information on this issue? Currently, I am unable to deploy my application with the latest version. The only functional version is “23.12.0”. Any newer NuGet packages encounter issues with the System.Drawing and Newtonsoft.Json libraries utilized within Aspose.Gis. However, reverting back to “23.12.0” deprives me of the long-awaited methods for obtaining the centerline length and the VoronoiGraph. It would be greatly appreciated if I could be informed whether a solution is forthcoming or if there are any steps I can take within my application to resolve this compatibility issue.

Thank you.

Hello! Thank you for reaching out and sharing the challenges you’ve encountered with deploying your application using the latest NuGet packages. We understand the importance of accessing the enhanced features while maintaining compatibility with essential libraries like System.Drawing and Newtonsoft.Json within Aspose.Gis. Our team is actively investigating the compatibility issues you’ve highlighted. Rest assured, we are committed to resolving these concerns to ensure a seamless deployment experience for you. We will keep you updated on our progress and provide guidance as soon as we have more information or a resolution. Your patience and understanding during this process are greatly appreciated.

1 Like

Dear @mcanavar ,
I hope this message finds you well. I wanted to reach out to inform you that we have successfully resolved the issue you reported, and a new release containing the fix is now available.

Your feedback was invaluable in helping us identify and address the issue promptly. We greatly appreciate your patience and understanding throughout this process.

Please feel free to update to the latest release version 24.4.1 to ensure that you have the most up-to-date and stable experience with our product.

If you encounter any further issues or have additional feedback, please don’t hesitate to reach out to us. We are committed to continuously improving our product and ensuring your satisfaction.

Thank you once again for bringing this matter to our attention, and we look forward to serving you better in the future.

Hi @alexander.glushchenko ,

Thank you for the prompt update and for resolving the reported issue.

I will review this update quickly and let you know if everything went well

Hello! We will be very grateful for your feedback on this issue!

Hi @mcanavar

This is link to article about “Voronoi Polygons” methods in GeoTools

Hi @Alexander.Matveev ,
The link is not working for me, you have to have a account to read this link.

Hi @alexander.glushchenko ,

I have been able to compile my code without having to make any changes with this new version.
I can now proceed with utilizing the new features for calculating the centerline, I hope it works as expected and usable for the users.

Thank you very much for your swift action in resolving this issue.