Hot answers tagged

36

Most methods to spline sequences of numbers will spline polygons. The trick is to make the splines "close up" smoothly at the endpoints. To do this, "wrap" the vertices around the ends. Then spline the x- and y-coordinates separately. Here is a working example in R. It uses the default cubic spline procedure available in the basic statistics package. ...


27

The Raster|Extraction|Clipper tool will help you to do this. You can open the tool and then click and drag in the raster image to select the area you want to export as a new raster (Clipping mode: Extent), and then refine the exact coordinates in the Extent fields (if necessary). Probably no way to do contours on only a selection of a raster; clip it this ...


23

Yes, there are several options available in QGIS: Inverse Distance Weighting (IDW) Interpolation plugin - see this for a tutorial (archived from the original). GDAL Raster plugin - to access, click Raster > Grid (Interpolation). GDAL's interpolation is more robust because you can use other interpolation algorithms (IDW, nearest neighbor, moving average, ...


22

Yes, doable. Normally I'd suggest a partially transparent buffer, but I see why you want to do this cartographically. This could be slow, and you need to manually decide where you want the labels to go - but cartographically speaking, that's not a bad thing! Here's a screenshot... As you can see, no buffers. The raster underneath is unaffected. I've ...


22

The simple trick to select only Integer values, is to use the following syntax: Mod(Round("ELEVATION", 0)*10, 10)=0 This Multiplication by 10, makes all the values Integer, and then we select only those which are multiples of 10. In case you wish to select Multiples of some other number, just multiply 10 by the interval. To get contours at 5 m intervals, ...


21

Here we go then, a method to get some control over contour label placement, see the picture. The first thing I did was to load the contours. Next, on a new line shapefile, I drew a line from the top of the hill to the bottom (the labels in the picture are aligned with this). I then buffered the line and used the buffer to clip the contour layer. After that ...


18

In principle, you cannot do this in a unique, accurate way without reconstructing something like the original DEM. Let's see why, by doing the computation with a (difficult but realistic) example. It begins with a small portion of a 30 meter DEM, about 15 by 11 kilometers. Contours have been computed at regular intervals: this is where you begin. To ...


15

Evaluation of the options Contour lines represent continuous surfaces, so their comparison ultimately is a proxy for comparing those surfaces. Because both the surface values (elevations) and locations are potentially subject to error, there are two components to the comparison: in terms of value and in terms of position. The two cannot be separated, ...


14

Cartographic rules to represent the relief as contours are presented in Imhof's famous book on relief representation, chapter C. Some of these rules are given on this wikipedia page. The main recommendation when simplifying contours it to preserve the terrain main characteristics. Smoothing the contours independently do not prevent them to overlap: It is ...


13

