I am using QGIS 2.18 and have plotted shapefile received from surveyor. data displays ok, now im trying to display coords of point, but the data is not in the attributes table. the xyz values appear in something called a derived table and not in the feature attributes table. when i use identify feature. the derived feature id is also different from the attributes table id number. i tried copying the feature attributes, but did not give me the derived data where the coord info resides. how can i either merge these tables or export the derived attributes table.
-
If it's just a coordinate of a point means you can create new fields (x,y,z) with appropriate length and precision. Then you can calculate x and y using the expressions $x and $y. Calculate z using expression z($geometry). Then you can label it easily using Qgis in-built functions.– Sarath SRKCommented May 29, 2018 at 4:17
-
@Gis_Boy why not post that as an answer?– lynxlynxlynxCommented May 29, 2018 at 5:24
-
I have added it as an answer!– Sarath SRKCommented May 29, 2018 at 6:26
3 Answers
If it's just a coordinate of a point means you can create new fields (x,y,z) with appropriate length and precision. Then you can calculate x and y using the expressions $x and $y. Calculate z using expression z($geometry).
Then you can label it easily using expression like this 'x = ' || "x" || ' y = ' || "y" || ' z = ' || "z" will result like the image attached below. Hope it helps for you!
-
thankyou for your answer on how to display coords on a map next to each point.– michaelZCommented Jul 16, 2018 at 4:11
You do not need to merge the tables, they are no different tables in your case, there is only one, and you do not need to export the coordinates, unless you need them somewhere else.
What you miss to know is that in GIS each vector feature has geometry data, being the point the simplest geometry data type. When you click on a geometry feature, you can have a look to the data in the attribute table and in its geometry (derivate) as in the picture below:
There are vector data that might have more than a geometry feature for row in the attribute table, but it does not seem to be your case, you probably have only a geometry feature for each row. You are right at noticing that the id
(id = 11 in the picture) is not the same as the feature id
(feature id = 10), which is essential when you have more than a geometry feature for row.
Once this background is a clear, you can change the question to "how to display the geometry properties of each geometry feature?"
You are probably familiar to display attribute data as in the picture below. Go for the epsilon instead this time, that will lead you to the Expression dialog
You can find the geometry "fields" within the Geometry
with a $
prefix
Now it is time to build the expression you want on the map. It is a bit tricky, but you will find the right format. In this exampel I have used 'x = ' || round($x,2) || ' y = ' || round($y,2)
. If it is propery built, you will see the text in the Ouput preview
.
-
thankyou for your answer, you explain very well the difference between attributes and geometry data and how to display on a map.– michaelZCommented Jul 16, 2018 at 4:06