예제 #1
0
        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();
        }
예제 #2
0
        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());
        }