繁体   English   中英

将经度/纬度坐标转换为兰伯特等角圆锥投影

[英]Convert Longitude / Latitude coordinates to Lambert conformal conic projection

我不是地图和坐标系方面的专家。 我需要将经度和纬度坐标转换为 LCC(Lambert 等角圆锥投影)。 我有一个城市坐标列表,我需要 map 中的 plot。 问题是map的投影是"+proj=lcc +lat_1=43 +lat_2=62 +lat_0=30 +lon_0=10 +x_0=0 +y_0=0 +ellps=intl +units=m +no_defs" .

我该怎么做才能将经纬度坐标转换为 map 的投影?

在带有城市和坐标的tibble下方:

cities <- tibble(city.name = c('Lisbon', 'Barcelona', 'Brussels'),
                 lon = c(-9.139337,2.173404,4.351710),
                 lat = c(38.72225,41.38506,50.85034))

如何根据 map 的投影将这些坐标转换为坐标?

"+proj=lcc +lat_1=43 +lat_2=62 +lat_0=30 +lon_0=10 +x_0=0 +y_0=0 +ellps=intl +units=m +no_defs"

谢谢!

您可以使用具有sf sf::st_transform()的 sf package。 这会将坐标投影到sf object 中。

library(tidyverse)
library(sf)

cities <- tibble(city.name = c('Lisbon', 'Barcelona', 'Brussels'),
                 lon = c(-9.139337,2.173404,4.351710),
                 lat = c(38.72225,41.38506,50.85034))

city_proj <- "+proj=lcc +lat_1=43 +lat_2=62 +lat_0=30 +lon_0=10 +x_0=0 +y_0=0 +ellps=intl +units=m +no_defs"

cities <- st_as_sf(cities, coords = c(2, 3))
st_crs(cities) <- 4326
cities <- st_transform(cities, crs = city_proj)

ggplot(cities) + 
  geom_sf()

编辑:将初始 CRS 更改为标准 CRS。 这使得转换更有意义。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM