简体   繁体   English

使用Java和任何外部库,如何将纬度/经度点绘制到地球的图形表示中?

[英]Using Java and any external libraries, how can I draw latitude/longitude points onto a graphical representation of the Earth?

I'm currently using the Java Map Projection Library (I was able to obtain the code used for the Applet from the author and modify it for use in a desktop application - not sure if he linked to that on his website yet) to draw a map of the Earth in an application. 我目前正在使用Java Map Projection Library (我能够从作者那里获取用于Applet的代码并将其修改为在桌面应用程序中使用 - 不确定他是否与他的网站上的链接相关)来绘制应用程序中的地球地图。 However, I want to take this a step further. 但是,我想更进一步。 I have a set of latitude/longitude points that I want to plot on this map - I just need to draw a circle at each point and perhaps some lines connecting the circles (points) on the map. 我有一组我想在这张地图上绘制的纬度/经度点 - 我只需要在每个点画一个圆圈,也许需要在地图上画一些连接圆圈(点)的线条。 However, as the user uses the built-in panning and zooming capabilities, the points need to be redrawn in the proper position. 但是,由于用户使用内置的平移和缩放功能,需要在正确的位置重绘点。 The best I have been able to achieve is maintaining the points when zooming, and even then the points get larger as you zoom in. 我能够实现的最好的是在缩放时保持点数,即使这样,在放大时点也会变大。

I'm totally open to switching libraries, however I really haven't found a library that can take care of drawing a world map, particularly onto a Swing component (it doesn't need to be that accurate, just show the various landmasses somewhat correctly) and also plotting additional points on top of that map and having them "stick" to various latitude/longitude coordinates. 我完全愿意切换库,但是我真的没有找到一个可以处理世界地图的库,特别是在Swing组件上(它不需要那么准确,只是在某种程度上展示各种大陆)正确地)并且还在该地图的顶部绘制附加点并使它们“粘”到各种纬度/经度坐标。

I have looked at Google Earth and NASA WorldWind, however they are awfully heavy for my purposes (I don't need anything that detailed or accurate) and it doesn't seem that easy to allow for offline use and integrate the world image view into an existing application. 我看过谷歌地球和NASA WorldWind,但它们对我的目的来说非常沉重(我不需要任何详细或准确的东西)并且它似乎不容易离线使用并将世界图像视图集成到现有的申请。

Suggestions or thoughts? 建议还是想法?

You might take a look at other components of the www.osgeo.org Java stack. 您可以查看www.osgeo.org Java堆栈的其他组件。 One of them is geotools: http://geotools.codehaus.org/ 其中一个是geotools: http ://geotools.codehaus.org/

they is also development going on to create a GUI: http://geotools.codehaus.org/GUI+Architecture 他们还在开发创建GUI: http//geotools.codehaus.org/GUI+Architecture

While I haven't used it, the SwingLabs SwingX-WS project has a "rich map viewer component." 虽然我还没有使用它,但SwingLabs SwingX-WS项目有一个“丰富的地图查看器组件”。 There's a tutorial for getting started with the map component on the Java.net page. 有一个关于Java.net页面上的map组件入门的教程。

Dealing with geospatial data can get VERY tricky quickly. 处理地理空间数据可能会非常棘手。 What approach to take depends a lot on how accurate you need to be when displaying the data. 采取什么方法取决于显示数据时您需要多准确。 GIS for Web Developers is a great book that covers the issues with geospatial data and how to get it from the data source onto the display. GIS for Web Developers是一本很好的书,它涵盖了地理空间数据的问题以及如何将数据源从数据源传输到显示器上。 It is geared to web-based displays, but the concepts are the same. 它适用于基于Web的显示,但概念是相同的。

If you do not need a high degree of accuracy a simple approach is to find an unprojected base map. 如果您不需要高度准确,一个简单的方法是找到未投影的基本地图。 With a base map it is easy to display lat/long points using simple Cartesian coordinates. 使用基本地图,可以使用简单的笛卡尔坐标轻松显示纬度/经度。

If you do need an accurate display then there really isn't a way to avoid the pretty complex libraries. 如果你确实需要一个准确的显示,那么真的没有办法避免相当复杂的库。 There is a LOT of math involved in converting geospatial data with different datums and projections into something that can be displayed to users. 将具有不同基准和投影的地理空间数据转换为可以向用户显示的内容涉及大量数学。

You should look at OpenMap . 你应该看看OpenMap

We have been using OpenMap to display GPS tracks in desktop applications for a few years. 几年来,我们一直使用OpenMap在桌面应用程序中显示GPS轨迹。 Its really pretty easy to add your own layers for the track points, history, annotations, and your own data sources. 为跟踪点,历史记录,注释和您自己的数据源添加自己的图层非常容易。 You don't need to have any external connections if you don't want it to have them. 如果您不希望它拥有它们,则不需要任何外部连接。

I looked quickly at GeoTools, but it seemed like getting started, at least a year or two ago was more complex than what we had already accomplished with OpenMap. 我很快就看了GeoTools,但似乎开始,至少一两年前比我们已经完成的OpenMap更复杂。 We've been recently exploring WorldWind , but it definitely way more that we needed. 我们最近一直在探索WorldWind ,但它绝对是我们所需要的。 OpenMap requires little in horsepower versus WorldWind which needs pretty decent video card. 与需要相当不错的视频卡的WorldWind相比,OpenMap几乎不需要马力。

I used OpenMap for an little app some time back - it's a hack, but shows how to do it. 我曾经在一段时间内使用OpenMap做一个小应用程序 - 这是一个黑客,但显示了如何做到这一点。 The app shows hurricane tracks from various years using data from NOAA. 该应用程序使用NOAA的数据显示了不同年份的飓风轨迹。 You can download it from here: 你可以在这里下载:

http://github.com/DonBranson/SnarfNOAA http://github.com/DonBranson/SnarfNOAA

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何快速估计两个(纬度、经度)点之间的距离? - How can I quickly estimate the distance between two (latitude, longitude) points? 如何在墨卡托地图(JPEG)上获得x,y的纬度,经度? - How can I get latitude, longitude from x, y on a Mercator map (JPEG)? C#中2个纬度/经度点之间的方向 - Direction between 2 Latitude/Longitude points in C# 从纬度和经度点创建位置网格 - Creating a Position Grid from Latitude and Longitude Points 使用经度和纬度,最好的方法是识别一个列表中的哪些点最接近另一列表中的每个点 - Using longitude and latitude, best method for identifying which points from one list are the closest to each point on another list 给定纬度和经度点,找到边缘点和多边形区域 - given latitude and longitude points, find edge points and polygon area 在两个数据框中匹配具有相应纬度和经度的数据点(Python) - Matching data points with corresponding latitude and longitude in two data frame (Python) 使用经度和纬度查询SQL几何数据 - Querying SQL Geometry data using Longitude and Latitude iOS映射多个纬度和经度点的最佳解决方案 - Best solution for iOS Mapping multiple latitude and longitude points 将两点之间的经度,纬度转换为x,y坐标 - Convert latitude, longitude between two points to x,y coordinates
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM