Convert a JTS envelope to a Geomajas bounding box.

@param envelope JTS envelope
@return Geomajas bbox
@throws JtsConversionException conversion failed
425708
public static Bbox fromJts(Envelope envelope) throws JtsConversionException {
		if (envelope == null) {
			throw new  JtsConversionException("Cannot convert null argument");
		}
		return new Bbox(envelope.getMinX(), envelope.getMinY(), envelope.getWidth(), envelope.getHeight());
	}
149436
public Envelope lngLatToMeters(Envelope env) {
        Coordinate min = lngLatToMeters(env.getMinX(), env.getMinY());
        Coordinate max = lngLatToMeters(env.getMaxX(), env.getMaxY());
        Envelope result = new Envelope(min.x, max.x, min.y, max.y);
        return result;
    }
977483
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;
	}
134876
@Bean
	@ConditionalOnMissingBean(name = "busJsonConverter")
	@StreamMessageConverter
	public AbstractMessageConverter busJsonConverter(
			@Autowired(required = false) ObjectMapper objectMapper) {
		return new BusJacksonMessageConverter(objectMapper);
	}
310267
public Envelope getMaxExtent() {
        final int minX = 0;
        final int maxX = 1;
        final int minY = 2;
        final int maxY = 3;
        return new Envelope(this.maxExtent[minX], this.maxExtent[minY], this.maxExtent[maxX],
                            this.maxExtent[maxY]);
    }
187813
protected static GeoJSONObject readParcel(Parcel parcel) {
        String json = parcel.readString();
        try {
            return GeoJSON.parse(json);
        }
        catch (JSONException e) {
            throw new RuntimeException(e);
        }
    }
983797
public void postConstruct(GeoService geoService, DtoConverterService converterService) throws GeomajasException {
		if (null == layerInfo) {
			layerInfo = new RasterLayerInfo();
		}
		layerInfo.setCrs(TiledRasterLayerService.MERCATOR);
		crs = geoService.getCrs2(TiledRasterLayerService.MERCATOR);
		layerInfo.setTileWidth(tileSize);
		layerInfo.setTileHeight(tileSize);
		Bbox bbox = new Bbox(-TiledRasterLayerService.HALF_EQUATOR_IN_METERS,
				-TiledRasterLayerService.HALF_EQUATOR_IN_METERS, TiledRasterLayerService.EQUATOR_IN_METERS,
				TiledRasterLayerService.EQUATOR_IN_METERS);
		layerInfo.setMaxExtent(bbox);
		maxBounds = converterService.toInternal(bbox);

		resolutions = new double[maxZoomLevel + 1];
		double powerOfTwo = 1;
		for (int zoomLevel = 0; zoomLevel <= maxZoomLevel; zoomLevel++) {
			double resolution = (TiledRasterLayerService.EQUATOR_IN_METERS) / (tileSize * powerOfTwo);
			resolutions[zoomLevel] = resolution;
			powerOfTwo *= 2;
		}
	}
546188
public Envelope tileBbox(int tx, int ty, int zoomLevel) {
        Coordinate topLeft = tileTopLeft(tx, ty, zoomLevel);
        // upperLeft of tx+1,ty+1 == lowRight
        Coordinate lowerRight = tileTopLeft(tx + 1, ty + 1, zoomLevel);
        Envelope result = new Envelope(topLeft, lowerRight);
        return result;
    }
1307177
private GeometryEnvelope readEnvelope(int envelopeIndicator,
			ByteReader reader) {

		GeometryEnvelope envelope = null;

		if (envelopeIndicator > 0) {

			// Read x and y values and create envelope
			double minX = reader.readDouble();
			double maxX = reader.readDouble();
			double minY = reader.readDouble();
			double maxY = reader.readDouble();

			boolean hasZ = false;
			Double minZ = null;
			Double maxZ = null;

			boolean hasM = false;
			Double minM = null;
			Double maxM = null;

			// Read z values
			if (envelopeIndicator == 2 || envelopeIndicator == 4) {
				hasZ = true;
				minZ = reader.readDouble();
				maxZ = reader.readDouble();
			}

			// Read m values
			if (envelopeIndicator == 3 || envelopeIndicator == 4) {
				hasM = true;
				minM = reader.readDouble();
				maxM = reader.readDouble();
			}

			envelope = new GeometryEnvelope(hasZ, hasM);

			envelope.setMinX(minX);
			envelope.setMaxX(maxX);
			envelope.setMinY(minY);
			envelope.setMaxY(maxY);

			if (hasZ) {
				envelope.setMinZ(minZ);
				envelope.setMaxZ(maxZ);
			}

			if (hasM) {
				envelope.setMinM(minM);
				envelope.setMaxM(maxM);
			}
		}

		return envelope;
	}
952067
private Envelope getLayerEnvelope(ProxyLayerSupport layer) {
		Bbox bounds = layer.getLayerInfo().getMaxExtent();
		return new Envelope(bounds.getX(), bounds.getMaxX(), bounds.getY(), bounds.getMaxY());
	}
55472
public void scheduleOnce(Envelope envelope, long time) {
        if (envelope.getMailbox() != this) {
            throw new RuntimeException("envelope.mailbox != this mailbox");
        }

        envelopes.putEnvelopeOnce(envelope, time, comparator);
    }
1323899
public BBox calcBBox2D() {
        check("calcRouteBBox");
        BBox bounds = BBox.createInverse(false);
        for (int i = 0; i < pointList.getSize(); i++) {
            bounds.update(pointList.getLatitude(i), pointList.getLongitude(i));
        }
        return bounds;
    }
797164
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;
	}
170425
public void setBoundingBox(BoundingBox boundingBox, Projection projection) {
        ProjectionTransform projectionToWebMercator = projection
                .getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR);
        webMercatorBoundingBox = boundingBox
                .transform(projectionToWebMercator);
    }
1322901
public final boolean verifyEventCondition(MessageEnvelope envelope) {
		String message = safeGetQuickReplyPayload(envelope);
		return expectedPattern.matcher(message).matches();
	}
769967
JSchema box(Map context) {
    if (boxed != null)
      return boxed; // only do it once
    JSVariant subTop = new JSVariant();
    subTop.cases = cases;
    subTop.boxedBy = this;
    boxed = (JSchema)context.get(subTop);
    if (boxed == null) {
      boxed = new JSchema(subTop, context);
      for (int i = 0; i < cases.length; i++)
        cases[i].parent = subTop;
      context.put(subTop, boxed);
    }
    return boxed;
  }
45302
public BoundingBox getBoundingBox(Projection projection, String table) {

		BoundingBox boundingBox = null;

		try {
			Contents contents = queryForId(table);
			boundingBox = contents.getBoundingBox(projection);
		} catch (SQLException e) {
			throw new GeoPackageException(
					"Failed to query for contents of table: " + table, e);
		}

		return boundingBox;
	}