private static GeoPolygon getPointBuffer(GeoPoint point, double angleDistance, int pointsPerCircle) { if (angleDistance < 0) return new GeoPolygon(); GnomonicProjection projection = new GnomonicProjection(point.L, point.Phi); PointD planePoint = new PointD(0, 0); Polygon planePolygon = (Polygon)planePoint.Buffer(Math.Tan(angleDistance), pointsPerCircle, false); GeometryCollection geometryColllection = new GeometryCollection(); geometryColllection.Add(planePolygon); GeographyCollection gc = GeometrySpreader.GetGeographies(geometryColllection, projection); if(gc[0] is GeoPolygon) return (GeoPolygon)gc[0]; return new GeoPolygon(); }
private static GeoPolygon getPointBuffer(GeoPoint point, double angleDistance, int pointsPerCircle) { if (angleDistance < 0) { return(new GeoPolygon()); } GnomonicProjection projection = new GnomonicProjection(point.L, point.Phi); PointD planePoint = new PointD(0, 0); Polygon planePolygon = (Polygon)planePoint.Buffer(Math.Tan(angleDistance), pointsPerCircle, false); GeometryCollection geometryColllection = new GeometryCollection(); geometryColllection.Add(planePolygon); GeographyCollection gc = GeometrySpreader.GetGeographies(geometryColllection, projection); if (gc[0] is GeoPolygon) { return((GeoPolygon)gc[0]); } return(new GeoPolygon()); }