I am working with the CANVEC data set. The data in canvec is broken up in to mapsheets. eg. 116B04. I have data covering the entire province of the Yukon. I have merged all the data in to one shapefile but I would like to take this further by creating one feature for each line of elevation within the entire dataset. I would like to do this so that I can display things a little quicker when I load it in to QGIS but dont want to turn it in to a raster so that I can switch labelling on and off to view elevation labels. I am thinking that creating one layer out of the entire dataset and one attribute entry for each elevation. eg. 1500ft, 2500ft, 3000ft. ect. I am using UBUNTU 13.10, QGIS, GRASS, POSTGIS. I would also like to do something similar for polygons that are split into parts because of the map tiles.

  • So you already have a line shapefile of contours for all of Yukon. Is that correct? If so, then I would assume that your shapefile already is one feature for each continuous line of elevation. Are you asking how to merge all lines of 1500ft into one multiline? – Micha Nov 24 '13 at 7:01

You need to use two tools in the "Vector / Geometry" menu:

  1. "Dissolve" the layer using the elevation field as the dissolve field. How well this works depends on how well the line endpoints match up at the tile boundaries. If the endpoints don't match well enough for the lines to dissolve together, then you can use the PostGIS-based fuzzy-matching procedure described in Merging adjacent polygons in shapefile that has been split at tile boundaries?
  2. Convert "Multipart to Singlepart" to separate distinct contours at the same elevation.

In QGIS: Try Vector->Geometry Tools->Singleparts to multipart (QGIS 2.8.3). In Unique ID field select 'xxxxx' elevation attribute of input shapefile. Result - multilinestring shapefile with unique 'elevation' attribute.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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