Пример #1
0
            internal virtual Pair <PointValue, PointValue> BoundingBoxOf(double minLon, double maxLon, double minLat, double maxLat, PointValue center, double distance)
            {
                CoordinateReferenceSystem crs = center.CoordinateReferenceSystem;
                int dimension = center.CoordinateReferenceSystem.Dimension;

                double[] min = new double[dimension];
                double[] max = new double[dimension];
                min[0] = minLon;
                min[1] = minLat;
                max[0] = maxLon;
                max[1] = maxLat;
                if (dimension > 2)
                {
                    double[] coordinates = center.Coordinate();
                    for (int i = 2; i < dimension; i++)
                    {
                        min[i] = coordinates[i] - distance;
                        max[i] = coordinates[i] + distance;
                    }
                }
                return(Pair.of(Values.PointValue(crs, min), Values.PointValue(crs, max)));
            }