Skip to main content
13 votes
Accepted

Assigning z values to depth curves in QGIS

It's super-easy in QGIS 3.0: Run the "Set Z Value" Processing algorithm Click the button on the right of "Z Value", and select Field -> "DYBDE". Run the algorithm. The z values for the geometry's ...
ndawson's user avatar
  • 27.7k
9 votes
Accepted

Z value is lost when converting QgsGeometry to PointZ with PyQGIS

What you want is: p = QgsPoint(1,2,3) print(p) #<QgsPoint: PointZ (1 2 3)> g = QgsGeometry(p) print(g) #<QgsGeometry: PointZ (1 2 3)> p2 = g.constGet() print(p2) #<QgsPoint: PointZ (1 ...
Kalak's user avatar
  • 3,855
8 votes

QGIS: use geometry from different layer in symbology expression

Your question is very similar to what I've done here recently. I used expression: if( within($geometry,geometry(get_feature(layer,attribute,value))), result_when_true, result_when_false ) In your ...
Dan's user avatar
  • 1,070
8 votes
Accepted

Calculating real length and slope of roads

The built-in $length function will only get you the 'horizontal' length along the line, not the true length allowing for the slope. To calculate this: Take your vector layer you created using 'Points ...
David's user avatar
  • 671
7 votes

Adding z-value attribute to lines

You can use the Field Calculator to create a new elevation field, using a way similar to the point layer. The operation will give you a punctual information extract from the raster. In the line ...
Val P's user avatar
  • 3,868
5 votes
Accepted

Creating and reading z values (coordinates) with pyshp?

If you examine GeospatialPython.com: Working with Elevation Values in Shapefiles (the blog of Joel Lawhead, creator of the Pyshp module) When you read 3D shapefiles the elevation values will be ...
gene's user avatar
  • 55.1k
5 votes
Accepted

Projecting raster z-values from foot to meters?

When you project a raster from a coordinate system with a linear unit in feet to one with a linear unit in meters, it only changes the x and y units, not z. If you are working in ArcGIS and have the ...
Marina's user avatar
  • 192
5 votes

Difference between two Z-values extracted using "Extract -Z values" tool in QGIS 3

Short answer: Q3 in the field names is just a output column prefix you specified. So, Q3first is z-value of the first point of the line/polygon. Q3q3 is the third quartile of the all z values of ...
Kadir Şahbaz's user avatar
5 votes
Accepted

Using Z-Values instead of attribute Z?

I think you are mixing up to concept : elevation (z value) and height (elevation relative to the ground). For exemple an object may have a Z value (as a z coordinate) representing elevation of the ...
J.R's user avatar
  • 16.4k
5 votes
Accepted

Create cross section from 3D Polyline in QGIS

Result, visulized in 3D map view (red lines), based on your sample data: How to achieve this: Split the lines where 3D Line and Cross_section_to_generate intersect. Use Menu Processing > Toolbox &...
Babel's user avatar
  • 72.2k
4 votes
Accepted

Adding z value vertices from a point layer to a line in QGIS

You can get Z-values directly from your raster using Menu Processing / Toolbox / Drape (set z value from raster). This will output a new line layer: a copy of your initial line with z-Values for each ...
Babel's user avatar
  • 72.2k
4 votes
Accepted

Buffering with consideration of both distance and height using QGIS

Solution: basic idea Create a grid within 50 m from every point and check for each cell if its elevation is within the range of +/- 5 m from the elevation of the point. Step-by-step guide on how to ...
Babel's user avatar
  • 72.2k
4 votes
Accepted

Deleting duplicate points by attribute in shapefile using QGIS

Use Select by expression with the following expression, then use Extract Selected Features. Explanation: The expression uses overlay_nearest() with a very small distance (tolerance value) to get an ...
Babel's user avatar
  • 72.2k
4 votes
Accepted

How to auto-update field on geometryChanged() signal?

This is a simplified example. You can of course add the QMessageBox functionality back in, if you wish. p = QgsProject.instance() lyr = p.mapLayersByName('points')[0] # change for the name ...
Matt's user avatar
  • 17.4k
4 votes

How to auto-update field on geometryChanged() signal?

