ThinkGeo.com    |     Documentation    |     Premium Support

Side location conflict

Hello.
We are have problem.

We create mouse click event.

private void MergeSelectedFeature(LayerOverlay targetLayer, string targetFeatureKey, System.Collections.ObjectModel.Collection mergeFeatures, BaseShape baseShape)
{
FeatureLayer tmpFeatureLayer = (FeatureLayer)targetLayer.Layers[targetFeatureKey];
tmpFeatureLayer.Open();

        System.Collections.ObjectModel.Collection<Feature> tmpFeatures = new System.Collections.ObjectModel.Collection<Feature>();
        tmpFeatures = ***tmpFeatureLayer.QueryTools.GetFeaturesIntersecting(baseShape, new string[1] { "Selected Chart" });***
        tmpFeatureLayer.Close();

        foreach (Feature f in tmpFeatures)
        {
            mergeFeatures.Add(f);
        }
    }

This code response error at “***side location conflict [ (-180, 48.36167, NaN) ]***”.
We find forum for this error code.
Finally we are find CanMakeValid Api.

        Feature f = new Feature(catalogPolygon);
        
        if (f.CanMakeValid)
        {
            f = f.MakeValid();
        }

But, We are polygon position always CanMakeValid false.

We have polygon position.

MULTIPOLYGON(((180 56, -171.46165 56, -171.46165 48.36167, -180 48.36167, 170.33335 48.36167, 170.33335 56, 180 56)), ((170.33333 48.36167, 170.33333 56, 180 56, 180 48.36167, 170.33333 48.36167)), ((-180 48.36167, -180 56, -171.46167 56, -171.46167 48.36167, -180 48.36167)))

Please check this problem.
Bast regards.

Hi Binary,

Side location conflict is reported by the 3rd part dll NTS.

It caused by many invalid shapes, for example self-intersection, invalid multipolygonshape, invalid inner ring etc.

I think you should want to find the invalid feature and get its WKT, then render it standalone to see what’s the detail problem.

And our make valid cannot solved all invalid exception for shape, so if your data cannot get valid, you should want to handle that by your custom code.

Regards,

Don