0

I have a shapefile of 1241 dam locations in Washington, if I open the attribute table I have only latitude and longitude. I want to convert this to a raster with counts of the number of dams in each raster cell. I am using QGIS but could also use R.

0

1 Answer 1

2

Using QGIS you firstly want to import your attribute table with the latitude and longitude data separated in two columns which I assume they already will be. Use the delimited text layer button to do this and set the appropriate CRS which will most likely be ESPG 4326 and set the X field to longitude and Y field to latitude.

enter image description here

To count the number of dams in each raster cell you first need to decide the raster cell area you want to cover. For this example lets say 1 km squared. Now you should use a local projected coordinate system so you may need to export your dams to a new layer and define a new CRS or use the reproject layer tool. For example if in the UK you would use ESPG 27700 which uses meters as its units.

You can now use the create grid tool to produce a grid of set size (in my case 1000 by 1000 meters) and set the extent you want to have it at.

You can then use the count points in polygon tool to find the number of dams inside each 1km polygon. If you wanted to you can then finish by using the rasterize tool to convert your polygon grid to a raster format and allowing you to define the raster value as the count field you have just created.

1
  • 1
    The Washington State standard CRS is EPSG:2927. It's even codified in state law(!), although I won't tell if you choose something different ;)
    – Stu Smith
    Dec 13, 2019 at 17:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.