当前位置: 首页>>代码示例>>Java>>正文


Java Envelope.getMinY方法代码示例

本文整理汇总了Java中com.vividsolutions.jts.geom.Envelope.getMinY方法的典型用法代码示例。如果您正苦于以下问题:Java Envelope.getMinY方法的具体用法?Java Envelope.getMinY怎么用?Java Envelope.getMinY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vividsolutions.jts.geom.Envelope的用法示例。


在下文中一共展示了Envelope.getMinY方法的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;
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:20,代码来源:PeliasGeocoder.java

示例2: findStabbedSegments

import com.vividsolutions.jts.geom.Envelope; //导入方法依赖的package包/类
/**
 * Finds all non-horizontal segments intersecting the stabbing line.
 * The stabbing line is the ray to the right of stabbingRayLeftPt.
 *
 * @param stabbingRayLeftPt the left-hand origin of the stabbing line
 * @return a List of {@link DepthSegments} intersecting the stabbing line
 */
private List findStabbedSegments(Coordinate stabbingRayLeftPt) {
    List stabbedSegments = new ArrayList();
    for (Object subgraph : subgraphs) {
        BufferSubgraph bsg = (BufferSubgraph) subgraph;

        // optimization - don't bother checking subgraphs which the ray does not intersect
        Envelope env = bsg.getEnvelope();
        if (stabbingRayLeftPt.y < env.getMinY()
                || stabbingRayLeftPt.y > env.getMaxY()) {
            continue;
        }

        this.findStabbedSegments(stabbingRayLeftPt, bsg.getDirectedEdges(), stabbedSegments);
    }
    return stabbedSegments;
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:24,代码来源:SubgraphDepthLocater.java

示例3: 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());
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:21,代码来源:QuadEdgeSubdivision.java

示例4: 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");
		}
		
	}
 
开发者ID:sebastian-r-schmidt,项目名称:logicaldecoding,代码行数:23,代码来源:GWCInvalidator.java

示例5: 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);
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:30,代码来源:Quadtree.java

示例6: createEllipse

import com.vividsolutions.jts.geom.Envelope; //导入方法依赖的package包/类
/**
 * Creates an elliptical {@link Polygon}.
 * If the supplied envelope is square the
 * result will be a circle.
 *
 * @return an ellipse or circle
 */
public Polygon createEllipse() {

    Envelope env = this.dim.getEnvelope();
    double xRadius = env.getWidth() / 2.0;
    double yRadius = env.getHeight() / 2.0;

    double centreX = env.getMinX() + xRadius;
    double centreY = env.getMinY() + yRadius;

    Coordinate[] pts = new Coordinate[this.nPts + 1];
    int iPt = 0;
    for (int i = 0; i < this.nPts; i++) {
        double ang = i * (2 * Math.PI / this.nPts);
        double x = xRadius * Math.cos(ang) + centreX;
        double y = yRadius * Math.sin(ang) + centreY;
        pts[iPt++] = this.coord(x, y);
    }
    pts[iPt] = new Coordinate(pts[0]);

    LinearRing ring = this.geomFact.createLinearRing(pts);
    Polygon poly = this.geomFact.createPolygon(ring, null);
    return (Polygon) this.rotate(poly);
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:31,代码来源:GeometricShapeFactory.java

示例7: fastGetSharedAreaRatio

import com.vividsolutions.jts.geom.Envelope; //导入方法依赖的package包/类
/**
 * This is ten times faster than the absolutely correct
 * version above, and it's only off by an average of 1%.
 * Note that the first argument MUST be rectangular, or
 * your results will be meaningless.
 */
public static double fastGetSharedAreaRatio (Geometry geom1, Geometry geom2) {
    Envelope env1 = geom1.getEnvelopeInternal();
    if ((SimplePointInAreaLocator.locate(new Coordinate(env1.getMinX(),env1.getMinY()), geom2) == Location.INTERIOR) &&
        (SimplePointInAreaLocator.locate(new Coordinate(env1.getMaxX(),env1.getMaxY()), geom2) == Location.INTERIOR) &&
        (SimplePointInAreaLocator.locate(new Coordinate(env1.getMaxX(),env1.getMinY()), geom2) == Location.INTERIOR) &&
        (SimplePointInAreaLocator.locate(new Coordinate(env1.getMinX(),env1.getMaxY()), geom2) == Location.INTERIOR)) {
        // I suppose it is possible for a valid polygon geometry
        // to contain all four corners and share considerably less
        // than 100% of its area with the envelope in question.
        // But if you're that worried about correctness you
        // shouldn't be using this method in the first place.
        return 1.0;
    }
    double xInc = env1.getWidth() / 9.0;
    double yInc = env1.getHeight() / 9.0;
    double x = env1.getMinX();
    double y = env1.getMinY();
    double ct = 0;
    for (int i = 0; i < 10; i += 1) {
        y = env1.getMinY();
        for (int j = 0; j < 10; j += 1) {
            if (SimplePointInAreaLocator.locate(new Coordinate(x,y), geom2) == Location.INTERIOR) {
                ct += 1;
            }
            y += yInc;
        }
        x += xInc;
    }
    return (ct / 100.0);
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:37,代码来源:JTSUtil.java

示例8: 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);
}
 
