本文整理了Java中com.vividsolutions.jts.geom.Polygon.getEnvelopeInternal()
方法的一些代码示例,展示了Polygon.getEnvelopeInternal()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Polygon.getEnvelopeInternal()
方法的具体详情如下:
包路径:com.vividsolutions.jts.geom.Polygon
类名称:Polygon
方法名:getEnvelopeInternal
暂无
代码示例来源:origin: com.vividsolutions/jts
/**
* Create a new contains computer for two geometries.
*
* @param rectangle a rectangular geometry
*/
public RectangleContains(Polygon rectangle) {
rectEnv = rectangle.getEnvelopeInternal();
}
代码示例来源:origin: com.vividsolutions/jts
/**
* Create a new intersects computer for a rectangle.
*
* @param rectangle
* a rectangular Polygon
*/
public RectangleIntersects(Polygon rectangle)
{
this.rectangle = rectangle;
rectEnv = rectangle.getEnvelopeInternal();
}
代码示例来源:origin: com.vividsolutions/jts
/**
* Creates a visitor for checking rectangle intersection
* with segments
*
* @param rectangle the query rectangle
*/
public RectangleIntersectsSegmentVisitor(Polygon rectangle)
{
rectEnv = rectangle.getEnvelopeInternal();
rectIntersector = new RectangleLineIntersector(rectEnv);
}
代码示例来源:origin: com.vividsolutions/jts
public GeometryContainsPointVisitor(Polygon rectangle)
{
this.rectSeq = rectangle.getExteriorRing().getCoordinateSequence();
rectEnv = rectangle.getEnvelopeInternal();
}
代码示例来源:origin: com.vividsolutions/jts-core
/**
* Create a new intersects computer for a rectangle.
*
* @param rectangle
* a rectangular Polygon
*/
public RectangleIntersects(Polygon rectangle)
{
this.rectangle = rectangle;
rectEnv = rectangle.getEnvelopeInternal();
}
代码示例来源:origin: com.vividsolutions/jts-core
/**
* Create a new contains computer for two geometries.
*
* @param rectangle a rectangular geometry
*/
public RectangleContains(Polygon rectangle) {
rectEnv = rectangle.getEnvelopeInternal();
}
代码示例来源:origin: org.geotools/gt2-xml-gml3
public Object getProperty(Object object, QName name) {
if (name.equals(GML.Envelope)) {
if (object instanceof Envelope) {
return object;
}
//check for a polygon
if (object instanceof Polygon) {
return ((Polygon) object).getEnvelopeInternal();
}
}
return null;
}
}
代码示例来源:origin: org.geotools.xsd/gt-gml3
public Object getProperty(Object object, QName name) {
if (name.equals(GML.Envelope)) {
if (object instanceof Envelope) {
return object;
}
//check for a polygon
if (object instanceof Polygon) {
return ((Polygon) object).getEnvelopeInternal();
}
}
return null;
}
}
代码示例来源:origin: com.vividsolutions/jts-core
/**
* Creates a visitor for checking rectangle intersection
* with segments
*
* @param rectangle the query rectangle
*/
public RectangleIntersectsSegmentVisitor(Polygon rectangle)
{
rectEnv = rectangle.getEnvelopeInternal();
rectIntersector = new RectangleLineIntersector(rectEnv);
}
代码示例来源:origin: com.vividsolutions/jts-core
public SafeBisectorFinder(Polygon poly) {
this.poly = poly;
// initialize using extremal values
hiY = poly.getEnvelopeInternal().getMaxY();
loY = poly.getEnvelopeInternal().getMinY();
centreY = avg(loY, hiY);
}
代码示例来源:origin: com.vividsolutions/jts
Envelope env = getEnvelopeInternal();
for (int i = 0; i < 5; i++) {
double x = seq.getX(i);
代码示例来源:origin: org.geotools.xsd/gt-xsd-gml3
public Object getProperty(Object object, QName name) {
//check for a polygon
if (object instanceof Polygon) {
object = ((Polygon) object).getEnvelopeInternal();
}
Envelope e = (Envelope) object;
if ("Envelope".equals(name.getLocalPart()) && !e.isNull()) {
return e;
}
if ("Null".equals(name.getLocalPart()) && e.isNull()) {
return e;
}
return null;
}
}
代码示例来源:origin: osmlab/atlas
private void addCountry(final String country, final Polygon polygon)
{
this.countryNameToBoundaryMap.add(country, polygon);
if (this.envelope.intersects(polygon.getEnvelopeInternal()))
{
this.rawIndex.insert(polygon.getEnvelopeInternal(), polygon);
}
}
代码示例来源:origin: kiselev-dv/gazetteer
private void many2ManyJoin(JSONObject object, Polygon polyg, Map<JSONObject, List<JSONObject>> result, SpatialIndex index) {
Envelope polygonEnvelop = polyg.getEnvelopeInternal();
for (Object entry : index.query(polygonEnvelop)) {
JSONArray pntg = ((JSONObject)entry).getJSONObject(GeoJsonWriter.GEOMETRY).getJSONArray(GeoJsonWriter.COORDINATES);
Coordinate pnt = new Coordinate(pntg.getDouble(0), pntg.getDouble(1));
JSONObject obj = (JSONObject) entry;
if(polyg.intersects(factory.createPoint(pnt))) {
if(result.get(obj) == null) {
result.put(obj, new ArrayList<JSONObject>());
}
result.get(obj).add(object);
}
}
}
代码示例来源:origin: com.vividsolutions/jts-core
public GeometryContainsPointVisitor(Polygon rectangle)
{
this.rectSeq = rectangle.getExteriorRing().getCoordinateSequence();
rectEnv = rectangle.getEnvelopeInternal();
}
代码示例来源:origin: osmlab/atlas
private void createRawIndex()
{
this.rawIndex = new STRtree();
for (final Polygon boundary : this.boundaries)
{
this.rawIndex.insert(boundary.getEnvelopeInternal(), boundary);
}
}
代码示例来源:origin: DataSystemsLab/GeoSpark
@Override
public Iterator<Tuple2<Object, Double>> call(Tuple2<Polygon, Long> spatialObject)
throws Exception
{
GeometryFactory geometryFactory = new GeometryFactory();
List<Tuple2<Object, Double>> result = new ArrayList<Tuple2<Object, Double>>();
if (!datasetBoundary.covers(((Polygon) spatialObject._1()).getEnvelopeInternal())) { return result.iterator(); }
Coordinate[] spatialCoordinates = RasterizationUtils.FindPixelCoordinates(resolutionX, resolutionY, datasetBoundary, ((Polygon) spatialObject._1()).getCoordinates(), reverseSpatialCoordinate, false, true);
result.add(new Tuple2<Object, Double>(geometryFactory.createPolygon(spatialCoordinates), new Double(spatialObject._2())));
return result.iterator();
}
});
代码示例来源:origin: kiselev-dv/gazetteer
@SuppressWarnings("unchecked")
private void one2OneJoin(List<JSONObject> polygons, Map<JSONObject, JSONObject> result) {
for(JSONObject placeV : polygons) {
Polygon polyg = GeoJsonWriter.getPolygonGeometry(placeV);
Envelope polygonEnvelop = polyg.getEnvelopeInternal();
for (JSONObject pnt : (List<JSONObject>)addrPointsIndex.query(polygonEnvelop)) {
JSONArray pntg = pnt.getJSONObject(GeoJsonWriter.GEOMETRY).getJSONArray(GeoJsonWriter.COORDINATES);
if(polyg.contains(factory.createPoint(new Coordinate(pntg.getDouble(0), pntg.getDouble(1))))){
result.put(pnt, placeV);
}
}
}
}
代码示例来源:origin: kiselev-dv/gazetteer
/**
* Constructs a new {@code JoinedPolygon} from given list of ways.
* @param ways The ways used to build joined polygon
*/
public JoinedPolygon(List<LineString> ways, List<Boolean> reversed) {
this.ways = ways;
this.reversed = reversed;
this.nodes = this.getNodes();
this.area = factory.createPolygon(factory.createLinearRing(this.nodesAsCoords()));
this.bounds = area.getEnvelopeInternal();
}
代码示例来源:origin: org.locationtech.geogig/geogig-datastore
@Test
public void disjointFilter() throws Exception {
Envelope bounds = testNode.bounds().get();
bounds.expandBy(1);
Polygon container = JTS.toGeometry(bounds);
Geometry containerBounds = JTS.toGeometry(container.getEnvelopeInternal());
Disjoint filter;
filter = (Disjoint) toFilter(String.format("Disjoint(the_geom, %s)", container));
Filter pre = ff.intersects(ff.property("@bounds"), ff.literal(containerBounds));
Filter post = filter;
assertFilter(filter, pre, post);
}
内容来源于网络,如有侵权,请联系作者删除!