【问题标题】:Convert state plane coordinates (Alaska 4) to latitude and longitude将州平面坐标(阿拉斯加 4)转换为纬度和经度
【发布时间】:2023-03-16 08:28:01
【问题描述】:

我不知道如何为我的州平面(阿拉斯加州平面区域 4 NAD83 英尺)找到正确的投影输入以与函数 sp::CRS 一起使用,这是一个问题。

我正在遵循从州平面转换的说明: Convert latitude/longitude to state plane coordinates

我已经查看了 ?CRS,它把我带到了参考资料中的http://trac.osgeo.org/proj/,但我什至无法判断这个网站是否会有我需要的东西。

我正在使用 Hadley Wickham 的教程来绘制 shapefile: https://github.com/hadley/ggplot2/wiki/plotting-polygon-shapefiles

我可以绘制任何我喜欢的 shapefile: http://munimaps.muni.org/moagis/download.htm

我的代码:

require(rgdal)
require(maptools)
require(ggplot2)
require(plyr)

  my_dsn <- "directory where the shapefile is"
  Assembly = readOGR(dsn=my_dsn, layer="assembly")
  Assembly@data$id = rownames(Assembly@data)
  Assembly.points = fortify(Assembly, region="id")
  Assembly.df = join(Assembly.points, Assembly@data, by="id")
  Assembly@data$id = rownames(Assembly@data)
  Assembly.points = fortify(Assembly, region="id")
  Assembly.df = join(Assembly.points, Assembly@data, by="id")
  #Assembly.df$DISTRICT <- factor(Assembly.df$DISTRICT)

  ggplot(Assembly.df) + 
  aes(long,lat,group=group) + 
  geom_path(color="black") +
  coord_equal() 

请帮我找到转换投影所需的输入。我是使用地图投影的新手。

【问题讨论】:

  • proj4string(Assembly) 在 readOGR 行之后直接报告什么?如果不是 NA,您最好使用 ?spTransform,所有其他内容都无济于事
  • 输出为 "+proj=tmerc +lat_0=54 +lon_0=-150 +k=0.9999 +x_0=500000.0000000001 +y_0=0 +datum=NAD83 +units=us-ft +no_defs + ellps=GRS80 +towgs84=0,0,0"
  • 我猜 googlemaps 使用墨卡托投影。我如何找到这个投影的 CRS() 输入?

标签: r gis maptools


【解决方案1】:

我建议通过 FWTools 研究使用 OGR2OGR(在 GDAL 中,我看到您正在导入)。您应该能够利用这些工具从一个投影投影到另一个投影。

应该是简单的命令行操作,比如 ogr2ogr -f "ESRI Shapefile" original.shp wgs84.shp -s_srs EPSG:27700 -t_srs EPSG:4326

http://www.mercatorgeosystems.com/blog-articles/2008/05/30/using-ogr2ogr-to-re-project-a-shape-file/

【讨论】:

  • 如果使用 R,您可以避免使用 ogr2ogr,这不一定是可取的,但这里要求这样做。此外,FWTools 已经过时了,最好使用 OSGeo4W 或其他最新的 Windows 版本。
猜你喜欢
  • 2013-09-13
  • 1970-01-01
  • 2020-02-23
  • 1970-01-01
  • 1970-01-01
  • 2011-02-11
  • 2010-10-11
  • 2013-02-24
  • 1970-01-01
相关资源
最近更新 更多