Frage

I have noticed that the autoplot function in OpenStreetMaps seems to change the x,y axis scale in a strange way. Contrast the map produced through ggmap:

test1=get_map(location=c(31.00302,-4.27480,41.84012,4.291),source="osm")
ggmap(test1)

Test1

and the map created by OpenStreetMap's ggplot2 compatible plotting function:

UL=c(4.29100,31.00302)
LR=c(-4.27480,41.84012)
test2=openmap(UL,LR,type="osm")
autoplot(test2)

Test2

These two should be the same, but the map produced by autoplot has longitude and latitude coordinates multiplied by 100,000. How do I make it so that autoplot does not multiply everything by 100,000?

(Just renaming everything is not sufficient. I need the underlying coordinate system to reflect the numbers used above.)

Thank You.

War es hilfreich?

Lösung

I needed to change the projection to a long/lat projection. This was accomplished by:

test2=openproj(test2, projection = "+proj=longlat") 
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top