Java中不同地图投影之间的转换
在我的 GIS 应用程序中,数据有时存储在“Google Mercator”(以米为单位)中,有时存储在 WGS84 LatLon 中。 我想要一个可靠的库来轻松地以“科学”的方式转换这些数据,而不是手动弄乱它,冒着大错误的风险。
我遇到过 Proj4,它显然能够做到这一点:http://trac .osgeo.org/proj
但我找不到类似的 Java(或 Groovy)库。 鉴于这些预测在在线应用程序中越来越常见,这样的项目将非常有益。一个小罐子就太棒了:-)
有一个 Java 端口,但没有任何文件可供下载: http://www.jhlabs.com/java/maps/proj/
基本上我需要进行这种类型的转换: http://proj4js.org
知道如何在 Java 中执行此操作吗?
谢谢, 穆隆
In my GIS application the data are sometimes stored in "Google Mercator" (in meters), sometimes in WGS84 LatLon.
I'd like a reliable library to convert this data easily and in a "scientific" way, rather than messing with it manually, risking big errors.
I've come across Proj4, which apparently is able to do this: http://trac.osgeo.org/proj
but I can't find a similar library for Java (or Groovy).
Such a project would be highly beneficial, given that those projections are increasingly common in online applications. A little jar would be amazing :-)
There is a Java port, but there aren't any files to download: http://www.jhlabs.com/java/maps/proj/
Basically I need to do this type of conversion: http://proj4js.org
Any idea about how to do this in Java?
Thanks,
Mulone
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
查看 GeoTools。糟糕的是你得到的不是一个小罐子,而是大约一百个。
本教程可能会显示类似的内容你想要完成什么。
Have a look at GeoTools. The bad thing is you don't get a little jar, but about a hundred.
This Tutorial might show something similiar to what you want to accomplish.
我还推荐 GeoTools:查看 CRS 类:
http://docs .geotools.org/latest/userguide/library/referencing/crs.html
使用 Maven:
gt-epsg-hsql 基本上包含一个 HSQL 数据库,其中已经加载了 CRS 定义。但是,您也可以使用 WKT 手动加载定义:
这意味着您可以跳转到 http://spatialreference.org/,获取 OGC WKT 定义并将其插入。
此外,如果您喜欢走这条路,Proj4 确实有 JNI 绑定。
I would also recommend GeoTools: look at the CRS class:
http://docs.geotools.org/latest/userguide/library/referencing/crs.html
Using Maven:
The gt-epsg-hsql basically included a HSQL database with a load of CRS definitions already loaded. However, you can also manually load definitions using WKT:
This means you can pop on over to http://spatialreference.org/, grab an OGC WKT definition and plumb it in.
Also, Proj4 does have JNI bindings if you fancy going that route.
JH Labs 的 Java 端口现在由俄勒冈州立大学制图和地理可视化小组维护,现已发布在 GitHub 上:
https://github.com/OSUCartography/JMapProjLib
Java port by JH Labs, now maintained by the Cartography and Geovisualization Group, Oregon State University is now on GitHub:
https://github.com/OSUCartography/JMapProjLib