コード例 #1
0
 public static int InteriorIntersectionCount(IGeometry geom)
 {
     InteriorIntersectionFinder intCounter = InteriorIntersectionFinder.CreateIntersectionCounter(new RobustLineIntersector());
     INoder noder = new MCIndexNoder(intCounter);
     noder.ComputeNodes(SegmentStringUtil.ExtractNodedSegmentStrings(geom));
     return intCounter.Count;
 }
コード例 #2
0
        /// <summary>
        /// Node the input segment strings once
        /// and create the split edges between the nodes.
        /// </summary>
        /// <param name="segStrings"></param>
        /// <param name="numInteriorIntersections"></param>
        private void Node(IList <ISegmentString> segStrings, int[] numInteriorIntersections)
        {
            var si    = new IntersectionAdder(_li);
            var noder = new MCIndexNoder(si);

            noder.ComputeNodes(segStrings);
            _nodedSegStrings            = noder.GetNodedSubstrings();
            numInteriorIntersections[0] = si.NumInteriorIntersections;
        }
コード例 #3
0
        public static IGeometry MCIndexNodingWithPrecision(Geometry geom, double scaleFactor)
        {
            List<ISegmentString> segs = CreateNodedSegmentStrings(geom);

            LineIntersector li = new RobustLineIntersector();
            li.PrecisionModel = new PrecisionModel(scaleFactor);
            INoder noder = new MCIndexNoder(new IntersectionAdder(li));
            noder.ComputeNodes(segs);
            IList<ISegmentString> nodedSegStrings = noder.GetNodedSubstrings();
            return FromSegmentStrings(nodedSegStrings);
        }
コード例 #4
0
        private void CheckInteriorIntersections()
        {
            /*
             * MD - It may even be reliable to simply check whether
             * end segments (of SegmentStrings) have an interior intersection,
             * since noding should have split any true interior intersections already.
             */
            _isValid = true;
            _segInt  = new InteriorIntersectionFinder(_li);
            _segInt.FindAllIntersections = FindAllIntersections;
            MCIndexNoder noder = new MCIndexNoder(_segInt);

            noder.ComputeNodes(_segStrings); //.ComputeNodes(segStrings);
            if (_segInt.HasIntersection)
            {
                _isValid = false;
                return;
            }
        }
コード例 #5
0
 /// <summary>
 /// Node the input segment strings once
 /// and create the split edges between the nodes.
 /// </summary>
 /// <param name="segStrings"></param>
 /// <param name="numInteriorIntersections"></param>
 private void Node(IList<ISegmentString> segStrings, int[] numInteriorIntersections)
 {
     var si = new IntersectionAdder(_li);
     var noder = new MCIndexNoder(si);            
     noder.ComputeNodes(segStrings);
     _nodedSegStrings = noder.GetNodedSubstrings();
     numInteriorIntersections[0] = si.NumInteriorIntersections;            
 }
コード例 #6
0
 private void CheckInteriorIntersections()
 {
     /*
      * MD - It may even be reliable to simply check whether
      * end segments (of SegmentStrings) have an interior intersection,
      * since noding should have split any true interior intersections already.
      */
     _isValid = true;
     _segInt = new InteriorIntersectionFinder(_li);
     _segInt.FindAllIntersections = FindAllIntersections;
     MCIndexNoder noder = new MCIndexNoder(_segInt);
     noder.ComputeNodes(_segStrings); //.ComputeNodes(segStrings);
     if (_segInt.HasIntersection)
     {
         _isValid = false;
         return;
     }
 }
コード例 #7
0
 public static IGeometry MCIndexNoding(IGeometry geom)
 {
     INoder noder = new MCIndexNoder(new IntersectionAdder(new RobustLineIntersector()));
     noder.ComputeNodes(SegmentStringUtil.ExtractNodedSegmentStrings(geom));
     return SegmentStringUtil.ToGeometry(noder.GetNodedSubstrings(), geom.Factory);
 }
コード例 #8
0
        public static IGeometry MCIndexNodingWithPrecision(IGeometry geom, double scaleFactor)
        {
            IPrecisionModel fixedPM = new PrecisionModel(scaleFactor);

            LineIntersector li = new RobustLineIntersector();
            li.PrecisionModel = fixedPM;

            INoder noder = new MCIndexNoder(new IntersectionAdder(li));
            noder.ComputeNodes(SegmentStringUtil.ExtractNodedSegmentStrings(geom));
            return SegmentStringUtil.ToGeometry(noder.GetNodedSubstrings(), geom.Factory);
        }
コード例 #9
0
 public static IGeometry MCIndexNoding(Geometry geom)
 {
     IList<ISegmentString> segs = CreateNodedSegmentStrings(geom);
     INoder noder = new MCIndexNoder(new IntersectionAdder(new RobustLineIntersector()));
     noder.ComputeNodes(segs);
     IList<ISegmentString> nodedSegStrings = noder.GetNodedSubstrings();
     return FromSegmentStrings(nodedSegStrings);
 }