GeoLineString

public class GeoLineString extends GeoGeometry

Fields

mPoints

protected List<GeoPoint> mPoints

serialVersionUID

protected static final long serialVersionUID

Constructors

GeoLineString

public GeoLineString()

GeoLineString

public GeoLineString(GeoLineString geoLineString)

Methods

add

public void add(GeoPoint point)

clear

public void clear()

clip

public GeoGeometry clip(GeoEnvelope envelope)

clip

protected void clip(List<GeoPoint> pointsIn, List<GeoPoint> pointsOut, GeoEnvelope envelope, boolean shapeOpen)

Sutherland-Hodgman Polygon Clipping Adopted from (C) 2005 by Gavin Macaulay QGIS Project

coordinatesToJSON

public JSONArray coordinatesToJSON()

copy

public GeoGeometry copy()

distance

public double distance(GeoGeometry geometry)

equals

public boolean equals(Object o)

getEnvelope

public GeoEnvelope getEnvelope()

getInstance

protected GeoLineString getInstance()

getLength

public double getLength()

getPoint

public GeoPoint getPoint(int index)

getPointCount

public int getPointCount()

getPoints

public List<GeoPoint> getPoints()

getSquareDistance

protected double getSquareDistance(GeoPoint p1, GeoPoint p2)

getSquareSegmentDistance

protected double getSquareSegmentDistance(GeoPoint p0, GeoPoint p1, GeoPoint p2)

getType

public int getType()

intersects

public boolean intersects(GeoEnvelope envelope)

intersects

public boolean intersects(GeoPoint a, GeoPoint b, GeoPoint c, GeoPoint d)

Detects line ab and cd intersection

Параметры:
  • a – Start first line point point
  • b – End first line point
  • c – Start second line point
  • d – End second line point
Результат:

Do lines intersect

intersects

public boolean intersects(GeoPoint a, GeoPoint b, GeoPoint c, GeoPoint d, double A1, double B1, double C1)

Detects line ab and cd intersection

Параметры:
  • a – Start first line point point
  • b – End first line point
  • c – Start second line point
  • d – End second line point
  • A1 – For speed, see method above
  • B1 – For speed, see method above
  • C1 – For speed, see method above
Результат:

Do lines intersect

isValid

public boolean isValid()

linesIntersect

protected boolean linesIntersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)

rawProject

protected boolean rawProject(int toCrs)

read

public void read(DataInputStream stream)

remove

public GeoPoint remove(int index)

setCoordinatesFromJSON

public void setCoordinatesFromJSON(JSONArray coordinates)

setCoordinatesFromJSONStream

public void setCoordinatesFromJSONStream(JsonReader reader, int crs)

setCoordinatesFromWKT

public void setCoordinatesFromWKT(String wkt, int crs)

simplify

public GeoGeometry simplify(double tolerance)

simplifyDouglasPeucker

protected GeoLineString simplifyDouglasPeucker(double sqTolerance)

simplifyRadialDistance

protected GeoLineString simplifyRadialDistance(double sqTolerance)

solveIntersection

protected GeoPoint solveIntersection(GeoPoint pt1, GeoPoint pt2, int pos, GeoEnvelope envelope)

toWKT

public String toWKT(boolean full)

trimPoints

protected void trimPoints(List<GeoPoint> pointsIn, List<GeoPoint> pointsOut, int pos, GeoEnvelope envelope, boolean shapeOpen)

write

public void write(DataOutputStream stream)