I have two layers. Layer 1 contains points (x,y) and layer 2 contains one polygon. All points in layer 1 are positioned within the polygon of layer 2. The points in layer 1 contain an attribute with information on the topography/elevation at the specific point. Can I color the polygon in layer 2 based on attributes from the points in layer 1 in order to create an elevation map?

  • 1
    is it an option to join the 2 layers so you would have the elevation in the polygon layer? – LaughU Jun 23 '17 at 8:10

If joining the layers is an option I suggest to go the processing toolbar and there under QGIS geoalgorithms -> Vector general tools and there use the tool "Join attributes by location"

enter image description here As you can see in the Screenshot it takes several inputs so if every Polygone just contains one point you could stick with the option "Take the attributes of first ... " if not you could use the statistics. The tool will create a new layer, however. The Target layer would be your polygon layer while the points layer would be the joining layer.

Afterward just style the newly created layer with the elevation as classification value

  • Thank you for your responses. I tried using the "join attributes by location function". However, the resulting layer only contains one row of attributes. Layer 1 however, contains approximately 900,000 points which I would like to see conserved in layer 2. After all, I want to colorize layer 2 according to the information in the individual points. – Jonas Jun 23 '17 at 8:38
  • @Jonas How many polygons does your layer 2 have? because It wont add any new polygons. – LaughU Jun 23 '17 at 8:47
  • Just one polygon – Jonas Jun 23 '17 at 8:55
  • @Jonas you could rasterize your points with qgis. This seems to be the only option in that case. Besides whats your aim? – LaughU Jun 23 '17 at 9:14
  • 1
    The short answer to your question is "No." Polygons just aren't designed to do that. What you're describing is basically a raster. – csk Jun 23 '17 at 21:16

The only option I can think of is to generate a raster elevation model from the point layer, then clip that resulting raster with the polygon layer so that any cell outside of the polygon boundary are NODATA. Then you can display the raster with the polygon outline above it.

relevant tools:

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.