按照博客https://blog.csdn.net/supermapsupport/article/details/62217384写了同一个坐标系下的投影坐标转换地理坐标的函数
import com.supermap.data.CoordSysTranslator; import com.supermap.data.Point2D; import com.supermap.data.Point2Ds; import com.supermap.data.PrjCoordSys; import java.io.Console; public class ProjectToGeo { public double[] projectToGeo(double a, double b, int m) { double[] result=new double[2]; Point2D[] pts = {new Point2D(a, b)}; Point2Ds te2DS = new Point2Ds(pts); //把点击坐标转换成为同一个地理坐标系下的地理坐标 //CoordSysTranslator.inverse(te2DS, PrjCoordSys.fromEPSG(2383)); CoordSysTranslator.inverse(te2DS, PrjCoordSys.fromEPSG(m)); for (int i = 0; i < te2DS.getCount(); i++) { result[0]=te2DS.getItem(i).x; result[1]=te2DS.getItem(i).y; } return result; } public static void main(String[] args) { // ProjectToGeo projectToGeo = new ProjectToGeo(); // double[] point2Ds = projectToGeo.projectToGeo(509294.479, 2522963.686, 2383); // System.out.println(point2Ds[0]); // System.out.println(point2Ds[1]); // System.out.println(point2Ds); } }
然后生成了jar包,最后复制并且部署到了服务器上,并修改了服务器的iserver-services.xml代码。
但是最终在本机利用get方法调用可以访问得到,但是远程服务器却访问不到??