In QGIS 2.6 (maybe earlier versions as well, I don't know) you can do this under the Layer Properties, Labels tab, Rendering section. About halfway down the list of rendering options is a button that will let you write an expression which will define the list of features that will actually be labeled. Your expression would be something like "Elevation" IN (...


11

You've started in the right place, TopoToRaster will do what you've asked (create a seamless elevation model from contours). There are a lot of options and it can be a bear to get right, as the length of the overview implies. I found it helpful to read the documents for the source tool, ANUDEM, so I could understand more of the theory. Before that though, ...


11

One approach would be to load the contour layer and style it. Then load the same layer again and apply a filter (right-click on the layer and go down to 'Filter..') Use a filter expression similar to the one shown in the picture. In my case I wanted major contours at vertical intervals of 50 metres and the field containing the elevation values was called "...


11

I've experienced the same problems you area having in your second method. I exported a Raster to a Vector and try to and use v.generalise and I get mostly smooth polygons with the occasional 'stepped' boundary which appears to have been unaffected by the algorithm. I found a process that worked for my task, not sure if its the best way but thought i'd share ...


10

Assuming you have Spatial Analyst license: Interpolation: Spatial Analyst Tools -> Interpolation -> IDW ('Z value field' parameter will be your 'P' field). Reclassification of interpolated surface into 3 zones: Spatial Analyst Tools -> Reclass -> Reclassify Specify interpolated surface and ranges of desired classes: 0 - 5,... Now you have a raster which ...


10

GRASS has also many options http://grass.osgeo.org/wiki/Contour_lines_to_DEM available one way or another also trough the QGIS/GRASS plugin.


10

After using v.surf.rst, it's only a question about how to display the resulting cost raster. GRASS offers r.colors to specify a color map for a raster. As far as I can see, the normal behavior of GRASS is to interpolate colors, so you you'll have to work around this: r.colors map=travel_costs color=rules 0 green 100 green 101 yellow 200 yellow 201 red ...


10

The minimum contour interval is the double vertical error (RMSE or standard deviation) of the height model. You can find that for ASTER GDEM in: Lang, R. Harold, and Roy Welch. 1999. “Algorithm theoretical basis document for ASTER digital elevation models.” It's defined by the "United States National Map Accuracy Standards (NMAS)" For example: If your ...


10

If you are looking to convert DEMs to contour lines: QGIS Plugin Contours For converting scanned topo maps to vector contour lines, Arcscan is one of the easiest (and most sophisticated) programs out there. However, there are several opensource alternatives, including a promising GRASS approach: Trace vector contours from a scanned map. Additional ...


10

I would highly recommend going through the Contour lines to DEM tutorial, available from GRASS wiki. Essentially, they describe different interpolation methods used to produce a DEM. Avoid IDW interpolation using contour lines (i.e. described in one segment of the tutorial) since this is an inappropriate use of the interpolation method. The GRASS module ...


9

The answer depends on context: if you will be investigating only a small (bounded) number of segments, you might be able to afford a computationally expensive solution. However, it seems likely that you will want to incorporate this calculation within some kind of search for good label points. If so, it is of great advantage to have a solution that either ...


9

I assume your goal is to have different stroke weights for multiples of certain values - ie, one line weight for lines that are multiples of 10M, another for multiples of 100M, and so on. The details of how to do this depend on your software, but my general approach is to open the attribute table associated with the shapefile and add a new field which will ...


9

Sirgeo, don't try to fix up contours after they are generated, the processes take a long time and will eventually lead to intersecting contours = a nightmare! Instead smooth your raster to take the lumps and bumps out - easier maths and no topology to worry about. I find resample slightly up (cellsize x 1.5) and then back down to the original (or better) ...


9

Try to do the following formula at Rule-based Style "FieldName" % 1 = 0 (Assign thick lines for 1 meter interval lines) ELSE (Assign thin lines or any other style for other interval lines) In the above image "Elevation" is the name of the field that holds the contour elevation.


8

In the GRASS GIS Wiki, there is a dedicated page for this: http://grass.osgeo.org/wiki/Contour_lines_to_DEM The page demonstrates and compares a number of different methods of converting vector contour lines into raster DEM surfaces including screenshots.


8

Solved. Just like in ogr2ogr: gdal_contour -f PostgreSQL -i 1 -nln cont iamrast.tif "PG:host=localhost user=iampg password=iampgpass dbname=iamgis"


8

Here is another query option. It largely does the same as the answers listed above but is (in my opinion) a little bit easier to customise for different scenarios. To display any contour divisible by 10 Floor(Elevation/10)=Elevation/10 To display any contour divisible by 50 Floor(Elevation/50)=Elevation/50 To display half metre contours Floor(...


8

You can download raw contours lines from the National Map Viewer. I like to download by bounding box (button highlighted in red).


8

Slope analysis is performed on a DEM (raster layer with elevation values). This is one way to do it. If your contours have an elevation value, you can use the interpolation option (raster/interpolation) to produce a DEM. For instance, here are my contours as a shapefile The attribute table do have a value for altitudes in the "elevacion" field. Now you can ...


7

You could try to make an overlay of your contour lines with the slope grid, and only show certain contour lines depending on the average value of the slope below that contour line.


7

I use the "Buffer" option on the "Label setting" tab. (Using the labels button, not the old labels option on the layer properties dialog.) This does not wipe out the contour line, as I imagine you are wanting to do, but it does make the label legible.


Only top voted, non community-wiki answers of a minimum length are eligible