TUTORIAL Thomas Kaltvik - RTB plugins Ver 1.0 tutorial

Discussion in 'Tutorials' started by DeepJKL_FIN, Feb 20, 2022.

?

Is this ok?

Poll closed Feb 20, 2023.
  1. No

    20.0%
  2. Yes

    60.0%
  3. My computer is too slow

    0 vote(s)
    0.0%
  4. I like it!

    60.0%
  5. Shut up and take my money!

    20.0%
Multiple votes are allowed.
  1. DeepJKL_FIN

    DeepJKL_FIN New Member

    Joined:
    Jan 18, 2022
    Messages:
    13
    Likes Received:
    12
    EDIT: new and more detailed manual is now released at: Steam Community

    1. First the download link: Thomas Kaltvik Software Engineering Limited on GitHub
    2. If one would like to support or thank, then donate at: Marko at Thomas Kaltvik on PayPal
    upload_2022-2-20_21-14-47.png
    1. The plugin is created to version 1.0 and it supports only cellsize 1 on version 1.0. No promises about next version. My day job is getting ruined becouse of this adventure to the plugin code and tests.
    2. You need to install SQL Server to use this plugin. Select the free Developer edition, since it supports databases over 10Gb. A area covering 10x10km with index results almost 20Gb database.
    3. Once you have installed the SQL Server and made a database to it, figure out the connection string which is like:
      • Data Source = YourServerName; Initial Catalog = YourDatabase; Integrated Security = True
    4. You need Lidar data in .LAS or .LAZ format, or directly as ASCII grid with cellsize = 1 (meter).
      • There can be many tiles or just one. It is prefered to merge them to one big, but multiple works when the tiles are neighbour tiles forming a square. So 1, 4, 8 and 16 tiles is tested to work.
    5. If your data is allready in ASCII format, please jump to: 12.
    6. If you have .LAZ formated lidar, use Laszip.exe to un-pack it to .LAS format.
    7. Once in .LAS form, copy the file(s) to one folder, that is easy to access, like c:\lidar
    8. Download and install FUSION. I prefer that this is in c:\FUSION so it's easy to access.
    9. Run from Command Prompt (CMD) for all the .LAS files:
      • c:\FUSION\GroundFilter c:\lidar\outputFileName.lda 1 c:\lidar\lasfilename.las
      • c:\FUSION\GridSurfaceCreate c:\lidar\dtmOutputFileName.dtm 1 f f 1 0 0 0 c:\lidar\outputFileName.lda
      • Pay attention to those 1's and f's.. they have a meaning. You can run the Fusion commands separately like GroundFilter and it will tell you what the Switches and other options are.
      • c:\FUSION\DTM2ASCII c:\lidar\dtmOutputFileName.dtm
      • c:\FUSION\MergeRaster c:\lidar\merged.asc c:\lidar\*.asc
    10. Install and open SAGA-GIS
      • Open the merged.asc file
      • Open Geoprocessing menu -> Grid -> Gaps -> Close Gaps and process the file. The closing will take a long time so do something else that time.
      • Once it's Gapped, select Import/Export -> Grids -> Export ESRI Arc/Info Grid and save the gapped file as c:\lidar\mergedAndGapless.asc
      • Once the time consuming save is done, select once again Geoprocessing -> Terrain Analysis -> Morphometry -> Slope (Slope, aspect, curvature) and make it from the gappless grid.
      • Save the slope as image -PNG (Below is screenshot of 12kmx12km area which is 16 ASCII grids combained.
      • upload_2022-2-20_20-7-49.png
      • We can use this as the background image in RTB and we can also use it to create roads in alternative way, wich i'll tell in Tips after basic instructions.
    11. Create a project folder and copy the mergedAndGapless.asc file to there.
    12. Open RTB and select the Lidar SQL height plugin.
      • Paste the connection string
      • Click Connect (If not Success! you have something wrong with the server or string -> go figure that out.)
      • Create a new Area (or select existing empty one)
      • Click ASCII to SQL checkbox -> click Read/Write button
      • From new windows click Browse and select the folder where the .asc file is.
      • If it tells you that file(s) were found everything ok and the information should update.
      • Click Read/Write button. This might take also a lot of time and the estimate and progress bar have some bugs, so they might not always work (Before i fix them) so trust me that the process is okay and onces it's complete, the progress bar and finished time are updated. You can also check the progress in SQL Management Studio.
      • IF there is No-Data values, you will be prompted about it! NOTICE: If 0,0 has No-Data value the new venue creation will shurely fail! So please close the gaps in the data, like described above. The RTB starts the venue creation by checking the height on 0,0 and all other altitude values are compared to this. (I tried to manipulate and make a alternative method for this, but the 100% result comes only with closed gap - NO no-data values- so please follow the instructions.)
      • Close the Read ASCII form.
      • Your ASCII data is now set so that the center is 0,0. You can check the xll and yll (Lowest left corner) to verify the extents of the area. The original xll and yll are saved in the Area Info if you need them for something. Example bringing paths from Google earth to RTB. This can be done by manipulating path values XY. There is free converters for the lat/long values.
    13. Select the SQL Lidar Image plugin and set area widht. If your data is 6km*6km, set 5km*5km as an area and 6km*6km as Image Coverage. These are the values that are used and the RTB venue size is overriden by these.
    14. Select image background image size 512-16384. (The biggest is good for this.)
    15. Set Subdivide or not. Test this if problems creating a new venue.
    16. Click ok once you have set a project name.
    17. If nothing happens, gently click on the plain green area. I have noticed that some times the mouse click makes the venue to update and show gotten values from SQL as altitude changes.
    18. Install and open Irfanview
      • Open the created Slope image.
      • Resize it to the size that you selected the background to be. 512-16384.
      • Save the image somewhere as BackgroundMap.png
      • Copy the image to the newly created projects Xpacks\MyPack\Textures\
      • Say yes to overwrite. The plugin created image can be saved if you want to. This point is just a blank white.
    19. On RTB click F5 button to refresh textures.
    20. Start modelling your venue. Subdivide where needed to get more altitude points from SQL.

    upload_2022-2-20_20-47-28.jpeg

    There is also a prototype of Smoothing in the Project settings where i told you can add Roads. It only a prototype but it helps with the "noise" points in the data.
    upload_2022-2-20_20-46-57.jpeg


    TIPS:

    1. You can open the original Slope image in Inkscape and offset the image and editor so that the slope images center is on (0,0). Make also sure that the Y-axis in Inkscape is pointing positive upwards.
    2. Set Inkscape XML editor to only have Absolute values.
    3. Draw the road(s) as paths and then use Inkscape export plugins to export the XY value pairs. SOME INSTRUCTIONS on Inkscape plugins can be found here.
    4. Open RTB and open the project. Select Edit -> Venue -> Plugins -> Height and SQL lidar plugin.
    5. Click on the Roads and Information button. (Can be accessed on New Venue creation by clicking Area Info)
    6. Add Road -> Browse the file or paste to editor. Give name and save.
    7. Select the newly created road and click "Get Road altitude values from area data" and voila.. the road points have Z value. The road is automatically saved to database, so you can access it any time and add new roads. The number of roads in project/area are no restricted.
    8. Click Export to .CSV button and select where to save.
    9. Close the Venue edit window and select RTB File -> Import track and select the file just saved.
    10. Click ok and voila! nro.2, the road should be in correct place.

    This is the first version of plugin and also on this tutorial, so it will get better, if extra time merges to my use.

    Here is a video of action with 10x10km area:
    (Select for 1440px60fps quality)
     

    Attached Files:

    Last edited: Feb 25, 2022
  2. luchian

    luchian Administrator Staff Member

    Joined:
    Jun 3, 2014
    Messages:
    3,007
    Likes Received:
    1,493
    Although I don't personally use RTB, this is no doubt a fantastic contribution @DeepJKL_FIN . Thank you for your work and thank you for sharing. :)
     
    DeepJKL_FIN likes this.
  3. quetillo

    quetillo Member

    Joined:
    Mar 20, 2020
    Messages:
    363
    Likes Received:
    15
    Location:
    España
    won't let me install the SQL Server Developer,Is there any method, because I download it and it doesn't leave
     
  4. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    Wow, this is just impressive! However, I probably would prefer to model roads in Blender, since this way banking and various bumps would also be taken into account. At least if you have very high resolution source material. But for terrain generation this is just perfect.
     
  5. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    Just noticed this as I've been away from both AC and RTB for quite some time. I started writing a plugin to do something similar, using .asc elevation files. I gave up after running into problems withthe interface to RTB I couldn't figure out how to solve. I have a couple of projects I'd like to revisit if this works better than my efforts
     
  6. quetillo

    quetillo Member

    Joined:
    Mar 20, 2020
    Messages:
    363
    Likes Received:
    15
    Location:
    España
    Good morning, did this elevation project get any better?
     
  7. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    I've recently been inspired to get back into this after getting stuck with too many problems with my own plugin. It was unnecessarily complicated, and too limited at the same time. So I'm going back to Wurstkoffer's original idea, but using geoserver with a local data store. These are the advantages: Geoserver deals with all the different data types, projections, data resolution. Anything I can download and look at with QGIS or whatever, I can feed into RTB. Once it's set up, I only need to change a couple of lines in a config file and I'm ready to go. I might rewrite the tutorial if anyone's interested in trying it...
     
    NapalmCandy, quetillo and luchian like this.
  8. NapalmCandy

    NapalmCandy New Member

    Joined:
    Jun 15, 2023
    Messages:
    1
    Likes Received:
    0

    yes! I am interested in, 10 years ago I wanted to create a road near my city, but BTB was too much limited, also my knowledge in 3DStudio.

    Also a tutorial will be welcomed, better if also includes how to put original Google Maps high resolution textures or similar
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice