本文整理匯總了Java中com.vividsolutions.jts.geom.Envelope.getMaxX方法的典型用法代碼示例。如果您正苦於以下問題:Java Envelope.getMaxX方法的具體用法?Java Envelope.getMaxX怎麽用?Java Envelope.getMaxX使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vividsolutions.jts.geom.Envelope
的用法示例。
在下文中一共展示了Envelope.getMaxX方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: applySearchBoundary
import com.vividsolutions.jts.geom.Envelope; //導入方法依賴的package包/類
private String applySearchBoundary(String reqParams, SearchBoundary searchBoundary)
{
if (searchBoundary != null)
{
if (searchBoundary instanceof RectSearchBoundary)
{
RectSearchBoundary rsb = (RectSearchBoundary)searchBoundary;
Envelope env = rsb.getRectangle();
reqParams += "&boundary.rect.min_lat=" + env.getMinY() + "&boundary.rect.min_lon=" + env.getMinX() + "&boundary.rect.max_lat=" + env.getMaxY() + "&boundary.rect.max_lon=" + env.getMaxX();
}
else if (searchBoundary instanceof CircleSearchBoundary)
{
CircleSearchBoundary csb = (CircleSearchBoundary)searchBoundary;
reqParams += "&boundary.circle.lat=" + csb.getLatitude() + "&boundary.circle.lon=" + csb.getLongitude() + "&boundary.circle.radius=" + csb.getRadius();
}
}
return reqParams;
}
示例2: createFrame
import com.vividsolutions.jts.geom.Envelope; //導入方法依賴的package包/類
private void createFrame(Envelope env) {
double deltaX = env.getWidth();
double deltaY = env.getHeight();
double offset = 0.0;
if (deltaX > deltaY) {
offset = deltaX * 10.0;
} else {
offset = deltaY * 10.0;
}
this.frameVertex[0] = new Vertex((env.getMaxX() + env.getMinX()) / 2.0, env
.getMaxY()
+ offset);
this.frameVertex[1] = new Vertex(env.getMinX() - offset, env.getMinY() - offset);
this.frameVertex[2] = new Vertex(env.getMaxX() + offset, env.getMinY() - offset);
this.frameEnv = new Envelope(this.frameVertex[0].getCoordinate(), this.frameVertex[1]
.getCoordinate());
this.frameEnv.expandToInclude(this.frameVertex[2].getCoordinate());
}
示例3: getSubnodeIndex
import com.vividsolutions.jts.geom.Envelope; //導入方法依賴的package包/類
/**
* Gets the index of the subquad that wholly contains the given envelope.
* If none does, returns -1.
*
* @return the index of the subquad that wholly contains the given envelope
* or -1 if no subquad wholly contains the envelope
*/
public static int getSubnodeIndex(Envelope env, double centrex, double centrey) {
int subnodeIndex = -1;
if (env.getMinX() >= centrex) {
if (env.getMinY() >= centrey) {
subnodeIndex = 3;
}
if (env.getMaxY() <= centrey) {
subnodeIndex = 1;
}
}
if (env.getMaxX() <= centrex) {
if (env.getMinY() >= centrey) {
subnodeIndex = 2;
}
if (env.getMaxY() <= centrey) {
subnodeIndex = 0;
}
}
return subnodeIndex;
}
示例4: ensureExtent
import com.vividsolutions.jts.geom.Envelope; //導入方法依賴的package包/類
/**
* Ensure that the envelope for the inserted item has non-zero extents.
* Use the current minExtent to pad the envelope, if necessary
*/
public static Envelope ensureExtent(Envelope itemEnv, double minExtent) {
//The names "ensureExtent" and "minExtent" are misleading -- sounds like
//this method ensures that the extents are greater than minExtent.
//Perhaps we should rename them to "ensurePositiveExtent" and "defaultExtent".
//[Jon Aquino]
double minx = itemEnv.getMinX();
double maxx = itemEnv.getMaxX();
double miny = itemEnv.getMinY();
double maxy = itemEnv.getMaxY();
// has a non-zero extent
if (minx != maxx && miny != maxy) {
return itemEnv;
}
// pad one or both extents
if (minx == maxx) {
minx = minx - minExtent / 2.0;
maxx = minx + minExtent / 2.0;
}
if (miny == maxy) {
miny = miny - minExtent / 2.0;
maxy = miny + minExtent / 2.0;
}
return new Envelope(minx, maxx, miny, maxy);
}
示例5: postSeedRequest
import com.vividsolutions.jts.geom.Envelope; //導入方法依賴的package包/類
private void postSeedRequest(Envelope envelope) {
String gwcurl = gwcBaseUrl + "seed/" + layername + ".json";
Bounds bounds = new Bounds(new Coordinates(envelope.getMinX(), envelope.getMinY(), envelope.getMaxX(),
envelope.getMaxY()));
Srs srs = new Srs(epsgCode);
SeedRequest request = new SeedRequest(layername, bounds, srs, zoomStart, zoomStop, imageFormat, operation,
numThreads);
HttpEntity<GwcSeedDAO> httpentity = new HttpEntity<GwcSeedDAO>(new GwcSeedDAO(request), createHeaders(
gwcUserName, gwcPassword));
ResponseEntity response = template.exchange(gwcurl, HttpMethod.POST, httpentity, String.class);
HttpStatus returncode = response.getStatusCode();
if (!returncode.is2xxSuccessful()) {
log.warn("HTTP Call to " + gwcurl + " was not successfull, Status code: " + response.getStatusCode());
}
else {
log.debug("HTTP Call to "+ gwcurl + "succeeded");
}
}
示例6: createRectangleWithSideLengthInMeters
import com.vividsolutions.jts.geom.Envelope; //導入方法依賴的package包/類
public static Polygon createRectangleWithSideLengthInMeters(Point p, double sideLengthMeters) {
Envelope env = createEnvelopeInMeters(p, sideLengthMeters);
Coordinate[] coords = new Coordinate[5];
coords[0] = new Coordinate(env.getMinX(), env.getMinY());
coords[1] = new Coordinate(env.getMinX(), env.getMaxY());
coords[2] = new Coordinate(env.getMaxX(), env.getMaxY());
coords[3] = new Coordinate(env.getMaxX(), env.getMinY());
coords[4] = new Coordinate(env.getMinX(), env.getMinY());
return gm.createPolygon(coords);
}
示例7: buildBboxFilter
import com.vividsolutions.jts.geom.Envelope; //導入方法依賴的package包/類
private String buildBboxFilter(Envelope bbox)
{
String polygon = "'POLYGON((" + bbox.getMinX() + " " + bbox.getMinY() + "," +
bbox.getMinX() + " " + bbox.getMaxY() + "," +
bbox.getMaxX() + " " + bbox.getMaxY() + "," +
bbox.getMinY() + " " + bbox.getMaxY() + "," +
bbox.getMinX() + " " + bbox.getMinY() +"))'";
return "GEOGRAPHY_INTERSECTS(" + polygon + "," + _geomColumn + ")";
}
示例8: getKey
import com.vividsolutions.jts.geom.Envelope; //導入方法依賴的package包/類
private SpatialKey getKey(SearchRow row) {
if (row == null) {
return null;
}
Value v = row.getValue(columnIds[0]);
if (v == ValueNull.INSTANCE) {
return null;
}
Geometry g = ((ValueGeometry) v.convertTo(Value.GEOMETRY)).getGeometryNoCopy();
Envelope env = g.getEnvelopeInternal();
return new SpatialKey(row.getKey(),
(float) env.getMinX(), (float) env.getMaxX(),
(float) env.getMinY(), (float) env.getMaxY());
}
示例9: visit
import com.vividsolutions.jts.geom.Envelope; //導入方法依賴的package包/類
@Override
protected void visit(Geometry element) {
Envelope elementEnv = element.getEnvelopeInternal();
// disjoint => no intersection
if (!this.rectEnv.intersects(elementEnv)) {
return;
}
// rectangle contains target env => must intersect
if (this.rectEnv.contains(elementEnv)) {
this.intersects = true;
return;
}
/**
* Since the envelopes intersect and the test element is connected, if the
* test envelope is completely bisected by an edge of the rectangle the
* element and the rectangle must touch (This is basically an application of
* the Jordan Curve Theorem). The alternative situation is that the test
* envelope is "on a corner" of the rectangle envelope, i.e. is not
* completely bisected. In this case it is not possible to make a conclusion
* about the presence of an intersection.
*/
if (elementEnv.getMinX() >= this.rectEnv.getMinX()
&& elementEnv.getMaxX() <= this.rectEnv.getMaxX()) {
this.intersects = true;
return;
}
if (elementEnv.getMinY() >= this.rectEnv.getMinY()
&& elementEnv.getMaxY() <= this.rectEnv.getMaxY()) {
this.intersects = true;
}
}
示例10: buildIndex
import com.vividsolutions.jts.geom.Envelope; //導入方法依賴的package包/類
private void buildIndex() {
this.sweepLine = new SweepLineIndex();
for (Object ring1 : rings) {
LinearRing ring = (LinearRing) ring1;
Envelope env = ring.getEnvelopeInternal();
SweepLineInterval sweepInt = new SweepLineInterval(env.getMinX(), env.getMaxX(), ring);
this.sweepLine.add(sweepInt);
}
}
示例11: RectangleLineIntersector
import com.vividsolutions.jts.geom.Envelope; //導入方法依賴的package包/類
/**
* Creates a new intersector for the given query rectangle,
* specified as an {@link Envelope}.
*
* @param rectEnv the query rectangle, specified as an Envelope
*/
public RectangleLineIntersector(Envelope rectEnv) {
this.rectEnv = rectEnv;
/**
* Up and Down are the diagonal orientations
* relative to the Left side of the rectangle.
* Index 0 is the left side, 1 is the right side.
*/
this.diagUp0 = new Coordinate(rectEnv.getMinX(), rectEnv.getMinY());
this.diagUp1 = new Coordinate(rectEnv.getMaxX(), rectEnv.getMaxY());
this.diagDown0 = new Coordinate(rectEnv.getMinX(), rectEnv.getMaxY());
this.diagDown1 = new Coordinate(rectEnv.getMaxX(), rectEnv.getMinY());
}
示例12: queryNode
import com.vividsolutions.jts.geom.Envelope; //導入方法依賴的package包/類
private void queryNode(KdNode currentNode, KdNode bottomNode,
Envelope queryEnv, boolean odd, List result) {
if (currentNode == bottomNode) {
return;
}
double min;
double max;
double discriminant;
if (odd) {
min = queryEnv.getMinX();
max = queryEnv.getMaxX();
discriminant = currentNode.getX();
} else {
min = queryEnv.getMinY();
max = queryEnv.getMaxY();
discriminant = currentNode.getY();
}
boolean searchLeft = min < discriminant;
boolean searchRight = discriminant <= max;
if (searchLeft) {
this.queryNode(currentNode.getLeft(), bottomNode, queryEnv, !odd, result);
}
if (queryEnv.contains(currentNode.getCoordinate())) {
result.add(currentNode);
}
if (searchRight) {
this.queryNode(currentNode.getRight(), bottomNode, queryEnv, !odd, result);
}
}
示例13: Node
import com.vividsolutions.jts.geom.Envelope; //導入方法依賴的package包/類
public Node(Envelope env, int level) {
//this.parent = parent;
this.env = env;
this.level = level;
this.centrex = (env.getMinX() + env.getMaxX()) / 2;
this.centrey = (env.getMinY() + env.getMaxY()) / 2;
}
示例14: PredicateEvaluatorRectangle
import com.vividsolutions.jts.geom.Envelope; //導入方法依賴的package包/類
public PredicateEvaluatorRectangle(Envelope envelope) {
this.minX = envelope.getMinX();
this.maxX = envelope.getMaxX();
this.minY = envelope.getMinY();
this.maxY = envelope.getMaxY();
}
示例15: covers
import com.vividsolutions.jts.geom.Envelope; //導入方法依賴的package包/類
@Override
public boolean covers(Envelope env) {
return env.getMinX() >= this.minX && env.getMaxX() <= this.maxX
&& env.getMinY() >= this.minY && env.getMaxY() <= this.maxY;
}