Free Support Forum - aspose.com

Geometry does not contain point


#1

I am trying to check if point is inside of a multi-polygon. Multi-polygon is defined as in the attachment angola.zip (20.0 KB)

Point is defined as POINT(17.536985 -12.292315)

var geo = Geometry.FromText(@"[Here is multipolygon definition]");
var geo2 = Geometry.FromText("POINT (17.536985 -12.292315)");
var test = geo.SpatiallyContains(geo2);

test is false, although point is definitely within the multi-polygon. What am I doing wrong?

I am using Aspose.GIS NuGet package for .Net Core version 19.2.0


#2

@mrusaev,

Thanks for your query.

You have mentioned that this point is definitely within the multi-polygon. Could you please share some way to confirm this without using Aspose.GIS? It will help us to compare the result with Aspose.GIS and provide our feedback.


#3

@mrusaev,

Thank you for contacting Aspose Support.

We were able to reproduce the issue reported by you. We have logged a ticket in our issue tracking system as GISNET-298 to investigate the issue further. We will update you here as soon as additional information is available.


#4

@ahsaniqbalsidiqui
You could use WKT playground here to review provided data: https://clydedacruz.github.io/openstreetmap-wkt-playground/


#5

@muhammadahmad

Following code does not work as well:

var geo = Geometry.FromText(@"[Here is multipolygon definition]");
var point = (geo as MultiPolygon).GetPointOnSurface();
var test = geo.SpatiallyContains(point); // returns false

#6

@mrusaev,

Thank you for sharing additional details.

We tested the code that you shared and observed that Geometry.SpatiallyContains method returned false for the Point returned by GetPointOnSurface as well. We have logged these details in the ticket GISNET-298 for further investigation. We will update you here as soon as we have some updates regarding the issue resolution.