本文整理了Java中com.vividsolutions.jts.geom.Point.getEnvelopeInternal()
方法的一些代码示例,展示了Point.getEnvelopeInternal()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Point.getEnvelopeInternal()
方法的具体详情如下:
包路径:com.vividsolutions.jts.geom.Point
类名称:Point
方法名:getEnvelopeInternal
暂无
代码示例来源:origin: opentripplanner/OpenTripPlanner
private Geometry crudeProjectedBuffer(Point pt, double distanceMeters) {
final double mPerDegreeLat = 111111.111111;
double lat = pt.getY();
double lonScale = Math.cos(Math.PI * lat / 180);
double latExpand = distanceMeters / mPerDegreeLat;
double lonExpand = latExpand / lonScale;
Envelope env = pt.getEnvelopeInternal();
env.expandBy(lonExpand, latExpand);
return gf.toGeometry(env);
}
代码示例来源:origin: org.geotools/gt-render
public Envelope getEnvelopeInternal() {
return point.getEnvelopeInternal();
}
代码示例来源:origin: com.vividsolutions/jts
private void computeMinDistance(LineString line, Point pt,
GeometryLocation[] locGeom)
{
if (line.getEnvelopeInternal().distance(pt.getEnvelopeInternal())
> minDistance)
return;
Coordinate[] coord0 = line.getCoordinates();
Coordinate coord = pt.getCoordinate();
// brute force approach!
for (int i = 0; i < coord0.length - 1; i++) {
double dist = CGAlgorithms.distancePointLine(
coord, coord0[i], coord0[i + 1] );
if (dist < minDistance) {
minDistance = dist;
LineSegment seg = new LineSegment(coord0[i], coord0[i + 1]);
Coordinate segClosestPoint = seg.closestPoint(coord);
locGeom[0] = new GeometryLocation(line, i, segClosestPoint);
locGeom[1] = new GeometryLocation(pt, 0, coord);
}
if (minDistance <= terminateDistance) return;
}
}
代码示例来源:origin: matsim-org/matsim
@SuppressWarnings("unchecked")
private List<Zone<T>> getZones(Point point) {
if(point.getSRID() != srid)
point = transformPoint(point);
List<Zone<T>> result = quadtree.query(point.getEnvelopeInternal());
List<Zone<T>> zones = new ArrayList<Zone<T>>(result.size());
for(Zone<T> z : result) {
if(z.getGeometry().contains(point))
zones.add(z);
}
return zones;
}
代码示例来源:origin: posm/OpenMapKitAndroid
/**
* When the user adds an OSMNode POI to the map, we want to add that new
* node to JTSModel. This is done in OSMMap.
*
* @param n - the OSMNode
*/
public void addOSMStandaloneNode(OSMNode n) {
double lat = n.getLat();
double lng = n.getLng();
Coordinate coord = new Coordinate(lng, lat);
Point point = geometryFactory.createPoint(coord);
n.setJTSGeom(point);
Envelope envelope = point.getEnvelopeInternal();
spatialIndex.insert(envelope, n);
}
代码示例来源:origin: posm/OpenMapKitAndroid
private void addOSMStandaloneNodes(OSMDataSet ds) {
List<OSMNode> standaloneNodes = ds.getStandaloneNodes();
for (OSMNode n : standaloneNodes) {
double lat = n.getLat();
double lng = n.getLng();
Coordinate coord = new Coordinate(lng, lat);
Point point = geometryFactory.createPoint(coord);
n.setJTSGeom(point);
Envelope envelope = point.getEnvelopeInternal();
spatialIndex.insert(envelope, n);
}
}
代码示例来源:origin: DataSystemsLab/GeoSpark
List<Tuple2<Object, Double>> result = new ArrayList<Tuple2<Object, Double>>();
if (spatialObject instanceof Point) {
if (!datasetBoundary.covers(((Point) spatialObject).getEnvelopeInternal())) { return result.iterator(); }
Coordinate coordinate = RasterizationUtils.FindPixelCoordinates(resolutionX, resolutionY, datasetBoundary, ((Point) spatialObject).getCoordinate(), reverseSpatialCoordinate, false, true);
Point rasterizedObject = geometryFactory.createPoint(coordinate);
代码示例来源:origin: opentraffic/traffic-engine
populationData.population = new Long((Integer)feature.getAttribute("pop_max"));
this.popIndex.insert(populationData.point.getEnvelopeInternal(), populationData);
代码示例来源:origin: com.conveyal/r5
Envelope distanceTableZone = stopPoint.getEnvelopeInternal();
GeometryUtils.expandEnvelopeFixed(distanceTableZone, TransitLayer.DISTANCE_TABLE_SIZE_METERS);
int[] distancesToPoints = distanceTableToVertices == null ? null :
代码示例来源:origin: conveyal/r5
Envelope distanceTableZone = stopPoint.getEnvelopeInternal();
GeometryUtils.expandEnvelopeFixed(distanceTableZone, TransitLayer.DISTANCE_TABLE_SIZE_METERS);
int[] distancesToPoints = distanceTableToVertices == null ? null :
代码示例来源:origin: kiselev-dv/gazetteer
FeatureTypes.PLACE_DELONEY_FTYPE, node.tags, pnt, meta);
Envelope envelope = pnt.getEnvelopeInternal();
if (PLACE_CITY.contains(node.tags.get("place"))) {
cityesIndex.insert(envelope, String.valueOf(node.id));
代码示例来源:origin: kiselev-dv/gazetteer
bbox.expandToInclude(p.getEnvelopeInternal());
代码示例来源:origin: matsim-org/matsim
@Override
@SuppressWarnings("unchecked")
public Zone findZone(Coord coord) {
Point point = MGC.coord2Point(coord);
Envelope env = point.getEnvelopeInternal();
Zone zone = getSmallestZoneContainingPoint(quadTree.query(env), point);
if (zone != null) {
return zone;
}
if (expansionDistance > 0) {
env.expandBy(expansionDistance);
zone = getNearestZone(quadTree.query(env), point);
}
return zone;
}
代码示例来源:origin: kiselev-dv/gazetteer
@Override
public void handleWay(Way line, List<Point> coords) {
Envelope bbox = new Envelope();
for (Point p : coords) {
bbox.expandToInclude(p.getEnvelopeInternal());
}
Coordinate centre = bbox.centre();
TileNumber tileNumber = getTileNumber(centre.y, centre.x, this.lvl);
OSMXMLWriter writer = getWriter(tileNumber);
writeWayNodes(coords, writer);
writer.writeWay(line.id, line.nodes, line.tags);
}
代码示例来源:origin: mapplus/spatial_statistics_for_geotools_udig
private List<Coordinate> getCoordinateList(SimpleFeatureCollection inputFeatures) {
spatialIndex = new STRtree();
List<Coordinate> coordinateList = new ArrayList<Coordinate>();
SimpleFeatureIterator featureIter = inputFeatures.features();
try {
while (featureIter.hasNext()) {
SimpleFeature feature = featureIter.next();
Geometry geometry = (Geometry) feature.getDefaultGeometry();
Point centroid = geometry.getCentroid();
spatialIndex.insert(centroid.getEnvelopeInternal(),
new Node(centroid, feature.getID()));
coordinateList.add(centroid.getCoordinate());
}
} finally {
featureIter.close();
}
return coordinateList;
}
代码示例来源:origin: com.vividsolutions/jts-core
private void computeMinDistance(LineString line, Point pt,
GeometryLocation[] locGeom)
{
if (line.getEnvelopeInternal().distance(pt.getEnvelopeInternal())
> minDistance)
return;
Coordinate[] coord0 = line.getCoordinates();
Coordinate coord = pt.getCoordinate();
// brute force approach!
for (int i = 0; i < coord0.length - 1; i++) {
double dist = CGAlgorithms.distancePointLine(
coord, coord0[i], coord0[i + 1] );
if (dist < minDistance) {
minDistance = dist;
LineSegment seg = new LineSegment(coord0[i], coord0[i + 1]);
Coordinate segClosestPoint = seg.closestPoint(coord);
locGeom[0] = new GeometryLocation(line, i, segClosestPoint);
locGeom[1] = new GeometryLocation(pt, 0, coord);
}
if (minDistance <= terminateDistance) return;
}
}
代码示例来源:origin: com.revolsys.open/com.revolsys.open.gis.shape
public int writeGeometry(final LittleEndianRandomAccessFile out,
final int recordNumber, final Object geometry, final Envelope envelope,
final int shapeType) throws IOException {
out.writeInt(recordNumber);
if (geometry == null) {
return writeNull(out);
} else if (geometry instanceof Point) {
final Point point = (Point)geometry;
envelope.expandToInclude(point.getEnvelopeInternal());
return writePoint(out, point, shapeType);
} else if (geometry instanceof MultiPoint) {
final MultiPoint point = (MultiPoint)geometry;
envelope.expandToInclude(point.getEnvelopeInternal());
return writeMultiPoint(out, point, shapeType);
} else if (geometry instanceof LineString) {
final LineString line = (LineString)geometry;
envelope.expandToInclude(line.getEnvelopeInternal());
return writeLineString(out, line, shapeType);
} else if (geometry instanceof Polygon) {
final Polygon polygon = (Polygon)geometry;
envelope.expandToInclude(polygon.getEnvelopeInternal());
return writePolygon(out, polygon, shapeType);
} else {
return ShapefileConstants.UNKNOWN_SHAPE;
}
}
代码示例来源:origin: org.n52.shetland/shetland
srid = pointValuePair.getPoint().getSRID();
envelope.expandToInclude(pointValuePair.getPoint().getEnvelopeInternal());
代码示例来源:origin: org.n52.sensorweb.sos/inspire-api
srid = pointValuePair.getPoint().getSRID();
envelope.expandToInclude(pointValuePair.getPoint().getEnvelopeInternal());
内容来源于网络,如有侵权,请联系作者删除!