English 中文(简体)
• 如何将长度和纬度转换成点,并利用点数绘制多角。
原标题:How to convert Longitude and Latitude to points and using the points in drawing a polygon

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带入我的多角,但没有任何进展。

问题回答

这是一套n<>/em>坐标的Syntax,用于在服务器中创建和检索一个地理多功能平台:

DECLARE @Polygon geography;
SET @Polygon = geography::STPolyFromText( POLYGON((Lon1 Lat1, Lon2 Lat2, ... Lonn Latn, Lon1 Lat1)) , 4326); 
SELECT @Polygon;

(This assumes you re using geographic coordinates relative to the WGS84 datum. If you don t know what that means, they probably are.)





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签