java代码坐标转平面,java绘制坐标系

java中怎么将经纬度转换为平面坐标,用的是j

地图Web服务API为开发者提供http接口,即开发者通过http形式发起检索请求,获取返回json或xml格式的检索数据。

创新互联网站建设公司一直秉承“诚信做人,踏实做事”的原则,不欺瞒客户,是我们最起码的底线! 以服务为基础,以质量求生存,以技术求发展,成交一个客户多一个朋友!专注中小微企业官网定制,成都网站建设、成都做网站,塑造企业网络形象打造互联网企业效应。

用java 发起http请求

用java 解析json/xml数据

应该ok吧

用java编写平面坐标类Point并测试

运行结果:

public class Pointtest {

public static void main(String[] args) {

Point point1 = new Point(0,0);

Point point2 = new Point(5,5);

Point point3 = new Point(5,5);

System.out.println(point1.equals(point2));

System.out.println(point2.equals(point3));

System.out.println(Point.distance(point1,point2));

System.out.println(Point.distance(point1,5,5));

System.out.println(Point.distance(0,0,5,5));

}

}

class Point{

private  int x;

private  int y;

public Point() {

super();

// TODO Auto-generated constructor stub

}

public Point(int x, int y) {

super();

this.x = x;

this.y = y;

}

public int getX() {

return x;

}

public void setX(int x) {

this.x = x;

}

public int getY() {

return y;

}

public void setY(int y) {

this.y = y;

}

@Override

public int hashCode() {

final int prime = 31;

int result = 1;

result = prime * result + x;

result = prime * result + y;

return result;

}

@Override

public boolean equals(Object obj) {

if (this == obj)

return true;

if (obj == null)

return false;

if (getClass() != obj.getClass())

return false;

Point other = (Point) obj;

if (x != other.x)

return false;

if (y != other.y)

return false;

return true;

}

public String toString() {

return "Point [x=" + x + ", y=" + y + "]";

}

public static double distance(int x, int y,int a,int b) {

return Math.sqrt((Math.pow((x-a), 2)+Math.pow((y-b), 2)));

}

public static double distance(Point p,int a,int b) {

return Math.sqrt((Math.pow((p.getX()-a), 2)+Math.pow((p.getY()-b), 2)));

}

public static double distance(Point a,Point b) {

return Math.sqrt((Math.pow((a.getX()-b.getX()), 2)+Math.pow((a.getY()-b.getY()), 2)));

}

}

经纬度转平面坐标系java代码

定一个原点。 定一个比例尺 然后根据点与原点的距离,得到坐标,再通过与原点的坐标比,得到距离,再转成经纬度


网站标题:java代码坐标转平面,java绘制坐标系
链接URL:http://scyanting.com/article/hoddcs.html