类 GeoComputation
- java.lang.Object
-
- org.meteoinfo.geometry.geoprocess.GeoComputation
-
public class GeoComputation extends Object
GeoComputation class- 作者:
- Yaqiang Wang
-
-
构造器概要
构造器 构造器 说明 GeoComputation()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static doublecalArea(List<PointD> points)Get polygon area on earth surfacestatic PointShapeclipPointShape(PointShape aPS, Object clipObj)Clip point shape with a clipping objectstatic PolygonShapeclipPolygonShape(PolygonShape aPGS, Object clipObj)Clip polygon shape with a clipping objectstatic PolygonShapeclipPolygonShape_Lat(PolygonShape aPGS, double lat)Clip polygon shape with a latitudestatic PolygonShapeclipPolygonShape_Lat(PolygonShape aPGS, double lat, boolean isTop)Clip polygon shape with a latitudestatic PolygonShapeclipPolygonShape_Lon(PolygonShape aPGS, double lon)Clip polygon shape with a longitudestatic PolylineShapeclipPolylineShape(PolylineShape aPLS, Object clipObj)Clip polyline shape with a clipping objectstatic PolylineShapeclipPolylineShape_Lat(PolylineShape aPLS, double lat)Clip polyline shape with a longitudestatic PolylineShapeclipPolylineShape_Lat(PolylineShape aPLS, double lat, boolean isTop)Clip polyline shape with a longitudestatic PolylineShapeclipPolylineShape_Lon(PolylineShape aPLS, double lon)Clip polyline shape with a longitudestatic ShapeclipShape(Shape aShape, Object clipObj)Clip a shapestatic doublecrossProduct(PointD p1, PointD p2, PointD p3)Finds the cross product of the 2 vectors created by the 3 vertices.static doubledis_PointToLine(PointD point, PointD pt1, PointD pt2)Calculate the distance between point and a line segmentstatic doubledistance(PointD pt1, PointD pt2)Get distance between two pointsstatic doublegetArea(double[] x, double[] y, boolean isLonLat)Get polygon area on earth surfacestatic doublegetArea(double[] x, double[] y, boolean isLonLat, double earthRadius)Get polygon area on earth surfacestatic doublegetArea(List<? extends PointD> points)Get polygon area on earth surfacestatic doublegetArea(List<? extends PointD> points, boolean isLonLat)Get polygon area on earth surfacestatic doublegetArea(List<Number> x, List<Number> y, boolean isLonLat)Get polygon areaprotected static List<PointD>getClipPointList(Object clipObj)protected static List<PointD>getClipPointList(Object clipObj, boolean z)protected static PointDgetCrossPoint(Line lineA, Line lineB)static doublegetDistance(List<? extends PointD> points, boolean isLonLat)Get distancestatic doublegetDistance(List<Number> xx, List<Number> yy, boolean isLonLat)Get distancestatic ArraygetGridArea(double xOrig, double xCell, int xNum, double yOrig, double yCell, int yNum, boolean isLonLat, boolean allCell)Calculate area of grid cells.static ArraygetGridArea(double xOrig, double xCell, int xNum, double yOrig, double yCell, int yNum, boolean isLonLat, boolean allCell, double earthRadius)Calculate area of grid cells.static List<GridLabel>getGridLabels(Polyline inPolyLine, Extent clipExtent, boolean isVertical)Get grid labels of a polylinestatic doublehaversine(double x)Haversine function : hav(x) = (1-cos(x))/2static booleanisClockwise(List<? extends PointD> pointList)Determine if a point array is clockwisestatic booleanisClockwise(PointD[] points)Determine if a point array is clockwiseprotected static booleanisExtentCross(Extent aExtent, Object clipObj)protected static booleanisLineSegmentCross(Line lineA, Line lineB)protected static booleanpointInClipObj(Object clipObj, PointD aPoint)static booleanpointInPolygon(List<? extends PointD> poly, PointD aPoint)Determine if a point is in a polygonstatic booleanpointInPolygon(Polygon aPolygon, PointD aPoint)Determine if a point is in a polygonstatic booleanpointInPolygon(PolygonShape aPolygon, double x, double y)Determine if a point is in a polygonstatic booleanpointInPolygon(PolygonShape aPolygon, PointD aPoint)Determine if a point is in a polygonstatic booleanpointInPolygons(List<PolygonShape> polygons, PointD aPoint)Determine if a point located in polygonsstatic doublepointProduct(PointD p1, PointD p2, PointD p3)Finds the point product of the 2 vectors created by the 3 vertices.static ObjectselectPolyline(PointD sp, List<PointD> points, double buffer)Select polyline shape by a pointstatic ObjectselectPolylineShape(PointD sp, PolylineShape aPLS, double buffer)Select polyline shape by a pointstatic doublesphericalPolygonArea(double[] lat, double[] lon, double r)Compute the Area of a Spherical Polygonstatic doublesphericalPolygonArea(List<? extends PointD> points)Compute the Area of a Spherical Polygonstatic doublesphericalPolygonArea(List<? extends PointD> points, double r)Compute the Area of a Spherical Polygon
-
-
-
方法详细资料
-
isClockwise
public static boolean isClockwise(List<? extends PointD> pointList)
Determine if a point array is clockwise- 参数:
pointList- point list- 返回:
- boolean
-
isClockwise
public static boolean isClockwise(PointD[] points)
Determine if a point array is clockwise- 参数:
points- point array- 返回:
- boolean
-
pointInPolygon
public static boolean pointInPolygon(List<? extends PointD> poly, PointD aPoint)
Determine if a point is in a polygon- 参数:
poly- Polygon border pointsaPoint- The point- 返回:
- If the point is in the polygon
-
pointInPolygon
public static boolean pointInPolygon(PolygonShape aPolygon, PointD aPoint)
Determine if a point is in a polygon- 参数:
aPolygon- The polygonaPoint- The point- 返回:
- Boolean
-
pointInPolygon
public static boolean pointInPolygon(PolygonShape aPolygon, double x, double y)
Determine if a point is in a polygon- 参数:
aPolygon- The polygonx- Xy- Y- 返回:
- Boolean
-
pointInPolygon
public static boolean pointInPolygon(Polygon aPolygon, PointD aPoint)
Determine if a point is in a polygon- 参数:
aPolygon- The polygonaPoint- The point- 返回:
- Boolean
-
pointInPolygons
public static boolean pointInPolygons(List<PolygonShape> polygons, PointD aPoint)
Determine if a point located in polygons- 参数:
polygons- The polygonsaPoint- The point- 返回:
- Boolean
-
dis_PointToLine
public static double dis_PointToLine(PointD point, PointD pt1, PointD pt2)
Calculate the distance between point and a line segment- 参数:
point- The pointpt1- End point of the line segmentpt2- End point of the line segment- 返回:
- Distance
-
distance
public static double distance(PointD pt1, PointD pt2)
Get distance between two points- 参数:
pt1- Point onept2- Point two- 返回:
- Distance
-
selectPolylineShape
public static Object selectPolylineShape(PointD sp, PolylineShape aPLS, double buffer)
Select polyline shape by a point- 参数:
sp- The pointaPLS- The polyline shapebuffer- Buffer- 返回:
- Is the polyline shape selected
-
selectPolyline
public static Object selectPolyline(PointD sp, List<PointD> points, double buffer)
Select polyline shape by a point- 参数:
sp- The pointpoints- The point listbuffer- Buffer- 返回:
- Is the polyline shape selected
-
getGridArea
public static Array getGridArea(double xOrig, double xCell, int xNum, double yOrig, double yCell, int yNum, boolean isLonLat, boolean allCell)
Calculate area of grid cells.- 参数:
xOrig- X originxCell- X cell spacingxNum- X numberyOrig- Y originyCell- Y cell spacingyNum- Y numberisLonLat- Is lonlat projection or notallCell- Calculate each grid or not- 返回:
- Grid area array
-
getGridArea
public static Array getGridArea(double xOrig, double xCell, int xNum, double yOrig, double yCell, int yNum, boolean isLonLat, boolean allCell, double earthRadius)
Calculate area of grid cells.- 参数:
xOrig- X originxCell- X cell spacingxNum- X numberyOrig- Y originyCell- Y cell spacingyNum- Y numberisLonLat- Is lonlat projection or notallCell- Calculate each grid or notearthRadius- Earth radius- 返回:
- Grid area array
-
getArea
public static double getArea(List<Number> x, List<Number> y, boolean isLonLat)
Get polygon area- 参数:
x- X coordinatesy- Y coordinatesisLonLat- If is on earth surface (lon/lat)- 返回:
- Area
-
getArea
public static double getArea(double[] x, double[] y, boolean isLonLat)Get polygon area on earth surface- 参数:
x- X coordinatesy- Y coordinatesisLonLat- if is lon/lat- 返回:
- area
-
getArea
public static double getArea(double[] x, double[] y, boolean isLonLat, double earthRadius)Get polygon area on earth surface- 参数:
x- X coordinatesy- Y coordinatesisLonLat- if is lon/latearthRadius- Earth radius- 返回:
- area
-
getArea
public static double getArea(List<? extends PointD> points, boolean isLonLat)
Get polygon area on earth surface- 参数:
points- point listisLonLat- if is lon/lat- 返回:
- area
-
getArea
public static double getArea(List<? extends PointD> points)
Get polygon area on earth surface- 参数:
points- point list- 返回:
- area
-
calArea
public static double calArea(List<PointD> points)
Get polygon area on earth surface- 参数:
points- point list- 返回:
- area
-
sphericalPolygonArea
public static double sphericalPolygonArea(List<? extends PointD> points)
Compute the Area of a Spherical Polygon- 参数:
points- lon/lat point list- 返回:
- area
-
sphericalPolygonArea
public static double sphericalPolygonArea(List<? extends PointD> points, double r)
Compute the Area of a Spherical Polygon- 参数:
points- lon/lat point listr- spherical radius- 返回:
- area
-
haversine
public static double haversine(double x)
Haversine function : hav(x) = (1-cos(x))/2- 参数:
x-- 返回:
- Returns the value of Haversine function
-
sphericalPolygonArea
public static double sphericalPolygonArea(double[] lat, double[] lon, double r)Compute the Area of a Spherical Polygon- 参数:
lat- the latitudes of all vertices(in radian)lon- the longitudes of all vertices(in radian)r- spherical radius- 返回:
- Returns the area of a spherical polygon
-
getDistance
public static double getDistance(List<? extends PointD> points, boolean isLonLat)
Get distance- 参数:
points- Point listisLonLat- If is lon/lat- 返回:
- Distance
-
getDistance
public static double getDistance(List<Number> xx, List<Number> yy, boolean isLonLat)
Get distance- 参数:
xx- X coordinatesyy- Y coordinatesisLonLat- If is lon/lat- 返回:
- Distance
-
getGridLabels
public static List<GridLabel> getGridLabels(Polyline inPolyLine, Extent clipExtent, boolean isVertical)
Get grid labels of a polyline- 参数:
inPolyLine- PolylineclipExtent- Clipping objectisVertical- If is vertical- 返回:
- Clip points
-
clipShape
public static Shape clipShape(Shape aShape, Object clipObj)
Clip a shape- 参数:
aShape- The shapeclipObj- Clipping object- 返回:
- Clipped shape
-
clipPointShape
public static PointShape clipPointShape(PointShape aPS, Object clipObj)
Clip point shape with a clipping object- 参数:
aPS- The point shapeclipObj- Clipping object- 返回:
- Clipped point shape
-
clipPolylineShape
public static PolylineShape clipPolylineShape(PolylineShape aPLS, Object clipObj)
Clip polyline shape with a clipping object- 参数:
aPLS- The polyline shapeclipObj- Clipping object- 返回:
- Clipped polyline shape
-
clipPolylineShape_Lon
public static PolylineShape clipPolylineShape_Lon(PolylineShape aPLS, double lon)
Clip polyline shape with a longitude- 参数:
aPLS- Polyline shapelon- Longitude- 返回:
- Clipped polyline shape
-
clipPolylineShape_Lat
public static PolylineShape clipPolylineShape_Lat(PolylineShape aPLS, double lat)
Clip polyline shape with a longitude- 参数:
aPLS- Polyline shapelat- The latitude- 返回:
- Clipped polyline shape
-
clipPolylineShape_Lat
public static PolylineShape clipPolylineShape_Lat(PolylineShape aPLS, double lat, boolean isTop)
Clip polyline shape with a longitude- 参数:
aPLS- Polyline shapelat- LatitudeisTop- If is top- 返回:
- Clipped polyline shape
-
clipPolygonShape
public static PolygonShape clipPolygonShape(PolygonShape aPGS, Object clipObj)
Clip polygon shape with a clipping object- 参数:
aPGS- Polygon shapeclipObj- Clipping object- 返回:
- Clipped polygon shape
-
clipPolygonShape_Lon
public static PolygonShape clipPolygonShape_Lon(PolygonShape aPGS, double lon)
Clip polygon shape with a longitude- 参数:
aPGS- Polygon shapelon- Longitude- 返回:
- Clipped polygon shape
-
clipPolygonShape_Lat
public static PolygonShape clipPolygonShape_Lat(PolygonShape aPGS, double lat)
Clip polygon shape with a latitude- 参数:
aPGS- Polygon shapelat- Latitude- 返回:
- Clipped polygon shape
-
clipPolygonShape_Lat
public static PolygonShape clipPolygonShape_Lat(PolygonShape aPGS, double lat, boolean isTop)
Clip polygon shape with a latitude- 参数:
aPGS- Polygon shapelat- LatitudeisTop- If is top- 返回:
- Clipped polygon shape
-
crossProduct
public static double crossProduct(PointD p1, PointD p2, PointD p3)
Finds the cross product of the 2 vectors created by the 3 vertices. if the sign of the cross product is negative. The vectors make a "left turn" if the sign of the cross product is positive. The vectors are colinear (on the same line) if the cross product is zero.- 参数:
p1- Point 1p2- Point 2p3- Piont 3- 返回:
- Cross product of the two vectors
-
pointProduct
public static double pointProduct(PointD p1, PointD p2, PointD p3)
Finds the point product of the 2 vectors created by the 3 vertices.- 参数:
p1- Point 1p2- Point 2p3- Piont 3- 返回:
- Cross product of the two vectors
-
-