1

I downloaded a TIFF image from USGS Earth Explorer from which I determined the contour lines and saved them in a shapefile (see tutorial http://www.qgistutorials.com/en/docs/working_with_terrain.html).

I would like to convert these features to points (just as this ArcGIS tool http://pro.arcgis.com/en/pro-app/tool-reference/data-management/feature-to-point.htm).

Each point should contain xyz information (simple CSV file or similar) which I can import as a surface elevation into FEFLOW (groundwater modelling)

I tried with MMQGIS which gives me the following output:

"shapeid","x","y" "1","-7.4266662066","37.1800028654" "1","-7.42583287327","37.1800083477" "1","-7.42582462244","37.1800000968" "2","-7.42583287327","37.1799959509" "3","-7.4266662066","37.1799959509" "3","-7.42749953994","37.1797223191" "3","-7.42833287327","37.1795834302" "3","-7.4291662066","37.1797917635" "4","-7.42999953994","37.1797223191" "4","-7.43083287327","37.1799959509" "4","-7.43083701921","37.1800000968" "4","-7.4316662066","37.1805556524" "4","-7.43208287327","37.1808334302"

What I want however is:

"x","y","z" "Latitude","Longitude","Elevation"

3
  • there is the option to export the .shp to .csv using the 'save-as' dialog, and there is the mmqgis plugin, which offers good control over .csv export. but I don't think you can actually export each vertex' z value, as the height is (I guess) only stored as a seperate column as contour level. could you refer to this column later in FEFLOW to get z values? you should also consider exporting the geometries as WKT (it is further explained in other question like this one; gis.stackexchange.com/questions/109553/…)
    – geozelot
    Commented May 12, 2017 at 17:59
  • ah I just saw that I linked a question that asks exactly for a solution without WKT...nonetheless, the right answer is there, too. you'll get both answers for one click, then. nice.
    – geozelot
    Commented May 12, 2017 at 18:23
  • Hi @ThingumaBob! Thank you very much for your response! Unfortunately, this doesn't do it. I modified my question to clarify what I would like to do :)
    – Stücke
    Commented May 12, 2017 at 19:57

1 Answer 1

1

In two steps:

  1. Extract nodes. Vector | Geometry Tools | Extract nodes (or from Processing Toolbox QGIS geoalgorithms | Vector geometry tools | Extract nodes
  2. Save As... the produced Nodes layer as csv file. By default, the Geometry type would be Automatic . Make sure the Layer Options is set to GEOMETRY= AS_XY. (So, basically, leave it as is).

NB the extracted nodes can create a big file. Please consider decimating it before saving it to csv.

2
  • This still exports the ID which is a little bit annoying but certainly something I can deal with!<br/> X,Y,ID,ELEV -7.45249953993674,37.1912500968475,222308,0.000 -7.45208287327007,37.1916667635141,222308,0.000 -7.45249953993674,37.1920834301808,222308,0.000 -7.45277731771452,37.1916667635141,222308,0.000 <br/> Thank you both for your support!! :)
    – Stücke
    Commented May 13, 2017 at 8:57
  • If you are using recent version such as QGIS2.18, you can select fields to export while saving it to csv.
    – Kazuhito
    Commented May 13, 2017 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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