Mapping

Finding Peaks …

Finding Peaks …

Algonquin Peak

After studying the methods quite a bit, I’ve determined there is no real easy way to find peaks on mountains and report their exact elevation in QGIS. The best method I could come up with was to figure out the median point in the elevation for the map, then use that to isolate “mountains” and from there polygonize, create zonal statistics for each polygon, crop the DEM layer to each polygon then select the pixel that matched the peak. This can be done, but I couldn’t figure out how to automate it easily using the Graphical Modeler, so I would have to write a full plugin to do it. I decided it wasn’t worth the effort. In most cases, I didn’t care about the exact peak, and it would just be easier to add peaks to my maps on a case-by-case basis using a point layer with labels queried against the DEM layer.

Point 42, -74

The spot on the map you end up in Eastern NY when you are using unprojected coordinates in Eastern NY and forget to cast as a float. I wonder how many people end up at Glenhurst Stock Farm when their GPS or mapping program goes nutty.

Make Your Maps in QGIS but use R and Tidycensus to Generate Census Shapefiles πŸ—Ί

Make Your Maps in QGIS but use R and Tidycensus to Generate Census Shapefiles πŸ—Ί

Why choose when you can have it all? Seriously, QGIS makes it easy to move labels as you like and do the styling of the Shapefile or GeoPackage you generate in R with tidycensus and sf.

library(tidycensus)
library(sf)
lowincome <- get_acs(
  geography = “state”,
  table = ‘B19001’,
  year = 2020,
  output = ‘wide’,
  survey = “acs5”,
  geometry = TRUE);
lowincome$under30k <- ((lowincome$B19001_002E +lowincome$B19001_003E+ lowincome$B19001_004E+ lowincome$B19001_005E+ lowincome$B19001_006E) /lowincome$B19001_001E)*100
lowincome %>% write_sf(‘/tmp/under30k.gpkg’)

With the above R code, it will generate a GeoPackage (use extension .gpkg) or Shapefile (use extension .shp) you can use to make your map in QGIS. Then in QGIS if you want to simplify the output, you can use a geometry generator in the styles:

simplify($geometry,0.003)

Or you can specify the simplification in the R script when you run get_acs(), as it is a wrapper around the tigris package:

lowincome <- get_acs(
  geography = “state”,
  table = ‘B19001’,
  year = 2020,
  output = ‘wide’,
  survey = “acs5”,
  geometry = TRUE,
  resolution = ’20m’,
);

Neat ! R and QGIS are great tool to use together.