For my projects I've using the library LatLongLib, from Ahmed Taha. I think that it's very easy to convert coordinates from the UTM system to the Latitude-Longitude system and vice-versa. You just need to play with the classes UTMUtils, UTMPoint and LatLonPoint.
Time ago I also considered choosing Jcoord. It was easy and straight to the point too. However, I needed to use the WGS84 ellipsoid and, at that time, only LatLongLib seemed to have that feature.
I've successfully been able to convert UTM coordinates (30N, this is, 30 zone and northern hemisphere) to Latitude and Longitude. See my example below:
发布评论
评论(5)
没有图书馆,什么都没有。 复制这个!
使用这两个类,您可以将度数(纬度/经度)转换为 UTM,反之亦然!
No Library, No Nothing. Copy This!
Using These Two Classes , You can Convert Degree(latitude/longitude) to UTM and Vice Versa!
我能够使用 Geotools 2.4 来获得一些有用的东西,基于一些 示例代码。
I was able to use Geotools 2.4 to get something that works, based on some example code.
坐标转换实际上只需几行代码即可完成:
这会将经度/纬度坐标 (EPSG:4326) 转换为 Web 墨卡托投影 (EPSG:3857) 坐标。
您只需要在构建工具(例如maven)中依赖以下两个GeoTools库:
这个答案建立在问题/答复。 发布我的回复是因为这里当前的答案似乎相当冗长。
The transformation of a coordinate can actually be done in only a few lines of code:
This will transform a longitude/latitude coordinate (EPSG:4326) into Web Mercator projection (EPSG:3857) coordinate.
You just need to depend on the following two GeoTools libraries in your build tool (e.g. maven):
This answer builds on a question/reply on gis.stackexchange.com. Posted my reply because the current answers here seem to be quite verbose.
在我的项目中,我使用了来自 Ahmed Taha 的库 LatLongLib。 我认为将坐标从 UTM 系统转换为纬度-经度系统非常容易,反之亦然。 您只需要使用 UTMUtils、UTMPoint 和 LatLonPoint 类即可。
前段时间我也考虑过选择Jcoord。 这也很简单,开门见山。 然而,我需要使用 WGS84 椭球体,当时似乎只有 LatLongLib 具有该功能。
For my projects I've using the library LatLongLib, from Ahmed Taha. I think that it's very easy to convert coordinates from the UTM system to the Latitude-Longitude system and vice-versa. You just need to play with the classes UTMUtils, UTMPoint and LatLonPoint.
Time ago I also considered choosing Jcoord. It was easy and straight to the point too. However, I needed to use the WGS84 ellipsoid and, at that time, only LatLongLib seemed to have that feature.
您可以使用此项目 https://github.com/Berico-Technologies/Geo -Coordinate-Conversion-Java/,使用 jitpack 将其添加到现有的 pom.xml 中。
我已经成功地将 UTM 坐标(30N,即 30 区和北半球)转换为纬度和经度。 请参阅下面的示例:
请注意,Point 类属于 com.vividsolutions.jts.geom.Point 类类型。
You can use this project https://github.com/Berico-Technologies/Geo-Coordinate-Conversion-Java/, adding it to your existing pom.xml using jitpack.
I've successfully been able to convert UTM coordinates (30N, this is, 30 zone and northern hemisphere) to Latitude and Longitude. See my example below:
Note that Point class is of com.vividsolutions.jts.geom.Point class type.