初始化
This commit is contained in:
parent
1bd88a9ad6
commit
f47dea3e53
@ -47,6 +47,35 @@ public class GeometryUtilities {
|
|||||||
return geomFactory.createPoint(new Coordinate(lon,lat));
|
return geomFactory.createPoint(new Coordinate(lon,lat));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点生成折现
|
||||||
|
* @param coordinateArray
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static LineString CreateLineStringByCoordinates(Coordinate[] coordinateArray){
|
||||||
|
LineString lineString = null;
|
||||||
|
if(coordinateArray != null && coordinateArray.length > 1){
|
||||||
|
lineString =geomFactory.createLineString(coordinateArray);
|
||||||
|
}
|
||||||
|
return lineString;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 点生成折现
|
||||||
|
* @param points
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static LineString CreateLineStringByPoints(Point[] points){
|
||||||
|
LineString lineString = null;
|
||||||
|
if(points != null && points.length > 0){
|
||||||
|
Coordinate[] coordinateArray = new Coordinate[points.length];
|
||||||
|
for(int i = 0,len = points.length;i < len;i++){
|
||||||
|
coordinateArray[i] = points[i].getCoordinate();
|
||||||
|
}
|
||||||
|
lineString =CreateLineStringByCoordinates(coordinateArray);
|
||||||
|
}
|
||||||
|
return lineString;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wkt转geometry
|
* wkt转geometry
|
||||||
* @param wktStr
|
* @param wktStr
|
||||||
@ -362,8 +391,8 @@ public class GeometryUtilities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return JTS.orthodromicDistance(
|
return JTS.orthodromicDistance(
|
||||||
startPoint.getCoordinate(),
|
new Coordinate(startPoint.getCoordinate().y,startPoint.getCoordinate().x),
|
||||||
endPoint.getCoordinate(),
|
new Coordinate(endPoint.getCoordinate().y,endPoint.getCoordinate().x),
|
||||||
CRSUtilities.GetCRSFromSRID(String.valueOf(sridValue))
|
CRSUtilities.GetCRSFromSRID(String.valueOf(sridValue))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,8 +38,17 @@ public class App {
|
|||||||
public static void main(String[] args) throws IllegalAccessException, IOException {
|
public static void main(String[] args) throws IllegalAccessException, IOException {
|
||||||
ApplicationContext context = ApplicationInit();
|
ApplicationContext context = ApplicationInit();
|
||||||
|
|
||||||
IntEnum[] objs = StationStatus.class.getEnumConstants();
|
Set<Integer> data = new HashSet<>();
|
||||||
System.out.println(objs.length);
|
data.add(1);
|
||||||
|
data.add(2);
|
||||||
|
data.add(3);
|
||||||
|
|
||||||
|
System.out.println(data.contains(1));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// IntEnum[] objs = StationStatus.class.getEnumConstants();
|
||||||
|
// System.out.println(objs.length);
|
||||||
|
|
||||||
// SourceService sourceService = context.getBean(SourceService.class);
|
// SourceService sourceService = context.getBean(SourceService.class);
|
||||||
//
|
//
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user