Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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);
        }
Example #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;
            }
        }
Example #6
0
 public bool ImportLayer(IFeatureSet featureSet, string layerName, string creationOptions = "",
                         ValidationMode validationMode = ValidationMode.TryFixSkipOnFailure)
 {
     return(_datasource.ImportShapefile(featureSet.GetInternal(), layerName, creationOptions, (tkShapeValidationMode)validationMode));
 }
Example #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));
 }
Example #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);
        }
Example #9
0
        public IFeatureSet ShapeToShapeZ(IFeatureSet shapefile, IGridSource grid)
        {
            var sf = _utils.ShapeToShapeZ(shapefile.GetInternal(), grid.GetInternal());

            return(sf != null ? new FeatureSet(sf) : null);
        }
Example #10
0
 public bool ExportSelection(IFeatureSet fs, string outputFilename, bool overwrite)
 {
     return(_utils.ExportSelection(fs.GetInternal(), outputFilename, overwrite));
 }
Example #11
0
 public bool RemoveColinearPoints(IFeatureSet feature, double linearTolerance)
 {
     return(_utils.RemoveColinearPoints(feature.GetInternal(), linearTolerance));
 }
Example #12
0
 public bool ExplodeShapes(IFeatureSet fs, bool selectedOnly, string outputFilename, bool overwrite)
 {
     return(_utils.ExplodeShapes(fs.GetInternal(), selectedOnly, outputFilename, overwrite));
 }
Example #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));
 }
Example #14
0
 public bool GridStatisticsToShapefile(IGridSource grid, IFeatureSet sf, bool selectedOnly, bool overwriteFields)
 {
     return(_utils.GridStatisticsToShapefile(grid.GetInternal(), sf.GetInternal(), selectedOnly, overwriteFields));
 }
Example #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);
        }
Example #16
0
        public bool Validate(IFeatureSet featureSet)
        {
            var sf = featureSet.GetInternal();

            return(_operations.Validate(sf));
        }