I am trying to use data imported through one of the google maps/Bing API, and am confused about the projection. Using the APIs, data comes under a non-geographic format, such as json or xml, try:
All of this further confused by that fact that often even though the map is in Web Mercator(EPSG: 3857), the actual coordinates used are in lat-long (EPSG: 4326).
So what should I do, when I import a point, and want it, say in the final projection WGS 84 (epsg:4326)? I tried:
- Declaring as 3857, then converting to 4326: gives me a point out of space (see
point_3857_to_4326in code below: -0.00109, 0.00034)
- Declaring directly as 4326: seems to make sense (see
Where is the issue? That the points themselves are not in 3857, or that they are, but conversion is not well done? This post indicates in chapter "the solution" how to do the conversion, but I just don't get it...
Example with R:
# not run: library(ggmap) # geocode("Davis", output="latlon") library(sf) point <- st_point(c(-121.7405167, 38.5449065)) point_4326 <- st_sfc(point, crs=4326) point_3857_to_4326 <- st_sfc(point, crs=3857) %>% st_transform(4326) point_4326 point_3857_to_4326