开发者ID:graphium-project,项目名称:graphium,代码行数:11,代码来源:GeometryUtils.java

示例9: 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 + ")";
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:10,代码来源:MemSQLLocationsDataProvider.java

示例10: 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());
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:15,代码来源:MVSpatialIndex.java

示例11: 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;
    }
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:33,代码来源:RectangleIntersects.java

示例12: buildIndex

import com.vividsolutions.jts.geom.Envelope; //导入方法依赖的package包/类
private void buildIndex() {
    //Envelope env = ring.getEnvelopeInternal();
    this.tree = new Bintree();

    Coordinate[] pts = CoordinateArrays.removeRepeatedPoints(this.ring.getCoordinates());
    List mcList = MonotoneChainBuilder.getChains(pts);

    for (Object aMcList : mcList) {
        MonotoneChain mc = (MonotoneChain) aMcList;
        Envelope mcEnv = mc.getEnvelope();
        this.interval.min = mcEnv.getMinY();
        this.interval.max = mcEnv.getMaxY();
        this.tree.insert(this.interval, mc);
    }
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:16,代码来源:MCPointInRing.java

示例13: 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());
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:20,代码来源:RectangleLineIntersector.java

示例14: 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);
    }
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:32,代码来源:KdTree.java

示例15: createArc

import com.vividsolutions.jts.geom.Envelope; //导入方法依赖的package包/类
/**
 * Creates an elliptical arc, as a {@link LineString}.
 * The arc is always created in a counter-clockwise direction.
 * This can easily be reversed if required by using
 * {#link LineString.reverse()}
 *
 * @param startAng start angle in radians
 * @param angExtent size of angle in radians
 * @return an elliptical arc
 */
public LineString createArc(
        double startAng,
        double angExtent) {
    Envelope env = this.dim.getEnvelope();
    double xRadius = env.getWidth() / 2.0;
    double yRadius = env.getHeight() / 2.0;

    double centreX = env.getMinX() + xRadius;
    double centreY = env.getMinY() + yRadius;

    double angSize = angExtent;
    if (angSize <= 0.0 || angSize > 2 * Math.PI) {
        angSize = 2 * Math.PI;
    }
    double angInc = angSize / (this.nPts - 1);

    Coordinate[] pts = new Coordinate[this.nPts];
    int iPt = 0;
    for (int i = 0; i < this.nPts; i++) {
        double ang = startAng + i * angInc;
        double x = xRadius * Math.cos(ang) + centreX;
        double y = yRadius * Math.sin(ang) + centreY;
        pts[iPt++] = this.coord(x, y);
    }
    LineString line = this.geomFact.createLineString(pts);
    return (LineString) this.rotate(line);
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:38,代码来源:GeometricShapeFactory.java


注:本文中的com.vividsolutions.jts.geom.Envelope.getMinY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。