1

I've got a ".shp" file (plus the additional .dbf, .fix, .prj, .shx files) that was created using the geotools library and want to view its data using QGIS 3.8.2.

QGIS properly displays all of the points in the .shp file and clicking on the "i" button and then on one of the points displays its information at the right-hand side:

  • Name
  • ID
  • X
  • Y
  • Z

The only thing missing is the "M" value. I know this is probably a very basic question but I can't find any information about it anywhere: How do I get access to the M value?

I don't want to edit it or create new ones, I just want to see the existing one. Is there maybe any type of table that has a list of every point in the .shp file and all of its values (XYZ, M, name,...)?

TomazicM
  • 25,601
  • 22
  • 29
  • 39
Neph
  • 235
  • 1
  • 9
  • 2
    You could try running the Extract M values from the Processing Toolbox. – Joseph Sep 03 '19 at 11:29
  • 1
    Are you sure there is a M value attached to your data? – Erik Sep 03 '19 at 11:37
  • @Joseph Found it: I selected the point - "Extract M values" - selected the "Input Layer" in the new window, added all 16 "Summaries to calculate" and clicked on "run". This added an "m_first" entry on the right but the value is "NULL". Am I missing anything? – Neph Sep 03 '19 at 11:48
  • @Erik Yes, I've got the code here: It creates an ExtendedCoordinate for every point (new ExtendedCoordinate(4500000+p*10,5500000+p*p,100+p%5,p ), p is just the iterator of a "for" loop) and adds this object to a SimpleFeatureBuilder. So it should be there. Does QGIS usually display the M value right from the start? – Neph Sep 03 '19 at 11:54
  • @Joseph I also tried setting an M value with "Set M value", which created a new layer, then used "Extract M values" on the point but all "m_xxx" values are still NULL. I really think I'm missing something important here. – Neph Sep 03 '19 at 12:13
  • 1
    I suspect the shapefile itself isn't a pointzm type. Try doubling clicking the layer in the layer tree and double checking the actual layer geometry type. – ndawson Sep 03 '19 at 20:37
  • @ndawson The "Information" option lists: "Geometry: Point (PointZ)". So I'm guessing, writing the M value didn't work after all? :/ – Neph Sep 04 '19 at 08:29
  • Correct - there's no M value info there. – ndawson Sep 04 '19 at 09:09
  • The old code didn't work then. :/ I updated geotools to the latest version and now the type is automatically set to "PointZM" and there's even an M value, even though it's 0. No idea how to set it though, so if anyone knows, please post in my new question. – Neph Sep 04 '19 at 10:29
  • What is M value? – Frodo Sep 13 '19 at 06:29
  • 1
    @nagib First google result. – Neph Sep 13 '19 at 08:12

0 Answers0