public class VisibilityPolygon extends Object
The code in this class is adapted from Byron Knoll's javascript library, available at https://github.com/byronknoll/visibility-polygon-js
Constructor and Description |
---|
VisibilityPolygon() |
VisibilityPolygon(double maxDistance) |
Modifier and Type | Method and Description |
---|---|
void |
addGeometry(org.locationtech.jts.geom.Geometry geometry)
Explode geometry and add occlusion segments in isovist
|
void |
addLineString(org.locationtech.jts.geom.LineString lineString) |
void |
addSegment(org.locationtech.jts.geom.Coordinate p0,
org.locationtech.jts.geom.Coordinate p1)
Add an occlusion segment to the isovist.
|
void |
fixSegments() |
double |
getEpsilon() |
org.locationtech.jts.geom.Geometry |
getIsovist(Collection<org.locationtech.jts.geom.Coordinate> viewPoints,
boolean addEnvelope)
Returns a polygonal geometry that represents the isovist for a collection of
view points.
|
org.locationtech.jts.geom.Polygon |
getIsovist(org.locationtech.jts.geom.Coordinate viewPoint,
boolean addEnvelope)
Computes an isovist, the area of the input visible from a given point in
space.
|
void |
setEpsilon(double epsilon) |
void |
setNumPoints(int numPoints) |
public VisibilityPolygon(double maxDistance)
maxDistance
- maximum distance (from the view point) constraint for the
visibility polygonpublic VisibilityPolygon()
public org.locationtech.jts.geom.Geometry getIsovist(Collection<org.locationtech.jts.geom.Coordinate> viewPoints, boolean addEnvelope)
viewPoints
- the collection of view points from which the isovist is
computed.addEnvelope
- a boolean flag indicating whether to include a circle
bounding box in the resulting geometry.public org.locationtech.jts.geom.Polygon getIsovist(org.locationtech.jts.geom.Coordinate viewPoint, boolean addEnvelope)
viewPoint
- View coordinateaddEnvelope
- If true add circle bounding box. This function does not
work properly if the view point is not enclosed by
segmentspublic void fixSegments()
public void setNumPoints(int numPoints)
numPoints
- Number of points of the bounding circle polygon. Default =
96.public double getEpsilon()
public void setEpsilon(double epsilon)
public void addGeometry(org.locationtech.jts.geom.Geometry geometry)
geometry
- Geometry collection, LineString or Polygon instancepublic void addLineString(org.locationtech.jts.geom.LineString lineString)
public void addSegment(org.locationtech.jts.geom.Coordinate p0, org.locationtech.jts.geom.Coordinate p1)
p0
- segment originp1
- segment destinationCopyright © 2023. All rights reserved.