CS类:
package com.coordinate.entity;
public class CS {
public String name;
public Datum datum;
public Projection projection;
public FittingParameter fittingParameter;
public FourParameter fourParameter;
public boolean original;
public CS() {
original = true;
}
public CS(String name, Datum datum, Projection projection) {
super();
this.name = name;
this.datum = datum;
this.projection = projection;
}
public CS(String name, Datum datum, Projection projection, FittingParameter fittingParameter) {
super();
this.name = name;
this.datum = datum;
this.projection = projection;
this.fittingParameter = fittingParameter;
}
public CS(String name, Datum datum, Projection projection, FittingParameter fittingParameter, FourParameter fourParameter) {
super();
this.name = name;
this.datum = datum;
this.projection = projection;
this.fittingParameter = fittingParameter;
this.fourParameter = fourParameter;
}
public CS(String name, Datum datum, Projection projection, FourParameter fourParameter) {
super();
this.name = name;
this.datum = datum;
this.projection = projection;
this.fourParameter = fourParameter;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Datum getDatum() {
return datum;
}
public void setDatum(Datum datum) {
this.datum = datum;
}
public Projection getProjection() {
return projection;
}
public void setProjection(Projection projection) {
this.projection = projection;
}
public void setFittingParameter(FittingParameter fittingParameter) {
this.fittingParameter = fittingParameter;
}
public FittingParameter getFittingParameter() {
return fittingParameter;
}
public void setFourParameter(FourParameter fourParameter) {
this.fourParameter = fourParameter;
}
public FourParameter getFourParameter() {
return fourParameter;
}
}
Datum类:
package com.coordinate.entity;
import com.coordinate.constant.AzimuthZero;
import com.coordinate.constant.PositiveDirection;
/**
* 基准面
* @author ChenQiang
* @date 2015年12月31日 下午5:18:25
*
*/
public class Datum {
/**
* 椭球
*/
private Ellipsoid ellipsoid;
/**
* 转换参数
*/
private SevenParameter towgs84;
/**
* 正方向
* {@link cn.comnav.coord.api.PositiveDirection}
*/
private int posDir;
/**
* 方位角起算点
* {@link cn.comnav.coord.api.AzimuthZero}
*/
private int azimuthZero;
public Datum() {
posDir = PositiveDirection.NORTH_EAST;
azimuthZero = AzimuthZero.NORTH;
}
public Datum(Ellipsoid ellipsoid, SevenParameter towgs84) {
this(ellipsoid, towgs84, PositiveDirection.NORTH_EAST, AzimuthZero.NORTH);
}
public Datum(Ellipsoid ellipsoid, SevenParameter towgs84, int posDir, int azimuthZero) {
this.ellipsoid = ellipsoid;
this.towgs84 = towgs84;
this.posDir = posDir;
this.azimuthZero = azimuthZero;
}
public Ellipsoid getEllipsoid() {
return ellipsoid;
}
public void setEllipsoid(Ellipsoid ellipsoid) {
this.ellipsoid = ellipsoid;
}
public SevenParameter getTowgs84() {
return towgs84;
}
public void setTowgs84(SevenParameter towgs84) {
this.towgs84 = towgs84;
}
public int getPosDir() {
return posDir;
}
public void setPosDir(int posDir) {
this.posDir = posDir;
}
public int getAzimuthZero() {
return azimuthZero;
}
public void setAzimuthZero(int azimuthZero) {
this.azimuthZero = azimuthZero;
}
}
椭球Ellipsoid类:
package com.coordinate.entity;
public class Ellipsoid {
public int id;
public String ellipsoid_name;
public double semi_major_axis;
public double inv_flattening;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getEllipsoid_name() {
return ellipsoid_name;
}
public void setEllipsoid_name(String ellipsoid_name) {
this.ellipsoid_name = ellipsoid_name;
}
public double getSemi_major_axis() {
return semi_major_axis;
}
public void setSemi_major_axis(double semi_major_axis) {
this.semi_major_axis = semi_major_axis;
}
public double getInv_flattening() {
return inv_flattening;
}
public void setInv_flattening(double inv_flattening) {
this.inv_flattening = inv_flattening;
}
}
七参数类:
package com.coordinate.entity;
public class SevenParameter {
/**
* 标识使用转换的参数
* 0:无转换
* 1: 使用三参数(dx,dy,dz)转换
* 2: 使用七参数(dx,dy,dz,ex,ey,ez,ppm)转换
*/
public int flag;
public double dx;
public double dy;
public double dz;
/**
* x旋转,单位:度
*/
public double ex;
/**
* y旋转,单位:度
*/
public double ey;
/**
* z旋转,单位:度
*/
public double ez;
public double k;
public SevenParameter() {
this(0,0,0,0,0,0,0,1);
}
public SevenParameter(double dx, double dy, double dz){
this(1, dx, dy, dz, 0, 0, 0, 1);
}
/**
*
* @param dx
* @param dy
* @param dz
* @param ex x旋转,单位:度
* @param ey y旋转,单位:度
* @param ez z旋转,单位:度
* @param k
*/
public SevenParameter(double dx, double dy, double dz, double ex, double ey, double ez, double k) {
this(2, dx, dy, dz, ex, ey, ez, k);
}
/**
*
* @param flag
* @param dx
* @param dy
* @param dz
* @param ex x旋转,单位:度
* @param ey y旋转,单位:度
* @param ez z旋转,单位:度
* @param k
*/
private SevenParameter(int flag, double dx, double dy, double dz, double ex, double ey, double ez, double k) {
super();
this.flag = flag;
this.dx = dx;
this.dy = dy;
this.dz = dz;
this.ex = ex;
this.ey = ey;
this.ez = ez;
this.k = k;
}
public int getFlag() {
return flag;
}
public void setFlag(int flag) {
this.flag = flag;
}
public double getDx() {
return dx;
}
public void setDx(double dx) {
this.dx = dx;
}
public double getDy() {
return dy;
}
public void setDy(double dy) {
this.dy = dy;
}
public double getDz() {
return dz;
}
public void setDz(double dz) {
this.dz = dz;
}
public double getEx() {
return ex;
}
public void setEx(double ex) {
this.ex = ex;
}
public double getEy() {
return ey;
}
public void setEy(double ey) {
this.ey = ey;
}
public double getEz() {
return ez;
}
public void setEz(double ez) {
this.ez = ez;
}
public double getK() {
return k;
}
public void setK(double k) {
this.k = k;
}
}
投影类:
package com.coordinate.entity;
import java.util.List;
public class Projection {
public int id;
public String name;
public List<Parameter> parameters;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<Parameter> getParameters() {
return parameters;
}
public void setParameters(List<Parameter> parameters) {
this.parameters = parameters;
}
}
高程拟合类:
package com.coordinate.entity;
/**
* 高程拟合参数
* @author LiShuai
* @date 2020/4/20 16:53
*/
public class FittingParameter {
/**
* 是否使用
*/
private boolean use;
private double a0;
private double a1;
private double a2;
private double a3;
private double a4;
private double a5;
private double x0;
private double y0;
/**
* 拟合方法,默认平面拟合
* @see ElevationFittingMethod
*/
private int method = ElevationFittingMethod.METHOD_PLANE_FITTING;
public FittingParameter() {
}
public FittingParameter(boolean use, double a0, double a1, double a2, double a3, double a4, double a5, double x0, double y0) {
this.use = use;
this.a0 = a0;
this.a1 = a1;
this.a2 = a2;
this.a3 = a3;
this.a4 = a4;
this.a5 = a5;
this.x0 = x0;
this.y0 = y0;
}
public boolean isUse() {
return use;
}
public void setUse(boolean use) {
this.use = use;
}
public double getA0() {
return a0;
}
public void setA0(double a0) {
this.a0 = a0;
}
public double getA1() {
return a1;
}
public void setA1(double a1) {
this.a1 = a1;
}
public double getA2() {
return a2;
}
public void setA2(double a2) {
this.a2 = a2;
}
public double getA3() {
return a3;
}
public void setA3(double a3) {
this.a3 = a3;
}
public double getA4() {
return a4;
}
public void setA4(double a4) {
this.a4 = a4;
}
public double getA5() {
return a5;
}
public void setA5(double a5) {
this.a5 = a5;
}
public double getX0() {
return x0;
}
public void setX0(double x0) {
this.x0 = x0;
}
public double getY0() {
return y0;
}
public void setY0(double y0) {
this.y0 = y0;
}
public int getMethod() {
return method;
}
public void setMethod(int method) {
this.method = method;
}
@Override
public String toString() {
return "ElevationFittingParameter{" +
"use=" + use +
", a0=" + a0 +
", a1=" + a1 +
", a2=" + a2 +
", a3=" + a3 +
", a4=" + a4 +
", a5=" + a5 +
", x0=" + x0 +
", y0=" + y0 +
", method=" + method +
'}';
}
}
四参数类:
package com.coordinate.entity;
/**
* 四参数
* @author LiShuai
* @date 2020/6/3 17:45
*/
public class FourParameter {
/**
* 是否使用四参数
*/
private boolean isUse;
/**
* 北原点
*/
private double x0;
/**
* 东原点
*/
private double y0;
/**
* 北平移量
*/
private double x1;
/**
* 东平移量
*/
private double y1;
/**
* 旋转角度
*/
private double ro;
/**
* 比例因子
*/
private double scale;
public FourParameter() {
}
public boolean isUse() {
return isUse;
}
public void setUse(boolean use) {
isUse = use;
}
public double getX0() {
return x0;
}
public void setX0(double x0) {
this.x0 = x0;
}
public double getY0() {
return y0;
}
public void setY0(double y0) {
this.y0 = y0;
}
public double getX1() {
return x1;
}
public void setX1(double x1) {
this.x1 = x1;
}
public double getY1() {
return y1;
}
public void setY1(double y1) {
this.y1 = y1;
}
public double getRo() {
return ro;
}
public void setRo(double ro) {
this.ro = ro;
}
public double getScale() {
return scale;
}
public void setScale(double scale) {
this.scale = scale;
}
@Override
public String toString() {
return "FourParameter{" +
"isUse=" + isUse +
", x0=" + x0 +
", y0=" + y0 +
", x1=" + x1 +
", y1=" + y1 +
", ro=" + ro +
", scale=" + scale +
'}';
}
}
投影ID定义:
package com.coordinate.constant;
/**
* 投影ID定义
* @author ChenQiang
* @date 2016年1月4日 上午9:11:21
*
*/
public interface ProjectionIDS {
/**
* 高斯-克吕格投影
*/
public static final int GAUSS_KRUGER = 0;
/**
* LAMBERT 等角切圆锥投 影1
*/
public static final int LAMBERT_CONFORMAL_CONIC1 = 1;
/**
* LAMBERT 等角割圆锥投 影2
*/
public static final int LAMBERT_CONFORMAL_CONIC2 = 2;
/**
* 墨卡托
*/
public static final int MERACTOR = 4;
/**
* 卡西尼投影
*/
public static final int CASSINI_SOLDNER = 6;
/**
* 横轴墨卡托投影
*/
public static final int TRANSVERS_MERCATOR= 7;
/**
* 斜轴墨卡托2点投影
*/
public static final int OBLIQUE_MERCATOR = 12;
/**
* 洪特尼斜轴墨卡托投影
*/
public static final int HOTINE_OBLIQUE_MERCATOR_A = 13;
/**
* 洪特尼斜轴墨卡托投影
*/
public static final int HOTINE_OBLIQUE_MERCATOR_B = 9815;
/**
* 斜轴墨卡托投影角度
*/
public static final int OBLIQUE_MERCATOR_ANGLE_RSC= 15;
/**
* 斜轴球面投影(双重) 30
*/
public static final int OBLIQUE_STEREOGRAPHIC_DOUBLE = 16;
/**
* 斜轴球面投影(双重) 70
*/
public static final int OBLIQUE_STEREOGRAPHIC_DOUBLE70 = 17;
/**
* ALBERS 等面积圆锥投影
*/
public static final int ALBERS_EQUAL_AREA_CONIC = 22;
/**
* 正交投影
*/
public static final int ORTHOGRAPHIC = 30;
/**
* 新西兰地图格网
*/
public static final int NEW_ZEALAND_MAP_GRID = 31;
/**
* 英国国家格网
*/
public static final int UNITED_KINGDOM_NATIONAL_GRID = 32;
/**
* UPS北
*/
public static final int UPS_NORTH = 33;
/**
* UPS南
*/
public static final int UPS_SOUTH = 34;
/**
* 通用横轴墨卡托投影
*/
public static final int UNIVERSAL_TRANSVERSE_MERCATOR = 35;
/**
* Krovak斜轴正形圆锥投影 [Krovak (North Orientated)]
*
* epsg coordinate operation method:1041
* https://epsg.org/coord-operation-method_1041/Krovak-North-Orientated.html
*/
public static final int KROVAK_NORTH_ORIENTATED = 1041;
/**
* Krovak斜轴正形圆锥投影[Krovak Modified (North Orientated)]
*
* epsg coordinate operation method:1043
* https://epsg.org/coord-operation-method_1043/Krovak-Modified-North-Orientated.html?sessionkey=euyhq0id0e
*/
public static final int KROVAK_MODIFIED_NORTH_ORIENTATED = 1043;
}