예제 #1
0
        public IFeatureSet Union(bool selectedOnlySubject, IFeatureSet featureSetOverlay, bool selectedOnlyOverlay)
        {
            var sfOverlay = featureSetOverlay.GetInternal();
            var sf        = _shapefile.Union(selectedOnlySubject, sfOverlay, selectedOnlyOverlay);

            return(WrapShapefile(sf));
        }
예제 #2
0
        public IFeatureSet Merge(bool selectedOnlyThis, IFeatureSet featureSet, bool selectedOnly)
        {
            var sf     = featureSet.GetInternal();
            var result = _shapefile.Merge(selectedOnlyThis, sf, selectedOnly);

            return(WrapShapefile(result));
        }
예제 #3
0
        public IFeatureSet Intersection(bool selectedOnlyOfThis, IFeatureSet featureSet, bool selectedOnly, GeometryType geometryType)
        {
            var sf      = featureSet.GetInternal();
            var shpType = GeometryHelper.GeometryType2ShpType(geometryType);
            var result  = _shapefile.GetIntersection(selectedOnlyOfThis, sf, selectedOnly, shpType);

            return(WrapShapefile(result));
        }
예제 #4
0
        public bool SelectByShapefile(IFeatureSet featureSet, SpatialRelation relation, bool selectedOnly, out int[] result)
        {
            var    sf      = featureSet.GetInternal();
            object indices = null;

            if (_shapefile.SelectByShapefile(sf, (tkSpatialRelation)relation, selectedOnly, ref indices))
            {
                result = indices as int[];
                return(true);
            }

            result = null;
            return(false);
        }
예제 #5
0
        /// <summary>
        /// Changes selection of the feature set adding new shapes using the specified mode
        /// </summary>
        public static void UpdateSelection(this IFeatureSet fs, IEnumerable <int> indices, SelectionOperation mode)
        {
            if (fs == null || indices == null)
            {
                return;
            }

            if (mode == SelectionOperation.New)
            {
                fs.ClearSelection();
            }

            var sf = fs.GetInternal();

            switch (mode)
            {
            case SelectionOperation.New:
                foreach (var item in indices)
                {
                    sf.ShapeSelected[item] = true;
                }
                break;

            case SelectionOperation.Add:
                foreach (var item in indices)
                {
                    sf.ShapeSelected[item] = true;
                }

                break;

            case SelectionOperation.Exclude:
                foreach (var item in indices)
                {
                    sf.ShapeSelected[item] = false;
                }

                break;

            case SelectionOperation.Invert:
                foreach (var item in indices)
                {
                    sf.ShapeSelected[item] = !sf.ShapeSelected[item];
                }
                break;
            }
        }
예제 #6
0
 public bool ImportLayer(IFeatureSet featureSet, string layerName, string creationOptions = "",
                         ValidationMode validationMode = ValidationMode.TryFixSkipOnFailure)
 {
     return(_datasource.ImportShapefile(featureSet.GetInternal(), layerName, creationOptions, (tkShapeValidationMode)validationMode));
 }
예제 #7
0
 public Grid ShapefileToGrid(IFeatureSet shapefile, bool useShapefileBounds = true,
                             GridSourceHeader gridHeader = null, double cellsize = 30, bool useShapeNumber = true, short singleValue = 1)
 {
     return(_utils.ShapefileToGrid(shapefile.GetInternal(), useShapefileBounds,
                                   gridHeader.GetInternal(), cellsize, useShapeNumber, singleValue));
 }
예제 #8
0
        public IGeometry ShapeMerge(IFeatureSet featureSet, int indexOne, int indexTwo)
        {
            var shape = _utils.ShapeMerge(featureSet.GetInternal(), indexOne, indexTwo);

            return(shape != null ? new Geometry(shape) : null);
        }
예제 #9
0
        public IFeatureSet ShapeToShapeZ(IFeatureSet shapefile, IGridSource grid)
        {
            var sf = _utils.ShapeToShapeZ(shapefile.GetInternal(), grid.GetInternal());

            return(sf != null ? new FeatureSet(sf) : null);
        }
예제 #10
0
 public bool ExportSelection(IFeatureSet fs, string outputFilename, bool overwrite)
 {
     return(_utils.ExportSelection(fs.GetInternal(), outputFilename, overwrite));
 }
예제 #11
0
 public bool RemoveColinearPoints(IFeatureSet feature, double linearTolerance)
 {
     return(_utils.RemoveColinearPoints(feature.GetInternal(), linearTolerance));
 }
예제 #12
0
 public bool ExplodeShapes(IFeatureSet fs, bool selectedOnly, string outputFilename, bool overwrite)
 {
     return(_utils.ExplodeShapes(fs.GetInternal(), selectedOnly, outputFilename, overwrite));
 }
예제 #13
0
 public bool BufferByDistance(IFeatureSet fs, bool selectedOnly, double distance, int numSegments, bool mergeResults,
                              string outputFilename, bool overwrite)
 {
     return(_utils.BufferByDistance(fs.GetInternal(), distance, numSegments, selectedOnly, mergeResults,
                                    outputFilename, overwrite));
 }
예제 #14
0
 public bool GridStatisticsToShapefile(IGridSource grid, IFeatureSet sf, bool selectedOnly, bool overwriteFields)
 {
     return(_utils.GridStatisticsToShapefile(grid.GetInternal(), sf.GetInternal(), selectedOnly, overwriteFields));
 }
예제 #15
0
        public IFeatureSet ReprojectShapefile(IFeatureSet sf, ISpatialReference source, ISpatialReference target)
        {
            var result = _utils.ReprojectShapefile(sf.GetInternal(), source.GetInternal(), target.GetInternal());

            return(result != null ? new FeatureSet(result) : null);
        }
예제 #16
0
        public bool Validate(IFeatureSet featureSet)
        {
            var sf = featureSet.GetInternal();

            return(_operations.Validate(sf));
        }