Examples of ReferencedEnvelope


Examples of org.geotools.geometry.jts.ReferencedEnvelope

        try {
            int scaleFactor = WMTRenderJob.getScaleFactor();
           
            // we also need the map-scale to calculate the recommended zoom-level       
            double mapScale = layer.getMap().getViewportModel().getScaleDenominator();
            ReferencedEnvelope mapExtentMapCrs = layer.getMap().getViewportModel().getBounds();
           
            WMTScaleZoomLevelMatcher zoomLevelMatcher = WMTScaleZoomLevelMatcher.createMatcher(
                    mapExtentMapCrs, mapScale, wmtSource);
           
            return wmtSource.getZoomLevelFromMapScale(zoomLevelMatcher, scaleFactor);
View Full Code Here

Examples of org.geotools.geometry.jts.ReferencedEnvelope

    //endregion
   
    //region Methods to zoom in/out
    private synchronized WMTScaleZoomLevelMatcher getZoomLevelMatcher(WMTSource wmtSource) throws Exception {
        double mapScale = currentMap.getViewportModel().getScaleDenominator();
        ReferencedEnvelope mapExtentMapCrs = currentMap.getViewportModel().getBounds();
       
        return WMTScaleZoomLevelMatcher.createMatcher(
                mapExtentMapCrs, mapScale, wmtSource);
    }
View Full Code Here

Examples of org.geotools.geometry.jts.ReferencedEnvelope

     *
     * @param tileName
     * @return BoundingBox for a tile
     */
    public static ReferencedEnvelope getExtentFromTileName(OSMTileName tileName) {
        ReferencedEnvelope extent = new ReferencedEnvelope(
                tile2lon(tileName.getX(), tileName.zoomLevel.getZoomLevel()),
                tile2lon(tileName.getX() + 1, tileName.zoomLevel.getZoomLevel()),
                tile2lat(tileName.getY(), tileName.zoomLevel.getZoomLevel()),
                tile2lat(tileName.getY() + 1, tileName.zoomLevel.getZoomLevel()),
                DefaultGeographicCRS.WGS84);
View Full Code Here

Examples of org.geotools.geometry.jts.ReferencedEnvelope

    
     * @param tileName
     * @return BoundingBox for a tile
     */
    public static ReferencedEnvelope getExtentFromTileName(NASATileName tileName) {
        ReferencedEnvelope extent = new ReferencedEnvelope(
                tile2lon(tileName.getX(), tileName),
                tile2lon(tileName.getX() + 1, tileName),
                tile2lat(tileName.getY(), tileName),
                tile2lat(tileName.getY() + 1, tileName),
                DefaultGeographicCRS.WGS84);
View Full Code Here

Examples of org.geotools.geometry.jts.ReferencedEnvelope

    return null;
  }

  @Override
  public Geometry getGeometry() {
    ReferencedEnvelope extent = this.getExtent();
    if (extent != null) {
      return new GeometryFactory().toGeometry(extent);
    }
    return null;
  }
View Full Code Here

Examples of org.geotools.geometry.jts.ReferencedEnvelope

                    }
                }
            } catch (FactoryException e1) {
                // could not find a match
            }
      ReferencedEnvelope extent = null;

          Envelope envelope = CRS.getEnvelope(worldCRS);
      if( envelope instanceof BoundingBox){
          extent = ReferencedEnvelope.reference( (BoundingBox) envelope);
          if( extent.getCoordinateReferenceSystem() != worldCRS ){
              // CRS.getEnvelope(worldCRS) is inconsistent as it returned an envelope in a different CRS
              return null; // give up!
          }
      }
            if (extent == null || extent.isEmpty() || extent.isNull()) {
        // fall back to WGS84 bounds and transform to world CRS
                GeographicBoundingBox worldBounds = CRS.getGeographicBoundingBox(worldCRS);
                if( worldBounds != null ){
                    ReferencedEnvelope testGeo = new ReferencedEnvelope(worldBounds.getWestBoundLongitude(), worldBounds.getEastBoundLongitude(), worldBounds.getNorthBoundLatitude(), worldBounds.getSouthBoundLatitude(), DefaultGeographicCRS.WGS84);
                    try {
                        extent = testGeo.transform(worldCRS,  true );
                    } catch (TransformException e) {
                        extent = null; // off the map!
                    } catch (FactoryException e) {
                        extent = null; // off the map!
                    }
View Full Code Here

Examples of org.geotools.geometry.jts.ReferencedEnvelope

    return null;
    }

  @Override
  public Geometry getGeometry() {
    ReferencedEnvelope extent = this.getExtent();
    if (extent != null) {
      return new GeometryFactory().toGeometry(extent);
    }
    return null;
  }
View Full Code Here

Examples of org.geotools.geometry.jts.ReferencedEnvelope

       
        return request.toString();
    }

    private void addBboxString(StringBuilder request, WWTileName tileName) {
        ReferencedEnvelope bounds = WWTile.getExtentFromTileName(tileName);
       
        request.append("&bbox="); //$NON-NLS-1$
        request.append(parseDouble(bounds.getMinX()));
        request.append(',');
        request.append(parseDouble(bounds.getMinY()));
        request.append(',');
        request.append(parseDouble(bounds.getMaxX()));
        request.append(',');
        request.append(parseDouble(bounds.getMaxY()));   
    }
View Full Code Here

Examples of org.geotools.geometry.jts.ReferencedEnvelope

       
        setZoomLevels();
    }
   
    private void setZoomLevels() {
        ReferencedEnvelope bounds = quadTileSet.getBounds();
       
        zoomLevels = new ArrayList<WWZoomLevel>(numberLevels);
        scales = new double[numberLevels];
       
        double tileSizeDegrees = levelZeroTileSizeDegrees;
View Full Code Here

Examples of org.geotools.geometry.jts.ReferencedEnvelope

            tileSizeDegrees /= 2.0;
        }
    }
   
    private ReferencedEnvelope getBoundOfFirstTile(double tileSizeDegrees, ReferencedEnvelope bounds) {       
        return new ReferencedEnvelope(
                bounds.getMinX(),
                bounds.getMinX() + tileSizeDegrees,
                bounds.getMinY(),
                bounds.getMinY() + tileSizeDegrees,
                DefaultGeographicCRS.WGS84
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.