I m new to GIS applications and I have a little problem. I m trying to plot a polygon using geographic coordinates but I need to convert these coordinates to points before I can use them in plotting the polygon. I don t know how to convert these coordinates to points to use for the polygon. I spent all my yesterday finding out how to do this but I really still don t get it. I tried using the geography datatype in ms sql server 2008 but I couldn t find a java api in retrieving the polygon or the converted coordinates. Please help me with a sample code on how to do this.
感谢许多人!
这是我的法典。 法典
double earth=6371;
double focal=500;
double lat= 47.653 ;
double lon = -122.358 ;
double latitude = lat*Math.PI/180;
double longitude = lon*Math.PI/180;
double x = earth * Math.sin(latitude)*Math.cos(longitude);
double y = earth * Math.sin(latitude)*Math.sin(longitude);
double z = earth * Math.cos(latitude);
double projectedX = x*focal /(focal+z);
double projectedY = y * focal / (focal+z);
int magx = (int) Math.round(projectedX * 5);
int magy = (int) Math.round(projectedY *5);
System.out.println ("MAG X : "+magx);
System.out.println ("MAG Y : "+magy);
我只是把魔.X和 y带入我的多角,但没有任何进展。