Featured TUTORIAL Race Track Builder - Inject elevation data and terrain texture

Discussion in 'Tracks' started by Wurstkoffer, Sep 17, 2017.

  1. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    ... and the localhost page shows

    upload_2017-11-15_21-56-47.jpeg
     
  2. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    I see. Everything after the "?" is not necessary. I doubt it'll fix the problem, but try it. And send me some coordinates where you get the -999999 values.
     
  3. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    Okay,

    55.6186272568359, -5.4533306776263

    55.7746347714844, -4.58570556276981
     
  4. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    There we go. The scotland WMS indeed sends a -9999.0 value. That's not nice.

    Do the following. In config.php around line 66 add this:
    PHP:
    // There are WMS servers out there which sends extreme fake values
    // for areas outside its coverage. To compensate that, specify
    // a range in which the expected real value should lie.
    $wms_elevation_value_limit_min "-300";
    $wms_elevation_value_limit_max "9000";
    In maps\api\elevation\json\index.php change line 184 from this:
    PHP:
    else {
    to this:
    PHP:
    elseif($elevation_wms $wms_elevation_value_limit_min && $elevation_wms $wms_elevation_value_limit_max) {
     
    luchian likes this.
  5. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    Okay, let's try that... I'm actually finding this PHP stuff interesting, by the way. I've downloaded a couple of pdfs. Now to find time to read them...
     
    luchian likes this.
  6. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    Yeah, relatively easy to learn programming language for web stuff. There are a really good documentation at http://php.net/docs.php. A good editor (like the free Komodo Edit) helps with code completion. I think there are also addons for Notepad++ which upgrades code completion.
     
    luchian likes this.
  7. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    Last night it was working well at last, although slowly. Unfortunately RTB crashed so I lost it all, but I'll try again this evening. If all goes well I'll build a short stretch to see how it looks and runs. I'll post a link if anyone is interested. Even subdivided to around a metre or so I wasn't seeing any stepping and the road bed and edges were pretty well defined. So far, very positive!
     
    luchian likes this.
  8. Willy Wale

    Willy Wale Member

    Joined:
    Jan 12, 2017
    Messages:
    96
    Likes Received:
    96
    Location:
    UK
    UK LIDAR data I have looked at contains -9999 for any data point that is a body of water (lake/river/sea). It may also be the generic value for no data. So I think the 'correct' values are being returned (ie same as the source data) and as you wrote above you need to post process somehow.
     
    Wurstkoffer likes this.
  9. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    Oh nice, no steppings. Maybe they use some interpolation in these DTM/DSM layers. The layer i used is pixel based with a resolution of something like 1 pixel = 2x2 meter.

    RTB crashes might be related to RAM? But I'm not sure. I have 32GB and rarely crashes. In some sessions I may have been subdividing for 2-3 hours without interruption and RTB has retrieved elevation data from the WMS during that time. At some point I went to sleep and left RTB to itself. The next morning I saw that it was receiving elevation data for 4-5 hours after i left. And there was no crash.

    I'm really interested in your results, so of course send links! :)
     
  10. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    The lack of stepping might just be that I haven't subdivided enough to see it yet. I'll let it finish and try it out as is. Then I might try to see how far I can subdivide... In the meantime, another couple of hours and I should have something to share :)
     
    luchian likes this.
  11. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
  12. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    Nice, that was fast. Terrain looks really detailed. Just needs some flattening. And you already placed some trees, buildings and objects.
     
  13. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    Yes, fast because I only subdivided close to the road. But no visible stepping, and I was able to conform the track to the surface (well, 25% in the centre and 95% at the edges) and it seemed pretty good. I haven't driven that bit of road for maybe 20 years but it looked pretty realistic
     
  14. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    It's a shame that there's no freely available lidar data for my pet project (the Isle of Man TT circuit). It's on sale though, for £7000 :(
     
  15. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
  16. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    Another question: what happens if you save a piece of terrain and reload it before all the subdivision has been completed? Are the unsampled points eventually fixed or do they get left as they were when you quit?
     
  17. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    I'm not sure, if RTB is saving the requests and resumes after restart. I don't think so.
     
  18. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    It doesn't appear to, but that doesn't surprise me. Although I notice this: when I reloaded a track and tried to add some more detail to a section, it was okay at the beginning, then I started to get only -9999 again. So I quit out, and realised I'd hit the edge of the sample area. When I restarted RTB again it went on sending the requests that didn't get a valid response before
     
  19. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    What would be really useful: in my case there are two layers covering different areas. If the php could try one layer - if it gets a null response try the next - and if nothing works default to google data.
     
  20. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    Oh, good to hear it resumes. Multiple layers for different areas shouldn't be a problem to code. Send me the URLs and some locations and i'll take a look at it.
     
  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