+ Reply to Thread
Results 1 to 3 of 3

Thread: C# sample with IGeometryServer2.cut

  1. #1
    Guillaume MOCCAND
    Join Date
    Dec 2010
    Posts
    12
    Points
    0
    Answers Provided
    0


    0

    Default C# sample with IGeometryServer2.cut

    Dear all,

    Does anyone has a sample code in C# for IGeometryServer2.cut(...) ?

    Thanks in advance.

    Guillaume

  2. #2
    Sebastian Krings
    Join Date
    Feb 2011
    Posts
    195
    Points
    6
    Answers Provided
    4


    0

    Default Re: C# sample with IGeometryServer2.cut

    I am also interested in it.

  3. #3
    John Hauck
    Join Date
    Oct 2009
    Posts
    196
    Points
    31
    Answers Provided
    3


    1

    Default Re: C# sample with IGeometryServer2.cut

    What part of this is tripping things up from your tests? Here is a simple example that I hope will help get the ball rolling:

    Code:
    object beforeAfter = Type.Missing;
    
    ISpatialReference sr = CreateHighPrecisionSpatialReference(4326,false,false);
    
    IPointCollection pc = new PolylineClass();
    pc.AddPoint(new PointClass() { X = 0, Y = 0, SpatialReference = sr }, beforeAfter, beforeAfter);
    pc.AddPoint(new PointClass() { X = 10, Y = 10, SpatialReference = sr }, beforeAfter, beforeAfter);
    IPolyline polyline1 = (IPolyline)pc;
    
    IPointCollection pc2 = new PolylineClass();
    pc2.AddPoint(new PointClass() { X = -5, Y = 5, SpatialReference = sr }, beforeAfter, beforeAfter);
    pc2.AddPoint(new PointClass() { X = 5, Y = 5, SpatialReference = sr }, beforeAfter, beforeAfter);
    IPolyline polyline2 = (IPolyline)pc2;
    
    if (((ITopologicalOperator)pc).IsSimple)
    {
        ILongArray la;
    
        IGeometryArray targetArray = new GeometryArrayClass();
        targetArray.Add(polyline1);
    
        IGeometryServer2 geomServer = new GeometryServerClass();
        IGeometryArray outGeomArray = geomServer.Cut(sr, targetArray, polyline2, out la);
    }

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts