ThinkGeo.com    |     Documentation    |     Premium Support

TopologyException on GetFeaturesContaining

Hi Team, we have a polygon geometry. Sometimes when calling featureLayer.QueryTools.GetFeaturesContaining we get following exception:

NetTopologySuite.Geometries.TopologyException: ‘side location conflict [ (640100.1610000003, 5359061.3981) ]’

- $exception {“side location conflict [ (640100.1610000003, 5359061.3981) ]”} NetTopologySuite.Geometries.TopologyException
+ Coordinate {(640100.1610000003, 5359061.3981)} NetTopologySuite.Geometries.Coordinate
NetTopologySuite.dll!NetTopologySuite.GeometriesGraph.EdgeEndStar.PropagateSideLabels(int geomIndex)	Unknown
NetTopologySuite.dll!NetTopologySuite.GeometriesGraph.EdgeEndStar.ComputeLabelling(NetTopologySuite.GeometriesGraph.GeometryGraph[] geomGraph)	Unknown
NetTopologySuite.dll!NetTopologySuite.Operation.Relate.RelateComputer.LabelNodeEdges()	Unknown
NetTopologySuite.dll!NetTopologySuite.Operation.Relate.RelateComputer.ComputeIM()	Unknown
NetTopologySuite.dll!NetTopologySuite.Geometries.Geometry.Contains(NetTopologySuite.Geometries.Geometry g)	Unknown
ThinkGeo.Core.dll!ThinkGeo.Core.BaseShape.ContainsCore(ThinkGeo.Core.BaseShape targetShape)	Unknown
ThinkGeo.Core.dll!ThinkGeo.Core.FeatureSource.eR8=(ThinkGeo.Core.BaseShape targetShape, System.Collections.Generic.IEnumerable<string> returningColumnNames)	Unknown
ThinkGeo.Core.dll!ThinkGeo.Core.FeatureSource.SpatialQueryCore(ThinkGeo.Core.BaseShape targetShape, ThinkGeo.Core.QueryType queryType, System.Collections.Generic.IEnumerable<string> returningColumnNames)	Unknown
ThinkGeo.Core.dll!ThinkGeo.Core.FeatureSource.SpatialQuery(ThinkGeo.Core.BaseShape targetShape, ThinkGeo.Core.QueryType queryType, System.Collections.Generic.IEnumerable<string> returningColumnNames)	Unknown
ThinkGeo.Core.dll!ThinkGeo.Core.FeatureSource.SpatialQuery(ThinkGeo.Core.BaseShape targetShape, ThinkGeo.Core.QueryType queryType, ThinkGeo.Core.ReturningColumnsType returningColumnNamesType)	Unknown
ThinkGeo.Core.dll!ThinkGeo.Core.QueryTools.GetFeaturesContaining(ThinkGeo.Core.BaseShape targetShape, ThinkGeo.Core.ReturningColumnsType returningColumnNamesType)	Unknown

Agk.Viewer.Presentation.dll!Agk.Viewer.Presentation.ViewerFeatureQueryHelper.QueryNearestFeatureAtLocation(ThinkGeo.Core.FeatureLayer featureLayer, ThinkGeo.Core.PointShape queryLocation, int featureHitTestToleranceInMeters) Line 21 C#

Any help would be appreciated. If you need anything else, let me know.

Thanks
J

Just letting you know that I exported the same geometry to a shapefile, and it works.
The same geometry also works as a SQL Feature Layer.
The issue for me happens in a FileGeoDatabaseFeatureLayer .

Hi, Julian

Since it works with ShapeFileFeatureLayer and SqlServerFeatureLayer but only fails with FileGeoDatabaseFeatureLayer , this looks like a bug where polygon rings weren’t correctly handled (inner vs outer).

We’ve fixed it in ThinkGeo.FileGeoDatabase 14.5.0-beta133 — please grab the latest and give it another try.

If it’s still happening, could you send us your test data at support@thinkgeo.com? We’ll dig into it.

Thanks,
Ben

Hi Ben, I still get the same issue. Here is an image of the shape:

I suspect that the issue is that the feature has an x connection. The small square on top and the larger one below it belong together. Selecting the small top rectangle will select the feature. Clicking on the bottom one will throw that exception.

Does that already help narrowing down the issue? You should be able to just reproduce it with this in a FileGeoDatabase. Again, for some reason this only is thrown in this file format, not any other one.

Thanks
J

Your image tells a lot. We found the issue and fixed it in ThinkGeo.FileGeoDatabase 14.5.0-beta135, pull the latest and have a try.

Thanks Ben, I’ll make sure to include that next time, I only noticed that behaviour yesterday which is why I added the picture.

Ill test it tomorrow! Good work (:
J

Hi Ben, it works perfectly. The only issue I am facing is that, for whatever reason, my polygon style only partially applies on these geometries anymore (generally on every single one where it was broken before). They don’t get a background color anymore - outline works. I am going to do some digging as to why that is the case.

Thanks!

Edit - that was my bad, with those multipolygons multiple styles seem to be applied, and I only took the first one, which is why the AreaStyle wasnt applied.

Cool, also we just released v14.5 on nuget with this fix in it. Go ahead and update when you have a chance. Here is the changelog: Changelog - ThinkGeo Docs. We also released a tool for API compare if you are interested: ThinkGeo Nuget Package API Compare