如何使用rgdal软件包将NAD 83坐标转换为纬度和经度? [英] How to convert NAD 83 coordinates to latitude and longitude with rgdal package?

查看:174
本文介绍了如何使用rgdal软件包将NAD 83坐标转换为纬度和经度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有坐标,所有坐标都应位于DC中,但我不知道如何将它们从NAD 83转换为R中的经度和纬度.我在rgdal软件包中使用spTransform()函数并获取有关不合格数据的错误.

I have coordinates, all of which should be located in DC, but I cannot figure out how to convert them from NAD 83 to latitude and longitude in R. I'm using the spTransform() function in the rgdal package and get an error about non-conformant data.

library(rgdal)
nad83_coords <- data.frame(x=c(396842.6, 397886.9, 398315.5, 398154.3, 398010.3), y=c(140887.1, 139847.0, 138743.9, 139534.5, 138697.3))
coordinates(nad83_coords) <- c('x', 'y')
proj4string(nad83_coords) <- CRS("+init=epsg:4269")
Error in `proj4string<-`(`*tmp*`, value = <S4 object of class "CRS">) : 
  Geographical CRS given to non-conformant data: 398315.5 140887.1

proj4strings的其他组合会产生相同的错误.我认为错误是因为坐标太大,但是我不确定为什么会这样.坐标的文档如下:

Other combinations of proj4strings yield the same error. I believe the error is because the coordinates are too large, but I'm not sure why that would be. The documentation for the coordinates is below:

值以马里兰州立飞机仪表NAD 83地图投影为单位.

Values are in the Maryland State Plane meters NAD 83 map projection.

我对映射和投影还很陌生,我们将不胜感激.

I'm very new to mapping and projections, and any help is appreciated.

推荐答案

查找espg:4269:

Look up espg:4269:

http://spatialreference.org/ref/epsg/4269/

及其经纬度系统.因此,您的大数字(米)太大了.

and its a lat-long system. So your big numbers (which are metres) are way too big.

如果您在任何地方都有一个shapefile,这些坐标中的数据都在其中,那么您可能会带有一个.prj文件,该文件将具有投影规格,否则,您将不得不在spatialreference.org上追逐它:

If you've got a shapefile anywhere with data in these coordinates then you might have a .prj file with it that will have the projection spec, otherwise you'll have to chase it on spatialreference.org:

http://spatialreference.org/ref/?search=nad83+ maryland& srtext =搜索

NAD83上有各种各样的变体,并且在这里和那里也有状态平面".我不太清楚究竟是哪个. epsg:代码是更标准的,然后有一堆esri:代码. sr-org:这些是用户在网站上提供的.

There's assorted variations on NAD83, and there's also 'State plane' here and there. I'm not too sure precisely which is which. The epsg: codes are more standard, then there's a bunch of esri: codes. The sr-org: ones are user-supplied on the site.

esri代码看起来与您输入的文本最接近.让我们尝试一下:

The esri code looks closest enough to the text you gave. Lets try:

> proj4string(nad83_coords)=CRS("+init=esri:102285")
> spTransform(nad83_coords,CRS("+init=epsg:4326"))
SpatialPoints:
             x        y
[1,] -77.03642 38.93586
[2,] -77.02437 38.92650
[3,] -77.01942 38.91656
[4,] -77.02128 38.92368
[5,] -77.02294 38.91614

DC附近的任何地方?实际上,epsg:2804和epsg:3559给出了相同的答案,并且可能更标准" ...

Anywhere near DC? Actually, epsg:2804 and epsg:3559 give the same answers, and are probably more 'standard'...

这篇关于如何使用rgdal软件包将NAD 83坐标转换为纬度和经度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