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

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

  1. luchian

    luchian Administrator Staff Member

    Joined:
    Jun 3, 2014
    Messages:
    3,007
    Likes Received:
    1,493
    Fantastic to work with this kind of reference data !
     
  2. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    So.... I've got Geoserver running. I've created an enormous geotiff file of the North York Moors at 50cm resolution. I can load the URL into QGIS and query the layer and I'm getting good data back. The formatting is similar to the Scotland data I've been using.

    upload_2018-1-10_19-26-0.png

    So I've copied the URL into the config.php and that should be all I need to do, I think. Except that I'm not getting anything at all via the test page (localhost/maps/)

    upload_2018-1-10_19-27-36.png

    I don't know if this has anything to do with it

    upload_2018-1-10_19-29-58.png
     
    Wurstkoffer likes this.
  3. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    Uhhh nice, local geoserver. Forum user @linamza told me that he also tried to get it work. Maybe he can help.

    Which URL you copied to config.php? I hope it wasn't "http://geoserver.org/England:NZ_70_50", coze this is no local URL. It should be something like "http://localhost:8080/....." assuming your geoserver runs at port 8080, which is default. Referring to geoserver documentation, it should be "http://localhost:8080/geoserver/wms?". Don't forget the question mark, coze my cheap php code doesn't check if it exists. And i guess "England:NZ_70_50" is the layers name ($wms_elevation_layer).


    The request exceed message should come from Google. The amount of requests is limited, so you have to wait 24hrs.
     
    Les Neilson likes this.
  4. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    I'll try to get in touch with linamza then. Good to hear someone else is experimenting. The URL I pasted in was localhost:portnumber, so something has gone wrong in the translation somewhere. Okay, that gives me something to work on...
     
  5. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    By accident I seemed to have typed in an emoji code... :D

    I remember now I copied the link from the geoserver layer preview panel, and it worked in qgis. I'll check again later
     
  6. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    The main problem I think is that I'm not getting a plain text response:

    upload_2018-1-11_19-53-0.png

    In QGIS I get a different URL, but the response is as I expected. There's probably a setting in Geoserver I haven't figured out yet
     
  7. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    What happens, when you click the link in the screenshot above?
    And have you set up a location in config.php which is within the covered area?
     
  8. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    When I click the link I get

    no features were found

    Yes, I set a test location ins the right area
     
  9. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    What is the link you pasted into QGis?
    What happens when you paste it into your browser?
     
  10. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    The link I used in QGIS is

    http://localhost:65534/geoserver/En...10000.0&width=768&height=768&srs=EPSG:404000&

    In the browser it gives me this error

    <ServiceExceptionReport version="1.3.0" xsi:schemaLocation="http://www.opengis.net/ogc http://localhost:65534/geoserver/schemas/wms/1.3.0/exceptions_1_3_0.xsd"><ServiceException code="MissingParameterValue" locator="request">
    Could not determine geoserver request from http request org.geoserver.platform.AdvancedDispatchFilter$AdvancedDispatchHttpRequest@59140524
    </ServiceException></ServiceExceptionReport>
     
  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
    Hmmmm, will try to reproduce it at the weekend. Can you send me download links to the data you used? And can you tell me how do you set up geoserver?
     
  13. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    Okay... the raw data I got from the following location (but you could use anything. I use geotiff)

    http://environment.data.gov.uk/ds/survey/index.jsp#/survey?grid=NZ70

    Open the LIDAR Composite Digital Terrain Model (DTM)

    Download the four 50cm resolution files

    I then unpack these to a single folder and merge them into a single geotiff using QGIS. The result for this lot is 1.5GB
     
  14. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    To set up geoserver:

    First you need Java runtime environment version 8. Important, not 9, only 8 works with geoserver.

    Then install geoserver. It will ask for the jre folder, and the port number you want to use. I had problems using the default 8080; it crashed without any error message. Changing it seemed to solve that problem.

    Then once you get into the web admin page and log in, you can follow the online documentation for getting started. Basically, you set up a workspace, then a data store which points to the data you want to access. Then you set up a layer, and select the data store. This part defines the publishing parameters, but so far I'm pretty hazy on what all this means.

    At this point, select the Layer Preview page, and click on the OpenLayers link. This will open a new tab where you should see the data, and which you can click on and it will return altitude values.

    This is the URL I've been trying to use in config.php, so far without success. It gets no response to the GetFeatureInfo request. I'm guessing it's some setting up that still needs to be done in geoserver. I'll try the forum to see if some expert can offer some help
     
    Last edited: Jan 12, 2018
  15. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    I chose to make a single geotiff because otherwise I would have had to deal with multiple files, and although I'm sure that can be done in geoserver, it's an additional layer of complexity that I'll skip for now.

    As for setting up geoserver, I was pretty much leaving everything possible as default, and randomly pressing buttons everywhere else.
     
  16. Les Neilson

    Les Neilson Active Member

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

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    I fumbled around a bit, but I'm giving up now. This is too time consuming at the moment.

    I'm afraid merging to a GeoTIFF is not a good idea, because the individual tiles use different color palettes. A certain gray value of one tile means a different height value in another tile. But i'm not sure, maybe GeoTIFF can handle that.

    I didn't find out how to add multiple tiles to GeoServer in the fastest way. Obviously it looks like you have to add all 99 tiles individually. But i'm pretty sure there's a way to add them all together.

    When adding the ArcGrid files, please note that they are available in EPSG: 27700 (https://data.gov.uk/dataset/lidar-composite-dtm-50cm1). This must be specified at some point in GeoServer.
     
  18. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    I've never had problems with merging geotiffs; they have embedded maximum and minimum elevation values so that when you put them together they adjust correctly.
     
  19. Wurstkoffer

    Wurstkoffer Member

    Joined:
    Sep 6, 2017
    Messages:
    51
    Likes Received:
    34
    Hmm, yeah... maybe displaying the tiles in grayscale (which has limited grayscale values) is only a function of QGis. The original asc files are in ArcGrid format, which seems to be plain ASCII. But how do you convert multiple layers to GeoTIFF in QGis? I just find the ability to export a single layer. And if I group all layers, the group cannot be exported.

    However, you should define EPSG:27700 as default in QGis options before importing the ArcGRID files.
    upload_2018-1-14_14-57-26.png
     
  20. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    186
    Likes Received:
    89
    I'm not sure I understand exactly. I'm merging several tiles into a single large geotiff, not layers. I get the part about the coordinate reference system. Normally I check that the result matches another reference; other than that I don't worry too much because normally it seems that QGIS figures out most things by itself.

    This is what I do in QGIS:
    Select Raster - Miscellaneous - Merge
    Select the folder where the .asc files are. Set a name for the geotiff, and Okay
    When the processing has finished, I select a projection for display, and that's 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