Exporting Qgis .asc Files

Discussion in 'PC Editor Discussion' started by Godzilla, Nov 15, 2023.

  1. Godzilla

    Godzilla New Member

    Joined:
    Oct 20, 2023
    Messages:
    28
    Likes Received:
    13
    Hello,
    I have a problem with QGIS. I don't understand how they exported the raster files the first Masterclaas as .asc.
    I just can't find this expression:(
    Please help me, I just can't get any further

    (the screenshot is from the masterclaas)
     

    Attached Files:

  2. DonnyDave

    DonnyDave Active Member

    Joined:
    Jun 29, 2020
    Messages:
    222
    Likes Received:
    106
    • Helpful Helpful x 1
  3. Godzilla

    Godzilla New Member

    Joined:
    Oct 20, 2023
    Messages:
    28
    Likes Received:
    13
    Ahh okay thanks!
    I'll read through this tomorrow. Thanks in advance:)
     
  4. DonnyDave

    DonnyDave Active Member

    Joined:
    Jun 29, 2020
    Messages:
    222
    Likes Received:
    106
    no problem, hope it helps
     
  5. RobertSchulz

    RobertSchulz Well-Known Member

    Joined:
    Oct 10, 2023
    Messages:
    1,863
    Likes Received:
    2,609
    You don't find this expression anywhere. Lukas created it and so needs to do anyone itself. I used it to convert my files to .asc in a batch process just like he did by rewriting this expression by myself.

    However, and this is an important point to notice the sub expression "left (@INPUT, 15)" does not work generically for all of us. This expression was custom made for his files because it's a modifier to the path and amount of letters he had in his path.

    Unfortunatley, I am not that familar with the language and syntax in the QGIS command menu so I don't know the right expression to helped me in my case to get all the columns filled automatically with the numbers (which the "left" function is used for).

    But I managed to get at least, to get the rendered files to all have 1. the same output path + 2. the file extension '.asc' by just writing 'F:/' + '.asc' then hit OK. Thereafter I gave the separate files all separate numbers in the rows (A tedious process, but since I don't know the correct command to generate this automatically, it at least helped me to get these 2 things done automatically.

    Take a look at the last row "Converted":

    Screenshot (8825).png

    DTG Lukas Can you explain us a bit more how one of us can costumize the expression "[OUTPUT PATH] + ? + '.asc'" to automatically attend numbers at the end of the file name as "left (@INPUT, 15) only worked in your case?

    This is something I also would liked to asked for in a separate thread.
     
  6. RobertSchulz

    RobertSchulz Well-Known Member

    Joined:
    Oct 10, 2023
    Messages:
    1,863
    Likes Received:
    2,609
    I think the way you did is way easier than with Lukas' expression. And I wish I knew the way you illustrated way sooner.

    What I did was rewriting Lukas' expression for generating the names automatically, but unfortunateley to part to create the numbers didn't work, only to set the path and the file extension '.alc'. So I ended up going with half of the expression and numbering all of the separate .asc files myself.

    Thank you for that tip. Will use it if I will need to convert files again.
     
  7. Godzilla

    Godzilla New Member

    Joined:
    Oct 20, 2023
    Messages:
    28
    Likes Received:
    13

    Attached Files:

  8. RobertSchulz

    RobertSchulz Well-Known Member

    Joined:
    Oct 10, 2023
    Messages:
    1,863
    Likes Received:
    2,609
    1. The step where you need the batch process is later on, when you need to convert the new generated .tif files to .asc files under Raster->Conversion->Translate. You are at step 1 - importing your source .tif files into QGIS but the this batch process is meant for the last step in QGIS.

    Please read the tutorial, step by step carefully up to reaching this point.

    (Scroll down in the document and you'll find the "Batch Process" section):

    Screenshot (8909).png
    Screenshot (8908).png

    2. Your Lidar tileas are completely correct. They are as grainy like that.
     
  9. Godzilla

    Godzilla New Member

    Joined:
    Oct 20, 2023
    Messages:
    28
    Likes Received:
    13
    I'm not sure whether to follow the tutorial in the document or TheTrainGuy4's video. They seem to describe things differently. Also, I think the EPSG codes are incorrect as they are not for Germany, and I'm building a German route. I'm not sure which ones I need for that.
     
  10. RobertSchulz

    RobertSchulz Well-Known Member

    Joined:
    Oct 10, 2023
    Messages:
    1,863
    Likes Received:
    2,609
    Yes, this was one of my problems too when I was at your stage. I mixed tips ans steps of several documentations and tutorials together, and ended up don't get my Lidar data correctly (It took me more than a week to get my Lidar data set up).

    It's important that you understand why which step happens. This is essential.

    And most of the steps are identical in all tutorials you can find, either Trainguy's video, Lukas masterclass or Donny's tutorial ,even if they somewhen describe different tactics to get a particual step done.

    Get a deeper understanding about the complete process, then things come more clear to you what to do when you need to do it.
    Yes, and this is something I think Donny did not mentioned enough for unexperienced people (he said something like if you like me building a UK route etc. I think).

    If you build a different route than him, you of course need to use a different EPSG code but the parts for reprojecting to EPSG: 4647 (Pseudo Mercator) is valid for everyone since this is the system the Editor uses as reference.

    I'm also building a route in Germany (Rheinland-Pfalz + Hessen) and my EPSG code is 25832 - UTM zone 32(N), but this code is dependent on the region you're building the route and might be different to the location of your route in Germany.

    You usually find the EPSG code information where you got the Lidar (Digitales Geländemodell) from. Don't know in which state you are, so I could look it up for you, but generally speaking it shouldn't be that hard too find, as it needs to be indicated closely to where you got the DGM from, as I said before.
     
    Last edited: Nov 19, 2023
  11. Godzilla

    Godzilla New Member

    Joined:
    Oct 20, 2023
    Messages:
    28
    Likes Received:
    13
    My federal state is Saxony. I got the DGM here: https://www.geodaten.sachsen.de/batch-download-4719.html
    But somehow I can't find the EPSG code here.
    I'll probably just stick to Donny's tutorial. If that works
     
  12. RobertSchulz

    RobertSchulz Well-Known Member

    Joined:
    Oct 10, 2023
    Messages:
    1,863
    Likes Received:
    2,609
    You find it under the FAQs at the main page:

    "Die bereitgestellten Geodaten werden, sofern nicht anders gekennzeichnet, im amtlichen »Koordinatenreferenzsystem« ETRS89_UTM33 (EPSG: 25833) bereitgestellt."
     
    Last edited: Nov 19, 2023
  13. RobertSchulz

    RobertSchulz Well-Known Member

    Joined:
    Oct 10, 2023
    Messages:
    1,863
    Likes Received:
    2,609
    Yes, use his. And then use Trainguys Video as reference for the practical process.
     
  14. Godzilla

    Godzilla New Member

    Joined:
    Oct 20, 2023
    Messages:
    28
    Likes Received:
    13
    Thank you:)
    I will try it again tomorrow
     
  15. protonmw

    protonmw Active Member

    Joined:
    Mar 18, 2022
    Messages:
    179
    Likes Received:
    144
    Nice! :love: Königstein / Rathen? Elbtalbahn to Bad Schandau??
    (for non Saxonies: extension from Dresden to german border ( to Praha, CZ))
     
  16. Godzilla

    Godzilla New Member

    Joined:
    Oct 20, 2023
    Messages:
    28
    Likes Received:
    13
    Yes, I want to try it:)
     
  17. Godzilla

    Godzilla New Member

    Joined:
    Oct 20, 2023
    Messages:
    28
    Likes Received:
    13

    Attached Files:

  18. Godzilla

    Godzilla New Member

    Joined:
    Oct 20, 2023
    Messages:
    28
    Likes Received:
    13
    So now I have to use EPSG 25833 instead of EPSG 4326?
    At that step?
     
  19. RobertSchulz

    RobertSchulz Well-Known Member

    Joined:
    Oct 10, 2023
    Messages:
    1,863
    Likes Received:
    2,609
    It's actually a bit more complicated as I think you mixed two steps again.

    1. I didn't do this step to set the project to the EPSG 4326. So, I had to read through the tutorial and watch the video again, what it is for in order to help you out.

    I think it is necessary to obtain the SRTM data (the low resolution height profile), since NASA's system maybe use this as reference.

    If you get your SRTM (.hgt) files in any other way (for example a website like https://dwtkns.com/srtm30m/) rather than the QGIS internal SRTM downloader which is used in both tutorials to get the SRTM files, you don't need this step with setting the project to 4326 at all. You can skip it.

    2.
    The important moment where you need to insert your EPSG code is a step later when you imported your Lidar files and want to merge them. For this, QGIS needs to know in which EPSG code your Lidar data is in. Therefore, you need to set the project to 25833.

    I think I can't help more and this already took some time away for my project to help you out.

    I really hope that you will understand the complete process better sooner or later, just like me which needed to went through a lot of problems while understanding it. But finally, I did make it.

    Remember that the experience of failure is the best teacher. If something didn't work, you know you did it wrong. Try to learn and maybe read through the tutorial a bit further first before practicing. This might help you to understand the processses and steps, and makes things more clearer what to do when exaclty and why is something necessary to do and why something might be redundant (iff) you already did something similar.
     
    Last edited: Nov 22, 2023
  20. Godzilla

    Godzilla New Member

    Joined:
    Oct 20, 2023
    Messages:
    28
    Likes Received:
    13
    I understand. Thanks for all your help. You helped me a lot. I also think that I'm starting to understand it and will soon have it done. The only thing that still causes me problems is which EPSG code I have to use when. When do I have to take mine for Saxony and when the others from the tutorial. But I'll probably understand that at some point:)
     
  21. RobertSchulz

    RobertSchulz Well-Known Member

    Joined:
    Oct 10, 2023
    Messages:
    1,863
    Likes Received:
    2,609
    The only EPSG code, we all (independent of the route) have to use is the WGS 84 Pseudo Mercator alias EPSG: 3857 which you need to use when converting the final .tif tiles to .asc files in the very last step, since this is the system the PC Editor only uses and understand.

    Think about it as the Editor does not "understand" the EPSG code 25833.

    You only need your custom EPSG code, which in your case now is 25833, to let QGIS "know" where and how the Lidar tiles, you downloaded from the Saxonian state, are located correctly. This is first step of the QGIS process. The last step where you need the Pseudo Mercator EPSG 3857 is as I said above, to convert these back into a format the Editor can understand.

    The EPSG code you mentioned of 4326 (as showed in both Donny and TrainGuy's tutorials) is only important if you want to get the SRTM data with the SRTM Downloader tool inside of QGIS, and is redundant if you like me got the SRTM data (the .hgt file/s) from outside of QGIS.

    It's also important to say that these SRTM files work just as they are and how you downloaded them in the Editor (You don't need to do anything in QGIS with them and they are also independent of the processes described here). As opposed to the Lidar data, which we need to "prepare" to being able to be understood by the Editor.

    We need to prepare the Lidar data to be read and understood by the Editor. This is exactly what this complicated process is for.
     
    Last edited: Nov 22, 2023
    • Helpful Helpful x 1
  22. Godzilla

    Godzilla New Member

    Joined:
    Oct 20, 2023
    Messages:
    28
    Likes Received:
    13
    Ah ok, so 4326 is actually unimportant. I basically give QGIS the .tif files, then tell it where I am with 25833 and then convert that to 3857 so that the editor understands it. Simply put
     
    • Like Like x 1
  23. Godzilla

    Godzilla New Member

    Joined:
    Oct 20, 2023
    Messages:
    28
    Likes Received:
    13
    Hmmm

    I have now followed everything as written in the tutorial and studied everything again. I think that I now understand the process with QGIS well and I am now at the point where I have my finished lidar data and can insert it into the editor.
    But now I have another problem...

    I now wanted to create the landscape with my SRTM files, as described in the tutorial. I did everything like in the tutorial. When I then wanted to click on “Create Landscape(s)” in the Create Tiles area, I received this error message. Can anyone help me with this?
    How I can make this file no longer read-only
     

    Attached Files:

  24. RobertSchulz

    RobertSchulz Well-Known Member

    Joined:
    Oct 10, 2023
    Messages:
    1,863
    Likes Received:
    2,609
    I remember that someone not too long ago had the same issue.

    But just let me tell you this there are two ways to create the tiles with the landscape information.

    You can either go and create every tile on its by clicking on "Create Landscapes" tile per tile. Or you can use the command "ts2ed.experimental.CreateSceneryAndLandscapeTilesFromKML 3" to create all tiles at once.

    Don't get confused by the part "FromKML", because it has nothing to do with the KML file as rather the SRTMs (.HGT Files). I raised my complaints about the confusing wording of this command also in another thread but for now this is unimportant.

    I would ask you try this command and see what happens. You need to open to the console to write it in first. This is done by the tilde key (~).

    I always use the method Lukas did in the tutorial by switching to the english keyboard layout and pressing the key left below Escape for it. The german keyboard way of holding CTRL + Alt + (+ key left from Enter) does not work in the Editor, I don't know why.

    It's a bit complicated to reach it but might can solve your problem.
     
  25. Godzilla

    Godzilla New Member

    Joined:
    Oct 20, 2023
    Messages:
    28
    Likes Received:
    13
    Alright, thank you.
    I will try it
     
  26. Godzilla

    Godzilla New Member

    Joined:
    Oct 20, 2023
    Messages:
    28
    Likes Received:
    13
    Yep, it worked. Thanks!:)

    I also just noticed that they did it that way in Masterclaas.
     
  27. Godzilla

    Godzilla New Member

    Joined:
    Oct 20, 2023
    Messages:
    28
    Likes Received:
    13
    I'm at this step now:

    Every time I want to create the lidar (at the step where you right-click in the viewport and then Apply Lidar data to selected landscape proxies...) the editor crashes. I don't know what I can do to fix it
     

    Attached Files:

  28. RobertSchulz

    RobertSchulz Well-Known Member

    Joined:
    Oct 10, 2023
    Messages:
    1,863
    Likes Received:
    2,609
    Maybe the Editor needs more PC ressources for that task. I remember the Fans sped up by using the Lidar data as selected assets.

    Is enough empty RAM and CPU given? What about the free disk space at C?

    I noticed that the Editor crashes more often when I have low disk space or too much RAM occupied.

    Clear all other tasks and try it again.

    Otherwise I only can think about that there might be an issue with Lidar data (either wrong converted or they got a fault in their own data set).
     
  29. Godzilla

    Godzilla New Member

    Joined:
    Oct 20, 2023
    Messages:
    28
    Likes Received:
    13
    It did not work. But my PC should be able to do this relatively easily.
    I will probably have to redo the lidar files again.
    But another question: Should I now create the lidar data for the entire map at once or can I import a part and then add the rest later?
     
  30. RobertSchulz

    RobertSchulz Well-Known Member

    Joined:
    Oct 10, 2023
    Messages:
    1,863
    Likes Received:
    2,609
    Yes, this is something I didn't know before, too. You don't need to do all lidar at once. You can bring the rest later in.

    Important is only that you have the Lidar files for the tiles where you want to apply it (now). You can use a small selection of lidar tiles to test.
     

Share This Page