As much as I love using pyqgis, here is another option. You can set a default value for your Z field, and use the raster_value function in an expression to sample the elevation from the DEM raster. ...
Ben W's user avatar
  • 21.8k
3 votes

Interpolating Z at polyline vertices between known Zs

Z-values can be added to the vertices of lines by an operation called drape. This is normally done from a raster. Thus we have to get a raster, containing the interpolated z-values. What is a bit ...
Babel's user avatar
  • 72.2k
3 votes
Accepted

Cannot solely remove M value of Shapefiles

Shapefiles with Z contain also always M. See the technical specification of PointZ from https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf. Same applies to other geometry types with Z. A ...
user30184's user avatar
  • 66.8k
3 votes
Accepted

Move points to a Z-value?

Drape them onto the DEM: Drape (set Z value from raster) This algorithm sets the z value of every vertex in the feature geometry to a value sampled from a band within a raster layer.
Bera's user avatar
  • 74.3k
2 votes

Elevate points from imported DXF file to heights in LAS databse

You cannot modify a DXF with ArcGIS. If you import it to a GDB, you can then use Add Surface Information to assign the LAS dataset's elevation to your features.
GISGe's user avatar
  • 9,684
2 votes
Accepted

Z-value Error in ArcGIS Collector

It looks like you can set a default value for the z values through the admin API which might resolve your issue. Check out this support link http://support.esri.com/en/technical-article/000014234
Russ Roberts's user avatar
  • 2,503
2 votes

Assigning attributes values to PointZM and convert to LineZM Geometries in QGIS?

There are multiple ways to get to your LINESTRINGZMs. Two of those are: ogr2ogr (not in QGIS) Since I find it most straight forward here, I suggest a one-step solution using ogr2ogr, hoping that you ...
geozelot's user avatar
  • 30.3k
2 votes
Accepted

How to get z coordinate of a point using pyqgis

with QGIS 2.X, you can access to GeometryV2 by doing something like this: geometryV2 = feature.geometry().geometry() It's not really straight forward... but it's the way to do it with QGIS 2.X then ...
YoLecomte's user avatar
  • 2,895
2 votes

Dropping z-value from geometry and transfering it to new field

Extract Z values which "Extracts z values from geometries into feature attributes." Right-click the layer - Export - Save Features As and untick "Include z-dimension"
Bera's user avatar
  • 74.3k
2 votes
Accepted

Adding z-value to the triangulation output from the TIN interpolation in QGIS

You have points with z values and also lines that have z value (based on the points as vertices). You want lines with z values but with more vertices more points with z data. First solution : the ...
Corentin Lemaitre's user avatar
2 votes
Accepted

Adding Z-dimension point to layer

Try replacing "Point?crs=" with: "PointZ?crs="
Bera's user avatar
  • 74.3k
2 votes

Using Set Z-Values in QGIS Processing Modeler

If you know the name of the field, you can use an expression with the field name set as default, just select edit, and you'll get an expression builder window. Otherwise, you can use a pre calculated ...
Dror Bogin's user avatar
  • 3,485
2 votes
Accepted

QGIS Drape (set Z value from raster) to set Z-value along all pixels under a geometry (not only vertices)

You can: Buffer the line with a small distance, like the pixel size*2 Clip the raster with the buffer Raster pixel to points Shortest line between features, points as source, input line layer as ...
Bera's user avatar
  • 74.3k
1 vote

set z-value from table

In case your lines are two vertice segments, this simply translates into UPDATE <table> SET geom = ST_SetSRID( ST_MakeLine( ST_MakePoint( ...
geozelot's user avatar
  • 30.3k
1 vote

Cannot read pixel value from DTM raster with QGIS

I think it is because you use WMS layer which can be served like a tiled image - not "real" DTM. Why not to use SRTM or EU-DEM? SRTM http://dwtkns.com/srtm30m/ EU-DEM https://www.eea.europa.eu/data-...
Juhele's user avatar
  • 1,738
1 vote

Cannot read pixel value from DTM raster with QGIS

I believe the reason you cannot access the values from this DTM is because it is being served as a WMS, which QGIS is unable to obtain data from. Sometimes some WMS work as WFS if this one does, the ...
Mateusz Dąbkowski's user avatar

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