public Clip(IGeometryItem feature, IClipContext clipContext) { var min = feature.MinGeometry.X; var max = feature.MaxGeometry.X; // clip would be trivial accept the feature // if (min >= clipContext.K1 && max <= clipContext.K2) { ClippedFeature = feature; return; } else if (min > clipContext.K2 || max < clipContext.K1) { return; } // This is a rare occurrance // if (feature.Type == GeometryType.Point) { //ClippedFeature = ClipPoints(feature, clipContext.K1, clipContext.K2, clipContext.Axis); } else // Covers all the other types // { } }
public void ClipPoints(IGeometryItem feature, double k1, double k2) { var slice = new List <(double X, double Y, double Z)>(); for (int i = 0; i < feature.Geometry.Length; i++) { var a = feature.Geometry[i][0]; if (a.X >= k1 && a.X <= k2) { } } }
public List <(double X, double Y, double Z)> ClipPoints(IGeometryItem feature, double k1, double k2, Axis axis) { var slice = new List <(double X, double Y, double Z)>(); for (int i = 0; i < feature.Geometry.Length; i++) { var a = feature.Geometry[i][0]; var aK = axis == Axis.X ? a.X : a.Y; if (aK >= k1 && aK <= k2) { slice.Add(a); } } return(slice); }
internal void AddFeature(ITile tile, IGeometryItem geometryFeature, double tileTolerance, bool shouldSimplify) { var simplified = new List <(double X, double Y, double Z)[]>();
public GeoJSONIterativeContext(GeoJSON.Net.Feature.Feature originalFeature, IGeometryItem feature, double buffer) { this.OriginalFeature = originalFeature; this.Feature = feature; this.Buffer = buffer; }