/** * Create a projection transformation from provided projection to Web Mercator * * @param projection projection from * @return transform */ protected ProjectionTransform getProjectionToWebMercatorTransform(Projection projection) { return projection.getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR); }
/** * Create a projection transformation from WGS84 to Web Mercator * * @return transform */ protected ProjectionTransform getWgs84ToWebMercatorTransform() { return WGS_84_PROJECTION.getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR); }
/** * Create a projection transformation from the feature dao projection to Web * Mercator * * @return transform */ protected ProjectionTransform getWebMercatorTransform() { return this.featureDao.getProjection().getTransformation( ProjectionConstants.EPSG_WEB_MERCATOR); }
/** * Get the projection transform from the provided projection to the Spatial * Reference System projection * * @param projection * from projection * @return projection transform * @since 3.0.0 */ public ProjectionTransform getTransformation(Projection projection) { Projection projectionTo = getProjection(); return projection.getTransformation(projectionTo); }
/** * Get the bounding box in the feature projection from the bounding box in * the provided projection * * @param boundingBox bounding box * @param projection projection * @return feature projected bounding box */ private BoundingBox getFeatureBoundingBox(BoundingBox boundingBox, Projection projection) { ProjectionTransform projectionTransform = projection .getTransformation(featureDao.getProjection()); BoundingBox featureBoundingBox = boundingBox .transform(projectionTransform); return featureBoundingBox; }
/** * Get the bounding box in the feature projection from the bounding box in * the provided projection * * @param boundingBox * bounding box * @param projection * projection * @return feature projected bounding box */ protected BoundingBox getFeatureBoundingBox(BoundingBox boundingBox, Projection projection) { ProjectionTransform projectionTransform = projection .getTransformation(getProjection()); BoundingBox featureBoundingBox = boundingBox .transform(projectionTransform); return featureBoundingBox; }
/** * Project the provided bounding box in the declared projection to the user * DAO projection * * @param boundingBox * bounding box * @param projection * projection * @return projected bounding box * @since 3.1.0 */ public BoundingBox projectBoundingBox(BoundingBox boundingBox, Projection projection) { ProjectionTransform projectionTransform = projection .getTransformation(getProjection()); BoundingBox projectedBoundingBox = boundingBox .transform(projectionTransform); return projectedBoundingBox; }
/** * Get the Projected tile bounding box from the Google Maps API tile grid * and zoom level * * @param projection * projection * @param tileGrid * tile grid * @param zoom * zoom level * @return bounding box */ public static BoundingBox getProjectedBoundingBox(Projection projection, TileGrid tileGrid, int zoom) { BoundingBox boundingBox = getWebMercatorBoundingBox(tileGrid, zoom); if (projection != null) { ProjectionTransform transform = webMercator .getTransformation(projection); boundingBox = boundingBox.transform(transform); } return boundingBox; }
/** * Get the Projected tile bounding box from the Google Maps API tile * tileGrid and zoom level * * @param authority * projection authority * @param code * projection code * @param tileGrid * tile grid * @param zoom * zoom level * @return bounding box * @since 1.3.0 */ public static BoundingBox getProjectedBoundingBox(String authority, Long code, TileGrid tileGrid, int zoom) { BoundingBox boundingBox = getWebMercatorBoundingBox(tileGrid, zoom); if (code != null) { ProjectionTransform transform = webMercator.getTransformation( authority, code); boundingBox = boundingBox.transform(transform); } return boundingBox; }
/** * Adjust the tile matrix set and web mercator bounds for Google tile format */ private void adjustGoogleBounds() { // Set the tile matrix set bounding box to be the world BoundingBox standardWgs84Box = new BoundingBox(-ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH, ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE, ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH, ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE); ProjectionTransform wgs84ToWebMercatorTransform = ProjectionFactory.getProjection(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM) .getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR); tileGridBoundingBox = standardWgs84Box.transform(wgs84ToWebMercatorTransform); }
/** * {@inheritDoc} */ @Override public BoundingBox getBoundingBox(Projection projection) { BoundingBox boundingBox = getBoundingBox(); if (boundingBox != null && projection != null) { ProjectionTransform projectionTransform = featureDao .getProjection().getTransformation(projection); boundingBox = boundingBox.transform(projectionTransform); } return boundingBox; }
/** * {@inheritDoc} */ @Override public BoundingBox getBoundingBox(Projection projection) { BoundingBox boundingBox = getBoundingBox(); if (boundingBox != null && projection != null) { ProjectionTransform projectionTransform = featureDao .getProjection().getTransformation(projection); boundingBox = boundingBox.transform(projectionTransform); } return boundingBox; }
/** * Manually build the bounds of the feature table in the provided projection * * @param projection desired projection * @return bounding box */ public BoundingBox getBoundingBox(Projection projection) { BoundingBox boundingBox = getBoundingBox(); if (boundingBox != null && projection != null) { ProjectionTransform projectionTransform = featureDao .getProjection().getTransformation(projection); boundingBox = boundingBox.transform(projectionTransform); } return boundingBox; }
/** * Query for the feature index bounds and return in the provided projection * * @param projection desired projection * @return bounding box * @since 3.1.0 */ public BoundingBox getBoundingBox(Projection projection) { BoundingBox boundingBox = getBoundingBox(); if (boundingBox != null && projection != null) { ProjectionTransform projectionTransform = featureDao.getProjection() .getTransformation(projection); boundingBox = boundingBox.transform(projectionTransform); } return boundingBox; }
/** * Adjust the tile matrix set and web mercator bounds for Google tile format */ private void adjustGoogleBounds() { // Set the tile matrix set bounding box to be the world BoundingBox standardWgs84Box = new BoundingBox( -ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH, ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE, ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH, ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE); ProjectionTransform wgs84ToWebMercatorTransform = ProjectionFactory .getProjection(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM) .getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR); tileGridBoundingBox = standardWgs84Box .transform(wgs84ToWebMercatorTransform); }
/** * Query for the feature index bounds and return in the provided projection * * @param projection * desired projection * @return bounding box * @since 3.1.0 */ public BoundingBox getBoundingBox(Projection projection) { BoundingBox boundingBox = getBoundingBox(); if (boundingBox != null && projection != null) { ProjectionTransform projectionTransform = getProjection() .getTransformation(projection); boundingBox = boundingBox.transform(projectionTransform); } return boundingBox; }
/** * Manually build the bounds of the feature table in the provided projection * * @param projection * desired projection * @return bounding box */ public BoundingBox getBoundingBox(Projection projection) { BoundingBox boundingBox = getBoundingBox(); if (boundingBox != null && projection != null) { ProjectionTransform projectionTransform = featureDao .getProjection().getTransformation(projection); boundingBox = boundingBox.transform(projectionTransform); } return boundingBox; }
/** * Get a bounding box in the provided projection * * @param projection * desired projection * * @return bounding box * @since 3.1.0 */ public BoundingBox getBoundingBox(Projection projection) { BoundingBox boundingBox = getBoundingBox(); if (boundingBox != null && projection != null) { ProjectionTransform transform = getProjection().getTransformation( projection); if (!transform.isSameProjection()) { boundingBox = boundingBox.transform(transform); } } return boundingBox; }
/** * Get a bounding box in the provided projection * * @param projection * desired projection * * @return bounding box * @since 3.1.0 */ public BoundingBox getBoundingBox(Projection projection) { BoundingBox boundingBox = getBoundingBox(); if (projection != null) { ProjectionTransform transform = getProjection().getTransformation( projection); if (!transform.isSameProjection()) { boundingBox = boundingBox.transform(transform); } } return boundingBox; }
/** * Get the tile grid for the location specified as the projection * * @param point * point * @param zoom * zoom level * @param projection * projection * @return tile grid * @since 1.1.0 */ public static TileGrid getTileGrid(Point point, int zoom, Projection projection) { ProjectionTransform toWebMercator = projection .getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR); Point webMercatorPoint = toWebMercator.transform(point); BoundingBox boundingBox = new BoundingBox(webMercatorPoint.getX(), webMercatorPoint.getY(), webMercatorPoint.getX(), webMercatorPoint.getY()); return getTileGrid(boundingBox, zoom); }