Package org.opengis.geometry

Examples of org.opengis.geometry.BoundingBox


    private BoundingBox getBoundedBy(Feature feature, Configuration configuration) {
        // check for flag not to include bounds
        if (configuration.hasProperty(GMLConfiguration.NO_FEATURE_BOUNDS)) {
            return null;
        } else {
            BoundingBox bounds = feature.getBounds();
            // do a check for the case where the feature has no geometry properties
            if (bounds.isEmpty()
                    && (feature.getDefaultGeometryProperty() == null || feature
                            .getDefaultGeometryProperty().getValue() == null)) {
                return null;
            } else {
                return bounds;
View Full Code Here


            imageChoice).append(" with subsampling factors ")
            .append(baseReadParameters.getSourceXSubsampling()).append(" ")
            .append(baseReadParameters.getSourceYSubsampling()).toString());     
     
     
      final BoundingBox cropBBOX = request.getCropBBox();
      if (cropBBOX != null)
        bbox = ReferencedEnvelope.reference(cropBBOX);
      else
        bbox = new ReferencedEnvelope(coverageEnvelope);
     
View Full Code Here

     * mosaic produced by this response.
     *
     */
    private void initBBOX() {
        // ok we got something to return, let's load records from the index
        final BoundingBox cropBBOX = request.spatialRequestHelper.getComputedBBox();
        if (cropBBOX != null){
            mosaicBBox = ReferencedEnvelope.reference(cropBBOX);
        }else{
            mosaicBBox = new ReferencedEnvelope(coverageEnvelope);
        }
View Full Code Here

    }
  }
 
  protected void addToSpatialIndex(SimpleFeature f) {
    if (f.getDefaultGeometry() != null) {
      BoundingBox bounds = f.getBounds();
      if( !bounds.isEmpty() )
        spatialIndex.insert(ReferencedEnvelope.reference(bounds), f);
    }
  }
View Full Code Here

     }
    
    @Override
    public boolean add(SimpleFeature f) {
          //maintain the bounds
          BoundingBox boundingBox = f.getBounds();
          if (bounds == null){
              bounds = new ReferencedEnvelope(
                      boundingBox.getMinX(), boundingBox.getMaxX(),
                      boundingBox.getMinY(), boundingBox.getMaxY(),
                      schema.getCoordinateReferenceSystem());
          } else {
              bounds.expandToInclude(boundingBox.getMinX(), boundingBox.getMinY());  
              bounds.expandToInclude(boundingBox.getMaxX(), boundingBox.getMaxY());  
          }
          return list.add(f);
    }
View Full Code Here

    public ReferencedEnvelope getBounds() {
        if (bounds == null) {
            bounds = new ReferencedEnvelope();

            for (Iterator i = contents.values().iterator(); i.hasNext();) {
                BoundingBox geomBounds = ((SimpleFeature) i.next()).getBounds();
                // IanS - as of 1.3, JTS expandToInclude ignores "null" Envelope
                // and simply adds the new bounds...
                // This check ensures this behavior does not occur.
                if ( ! geomBounds.isEmpty() ) {
                    bounds.include(geomBounds);
                }
            }
        }
        return bounds;
View Full Code Here

        ReferencedEnvelope bounds = null;
        FeatureIterator<F> it = features();
        try {
            while( it.hasNext() ){
                Feature feature = it.next();
                BoundingBox bbox = feature.getBounds();
                if( bbox != null ){
                    if( bounds == null ){
                        bounds = new ReferencedEnvelope( bbox );
                    }
                    else {
View Full Code Here

        ReferencedEnvelope re = null;
        try {
            fi = features();
            while (fi.hasNext()) {
                SimpleFeature f = fi.next();
                BoundingBox bb = f.getBounds();
                if (bb != null) {
                    ReferencedEnvelope ref = ReferencedEnvelope.reference(bb);
                    if (re == null) {
                        re = ref;
                    } else {
View Full Code Here

            SimpleFeatureIterator fi = null;
            try {
                fi = source.getFeatures(query).features();
                while (fi.hasNext()) {
                    SimpleFeature f = fi.next();
                    BoundingBox bb = f.getBounds();
                    if (bb != null) {
                        ReferencedEnvelope ref = ReferencedEnvelope.reference(bb);
                        if (re == null) {
                            re = ref;
                        } else {
View Full Code Here

   */
  public List<BoundingBox> getHorizontalDomain(boolean global,
      ProgressListener listener) throws IOException {
    ensureNotDisposed();
    Info info = getInfo( listener );
    BoundingBox bbox = info.getBounds();
    return Collections.singletonList( bbox);
  }
View Full Code Here

TOP

Related Classes of org.opengis.geometry.BoundingBox

Copyright © 2018 www.massapicom. 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.