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

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

  1. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    Response from WMS will be slower than from google, but it shouldn't deliver zeros, if the requested location is within it's coverage (Saxony, Germany in my example code - https://www.google.com/maps/place/Saxony/).
    Google should always deliver, coze it's coverage contains the whole world.

    I assume, you replaced "MYAPIKEY" with your api key? What errors you get when you click the WMS und Google links in logfiles?
     
  2. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    Yes, I put MYAPIKEY to hide my real one. I was using the example location from your original config.php. The API key was the only thing I changed in it. On the localhost page everything seemed okay, and the elevation was 517, I think. I won't be back at my pc until sunday night, so for now I can't look at the log files
     
  3. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    This is what my log file looks like:

    upload_2017-11-8_18-37-47.jpeg
     
  4. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    Click the links above some json errors and paste the response here.
     
  5. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    Okay, this is what I see...

    upload_2017-11-8_20-14-50.jpeg

    ...which seems okay
     
  6. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    Hm yeah, looks good. Change the following in config: ini_set('display_errors', 1). And please send the log file as attatchment.
     
    luchian likes this.
  7. Les Neilson

    Les Neilson Active Member

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

    I appreciate you taking the time to help me out: I really would like to use this. I've been over the instructions again carefully, but I can't see anything I've missed. Should I look again at the steam page where you also posted this?
     

    Attached Files:

    luchian likes this.
  8. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    I think i found the problem. There is a space or %20 in front of your API key. Delete that in RTB Settings.
     
    luchian likes this.
  9. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    Okay, let me give that a try...
     
  10. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    Cool! It's working! Thank you so much.. :)
     
    luchian likes this.
  11. Wurstkoffer

    Wurstkoffer Member

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

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
  13. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    I would replace it with a Google Maps image in any case, probably
     
  14. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    yeah, leave it blank and ...
    PHP:
    $wms_orto_fetch false;
    I'm not sure how the config test page behaves. I've only ever tested it, i think, with ortho fetch from WMS enabled.
     
    luchian likes this.
  15. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    It's almost working, but look at this screenshot

    upload_2017-11-14_21-38-1.jpeg

    The problem is there's no end string to the elevation value, so it doesn't pick up the value correctly. I tried putting something from the following line, but it doesn't seem to be working. Any ideas?
     
  16. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    hmmm, try "\n" as end string. it stands for line break.
     
  17. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    Thanks again, it seems to be working now... On to the next problem ;) I'm getting a lot of negative numbers outside of the sampled area (-9999) Where in the code can I limit the elevations to zero? (or only slightly negative)
     
  18. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    Oh, apparently the WMS server you're using provides extreme values outside the covered area. The WMS server from my example returned NULL values there. Therefore, the script decides: If WMS does not return a value - take the value from Google. I'll check it out and get back to you.
     
  19. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    Can't reproduce this behaviour. I set up the elevation part in my config as follows:
    PHP:
    $wms_elevation_url "https://eo.jncc.gov.uk/geoserver/scotland/wms?";
    $wms_elevation_layer "scotland-lidar-2-dtm";
    $wms_elevation_querylayers "scotland-lidar-2-dtm";
    $wms_elevation_format "text/plain";
    $wms_elevation_response_start_str "GRAY_INDEX = ";
    $wms_elevation_response_end_str "\n";
    ... didn't changed the LAT/LON so it requested the location from my example (Saxony, Germany). The Scotland WMS delivered "no features were found". I now remember, the script validates if the response is a number. So in this case, no number is delivered. Therefore the Google value will be used and sent to RTB, as you can see in the screenshot.
    upload_2017-11-15_21-31-41.png
     
  20. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
  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