Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using RQGIS3 for create GeoPDF maps #29

Open
Leprechault opened this issue Mar 19, 2021 · 0 comments
Open

Using RQGIS3 for create GeoPDF maps #29

Leprechault opened this issue Mar 19, 2021 · 0 comments

Comments

@Leprechault
Copy link

I'd like to create a GeoPDF using a ggplot map output. In my example:

#Packages
library(ggplot2)
library(ggspatial)
library(sf)
library(RQGIS3)

# Get data set - x any are the points
all.stands.predict<-read.csv("https://raw.githubusercontent.com/Leprechault/trash/main/prediction__bug_2021-03-18.csv")
all.stands.predict<-all.stands.predict[all.stands.predict[,3]=="VILA PALMA",] # Area selection

#Create a map
(sites <- st_as_sf(all.stands.predict, coords = c("x", "y"), 
                   crs = 4326, agr = "constant"))
gg <- ggplot() +
  geom_sf(data=sites, color="red") +
  annotation_north_arrow(location = "bl", which_north = "true", 
                         pad_x = unit(0.3, "in"), pad_y = unit(0.5, "in"),
                         style = north_arrow_fancy_orienteering) + #Add a north arrow
  annotation_scale(location = "bl", width_hint = 0.55) + #Add a scale bar
  xlab("Latitude") + ylab("Longitude") +
  theme_bw() 

# I inspected the map created
plot(gg))

image

Now, I need to know if there is any way using RQGIS3 for create a GeoPDF map using my gg object?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant