vovasharing.blogg.se

Qgis create new raster layer
Qgis create new raster layer





  1. QGIS CREATE NEW RASTER LAYER SOFTWARE
  2. QGIS CREATE NEW RASTER LAYER DOWNLOAD

Gdaldem color-relief dem.tif demramp.txt demcolor.tif If we had high mountains in our DEM, brown and other colors would begin to appear. I have adjusted the ramp so that lowlands are green and the hilliest areas of Philadelphia are yellow. This particular ramp contains elevations well beyond those seen in Philadelphia, just so you can get an idea of how these ramps are created.

qgis create new raster layer

Note that the first value in the line is the elevation value of the raster, and the next three values constitute an RGB color definition for cells of that elevation.

qgis create new raster layer

Then save it in your PhiladelphiaElevation folder as demramp.txt.

QGIS CREATE NEW RASTER LAYER SOFTWARE

  • Create a new text file and add the following lines (make sure your software doesn't copy it as one big line there should be line breaks in the same places you see them here).
  • Just like in the previous step, you will define a simple color ramp using a text file and use the gdal-dem colorrelief command to apply it to the DEM. Now let's switch back to the original DEM and use the same command to put some color into it. If you add the resulting slopeshade.tif layer to QGIS, you should see this: In particular, the color-relief command colorizes a raster using the following three parameters (in order): The input raster name, a text file defining the color ramp, and the output file name. You just ran the gdaldem utility, which does all kinds of things with elevation rasters. Gdaldem color-relief slope.tif sloperamp.txt slopeshade.tif
  • Run the following command to apply the color ramp to your slope:.
  • Open your OSGeo4W command line window and use the cd command to change the working directory to your PhiladelphiaElevation folder.
  • When combined with the hillshade, this layer will cause shelfs and cliffs to pop out in your map. This creates a very simple color ramp that will shade your slope layer in grayscale with values toward 0 being lighter and values toward 90 being darker.
  • Create a new text file containing just the following lines, then save it in your PhiladelphiaElevation folder as sloperamp.txt.
  • Now let's shade the slope to provide an extra measure of relief to the hillshade when we combine the two as partially transparent layers. Each pixel in this surface has a value between 0 and 90 indicating the degree of slope in a particular cell. Save it as a TIF named slope and keep the rest of the defaults.
  • Create a slope surface by highlighting your dem layer in the table of contents and clicking Raster > Analysis > Slope.
  • Note that if you prefer the command line environment, you can make your future hillshades using the gdaldem hillshade command. Save the hillshade as a TIF file named hillshade, and set the parameters as shown in the image below. Then press Run to execute the command.
  • Create a hillshade by selecting dem in the table of contents and clicking Raster > Analysis > Hillshade.
  • See the note at the end of this walkthrough if you are eventually interested in overlaying shapefiles with your terrain.
  • Launch QGIS and use the Add Raster Layer button to add dem to your map.ĭon't add any vector layers right now.
  • If you need to do this kind of thing in the future, you can use the Raster > Projections > Warp command in QGIS, which invokes the gdalwarp command.

    QGIS CREATE NEW RASTER LAYER DOWNLOAD

    In the interest of saving time and minimizing the download size, I have already clipped this dataset to the Philadelphia city boundary and projected it to EPSG:3857 for you. This will contain a single dataset called dem. I have based these instructions on this tutorial by Mapbox that I encourage you to read later if you would like further detail.Įxtract the data to a folder named PhiladelphiaElevation, such as c:\data\PhiladelphiaElevation. This will be accomplished by adding a DEM, a hillshade, and a shaded slope layer together. We'll use a combination of GDAL tools (some of them wrapped in a nice QGIS GUI) to make a nice-looking terrain background for a basemap.

    qgis create new raster layer

    I obtained this from the USGS National Map Viewer.

    qgis create new raster layer

    For this exercise, we're going to start with a 30-meter resolution digital elevation model (DEM) for Philadelphia. Now that you've seen QGIS and OGR in action with vector data, you'll get some experience processing raster data.







    Qgis create new raster layer