Select to view content in your preferred language

Trouble with ProGuide Editing tool

506
1
Jump to solution
10-12-2017 09:18 AM
KE
by
Regular Contributor

I'm new to Visual Studio, C#, and the Pro SDK. I'm trying to go through the guides to learn but I am having trouble with the ProGuide Editing tool (ProGuide Editing tool · Esri/arcgis-pro-sdk Wiki · GitHub ). I am getting this error: 

Visual Studio seems to indicate the cut line is in State Plane, as is the polygon layer I am trying to cut.

Am I missing something?

I did deviate from the guide a little bit here because I couldn't get Search to work with two parameters (geometry and SpatialRelationship.Crosses):

0 Kudos
1 Solution

Accepted Solutions
KE
by
Regular Contributor

I see if you download the code for Sketch Tool Demo (arcgis-pro-sdk-community-samples/Editing/SketchToolDemo at master · Esri/arcgis-pro-sdk-community-sa... ) they take some additional steps to make sure geometry is in the correct projection.

                while (rowCursor.MoveNext())
                {
                    var feature = rowCursor.Current as Feature;
                    var geomTest = feature.GetShape();
                    if (geomTest != null)
                    {
                        // make sure we have the same projection for geomProjected and geomTest
                        var geomProjected = GeometryEngine.Instance.Project(geometry, geomTest.SpatialReference);
                        //we are looking for polygons that are completely intersected by cut line
                        if (GeometryEngine.Instance.Relate(geomProjected, geomTest, "TT*F*****"))
                            {
                            //add the current feature to the overall list of features to cut
                            cutOIDs.Add(rowCursor.Current.GetObjectID());

                            // adjust the attribute before the cut
                            if (descriptionIndex != -1)
                                cutOperation.Modify(rowCursor.Current, descriptionIndex, "ProSample");
                        }
                    }
                }

View solution in original post

0 Kudos
1 Reply
KE
by
Regular Contributor

I see if you download the code for Sketch Tool Demo (arcgis-pro-sdk-community-samples/Editing/SketchToolDemo at master · Esri/arcgis-pro-sdk-community-sa... ) they take some additional steps to make sure geometry is in the correct projection.

                while (rowCursor.MoveNext())
                {
                    var feature = rowCursor.Current as Feature;
                    var geomTest = feature.GetShape();
                    if (geomTest != null)
                    {
                        // make sure we have the same projection for geomProjected and geomTest
                        var geomProjected = GeometryEngine.Instance.Project(geometry, geomTest.SpatialReference);
                        //we are looking for polygons that are completely intersected by cut line
                        if (GeometryEngine.Instance.Relate(geomProjected, geomTest, "TT*F*****"))
                            {
                            //add the current feature to the overall list of features to cut
                            cutOIDs.Add(rowCursor.Current.GetObjectID());

                            // adjust the attribute before the cut
                            if (descriptionIndex != -1)
                                cutOperation.Modify(rowCursor.Current, descriptionIndex, "ProSample");
                        }
                    }
                }
0 Kudos