Search Unity

[Released] GIS Terrain Loader

Discussion in 'Assets and Asset Store' started by UnityGISTech, Aug 12, 2019.

  1. Arthur-LVGameDev

    Arthur-LVGameDev

    Joined:
    Mar 14, 2016
    Posts:
    183
    I'm more looking for a "custom parser" than I am for "do this based on X tag". Basically, I'd like to see an interface (or an abstract class) that we can implement to precisely [and performantly] parse data as we wish. That said, the code in this case is relatively simple & we've "reverse-engineered" it enough to see how it works and can write our own code/parsing.

    It would be much nicer if it was an abstract or interface implementation for parsing though -- and definitely, include the default [concrete] implementations (ie the ones that are there as standard now). Basically, instead of using compiler defines for "EasyRoads 3D" etc -- make a single "parser" abstract class [or interface], and then implement that twice (once for LineRenderer & once for EasyRoads3D) for the product you ship.

    That then allows more advanced customers, like us, to write our own parser without having to get into your code and cause issues when attempting to upgrade / merge with the "upstream". For instance, we're writing our road parsing to take in JSON [data from OSM's Overpass-Turbo API, with output format = JSON], and then to use a high-performance rendering method to display [tens of thousands of] roads -- just as one example.

    Another question -- and, like before, I admit that I haven't investigated too far yet, so apologies in advance!
    Is there a way for us to use your library to ingest arbitrary spatial GeoTiff data and then use your tool to query against that GeoTiff for the values at a Lat/Lon coordinate?

    Context / Example
    We have a server-side system that lets us make an HTTP request with geo-bounds & then our server spits back either 1 GeoTiff with ~10 different bands of data [ideal], or it can optionally spit back multiple GeoTiffs [one for each data-set -- less ideal]. Our data-sets are essentially totally "arbitrary" -- along the lines of "risk of lightning-strike [at position]", they're just encoded as GeoTiff, including the appropriate meta-data for projection, bounds, etc... Server side is just using GDAL under the hood, it's a small server that queries against a bigger data-set and then uses GDAL to 'crop' the requested data and passes it back. Again, the data is 'arbitrary' / application-specific; the bounds are generally the same [or close] to the terrain that we import via your tool, the key thing is we'd like to be able to query like so:
    var tif = data.Import(local_path_to_geotif); // already in StreamingAssets dir
    float valueAtPosition = tif.Query(int GeotiffBandID, Vector2Double LatLon);



    Summarized Question:
    Is there a utility method/way to use your asset that would allow us to ingest 'arbitrary' data, similar to what's in the example pseudo-code above -- so that we can sample a Geotif's band at a given geo-coordinate (Lat/Lon)? If so, can you guide me towards what API method(s) I should be looking at, please? =D

    Ty!!
     
    Last edited: Sep 18, 2021
  2. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    137
    Hi,
    Thanks for touching on several important points, I will try to update the vector loader to simplify data management. Give me a few days I'll send you a message once the update is available.

    Best Regards
     
  3. Arthur-LVGameDev

    Arthur-LVGameDev

    Joined:
    Mar 14, 2016
    Posts:
    183
    Thank you, appreciate the prompt response & the active development!

    Just to confirm -- there is currently NOT a way for me to do the "arbitrary GeoTiff data querying" part? Is that something you'll be able to add, as well?

    Thanks again!
     
  4. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    137
    Hi,
    - am actually working on Vector Loader, i want to get the data in the simplest way to use it easily with any custom generator.
    -You can actualy get elevation at any point on your terrain but there is no API to do that from the file directly. SoI will add it also to the update.
     
  5. Arthur-LVGameDev

    Arthur-LVGameDev

    Joined:
    Mar 14, 2016
    Posts:
    183
    To be clear, I want to use your utility to do two things:
    1. Generate terrain from a GeoTiff. This already works great!

    2. Load an arbitrary local GeoTiff file that contains arbitrary data (*NOT* elevation data). This 'arbitrary data' GeoTiff has multiple bands (see GeoTiff file spec). I then want to be able to query this 'arbitrary data' GeoTiff that I load, and be able to get the value(s) of a given band [or all bands] at a given Lat/Lon point.

      Just to reiterate my prior example pseudo-code, it's the easiest way to show what I'd like to be able to do:
      Code (csharp):
      1.  
      2. // Load local GeoTiff file
      3. var arbitraryGeoTiff = GISLibrary.LoadTiff(local_path);
      4.  
      5. // Get value of 1 band:
      6. float value = arbitraryGeoTiff.GetValue(int band_id, Vector2Double LatLon);
      7.  
      8. // Get Value of all bands:
      9. float[] values = arbitraryGeoTiff.GetValues(Vector2Double LatLon);
      10.  
      If you'd like, I can send over a small example GeoTiff file that has multiple bands of data (none of which are elevation) for you to take a look at and test against; basically it's just like an elevation GeoTiff but, instead of containing only 1 'band' of data (elevation), it instead contains multiple bands (9 or 10 in my case). And the values are arbitrary/application-specific (one band might be 'tree density'; another might be 'lightning strike probability'; another might be 'crime rate'; etc) -- truly arbitrary.

      I don't want you too "do" anything with the data -- I just want to be able to load it and then query it [by Lat/Lon] and get values back, exactly as shown in the example code above. The main goal is to let your tool handle the coordinate system/projection aspects, etc. so that we can simply write our gameplay code & only ever really worry about Lat/Lon coordinates, always using your tool to do any/all coordinate systems translations & conversions.
    I'm also interested in the improved architecture that we discussed WRT the data parsing, having it be an abstract class (or interface), so that more advanced users like ourselves can write our own optimized parsing, without having to edit your package's code.

    That said -- and I'm definitely being a "choosy beggar" here (sorry!) -- but for now we've already worked around the architecture constraint, so: #2 above is definitely more of a priority for us.

    It would be most beneficial to get support for that first [loading & querying arbitrary GeoTiffs by Lat/Lon], versus the architecture improvement refactoring. =D

    Thank you!!!

    PS -- If it'd be help you at all, more than willing to connect directly as well. Skype, Discord, email, whatever works. No worries if not, just wanted to offer in case it would help. Feel free to direct-message me here, or can email me directly as well: arthur@lvgamedev.com :)
     
    Last edited: Sep 19, 2021
  6. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    137
    Hi there,
    You can now Load your bands data via two lines of code :

    Code (CSharp):
    1.  
    2. //Read One Band Value
    3.  var Value = RasterBands.GetValue(BandNumber, new DVector2(-119.9351717486, 38.9716894617));
    4. //Read Multiple Values
    5. var RasterBands = GISTerrainLoaderTIFFLoader.LoadTiffBands("filePath");
    6. var Values = RasterBands.GetValues(RasterBands.BandsNumber, new DVector2(-119.9351717486, 38.9716894617));
    7.   foreach (var value in Values)
    8.     Debug.Log(value);
    contact me for more details.

    Best Regards
     

    Attached Files:

  7. Arthur-LVGameDev

    Arthur-LVGameDev

    Joined:
    Mar 14, 2016
    Posts:
    183
    Awesome -- just replied to your email! :)

    Top-notch support and responsiveness, couldn't be more thrilled. This is a 'gem' of an asset [and developer] -- true high-quality code & fantastic support. From experience, I can say there are very few assets [and asset developers] on the asset store that are even remotely close to being usable in a production project "out of the box". This is one such asset, and I definitely can highly recommend it. :)

    Thank you very, very much!
     
  8. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    780
    Good day

    I see the asset store description says this works on 2020.3 and higher
    upload_2021-9-24_10-27-5.png

    1)
    Could you confirm 2021.1 is fully supported, with HDRP and raytracing?

    2)
    Also, I realise very few asset store devs support beta's, but any chance this works on 2021.2?

    3)
    Also, could you confirm this asset doesnt actually download any terrain info, no heightmaps and no sat images, but instead you should download those with 3rd party software then feed it to this asset?
     
  9. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    137

    Hi there,
    1- GTL submitted with unity 2020.3.14 and tested in unity 2021.1 it works well (HDRP and Raycasting included).
    2- Still not tested in unity 2020.2 but i think there is no significant changes between 2021.1 and 2021.2, a big chance you will get no error.
    3- GTL designed to import custom geographic data and generate 3d environment, i developed a new asset called " GIS Data Downloader" , which is designed to download Real World data for offline using purpose it also helps you to directly import download data to GIS Terrain Loader (Editor-Runtime) without any configuration.

    Best Regards
     
    Last edited: Sep 24, 2021
    newguy123 likes this.
  10. steohl

    steohl

    Joined:
    Dec 26, 2013
    Posts:
    2
    I run Unity 3D 2021.1.24f1 - and GIS Terrain loader only works for standard pipe line, not HDRP. With HDRP I get an odd pink surface, even with the demo examples included (Island). Please advise.
     
  11. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    137
    Hi there,
    Read and follow the instructions indicated in the documentation
    upload_2021-10-14_6-44-53.png

    Contact me if you still have any issue.
    Best regards
     
  12. VeryBadPenny

    VeryBadPenny

    Joined:
    Jun 3, 2018
    Posts:
    14
    Hi, I've bought the Data Downloader and Terrain Loader for a visualization project - basically we want to ask "what would this look like if we build X / Y / Z here".

    I have imported some map data following the tutorial, most of it was straightforward but I cannot see how to set the Lat/Lon of the terrain object after I imported it from the TIFF file. Did I miss an option somewhere? How do I set these?

    Thanks in advance!

    upload_2021-10-16_22-58-38.png
     
  13. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    137
    Hi there,
    If your DEM is a geo-referneced file,GTL will read it and show metadata on the container panel.
    Probably your file does not contains any geo informations that's why you are getting 0 value.
    For more please upload your file to me.
    Best Regards
     
  14. VeryBadPenny

    VeryBadPenny

    Joined:
    Jun 3, 2018
    Posts:
    14
    Thanks, I just followed your tutorial on downloading free map data - these are some example settings - I'm in Unity 2021.1.22

    upload_2021-10-17_1-4-38.png

    I can't see your email address in the documentation but I can attach a zip of the TIFF file here.
     

    Attached Files:

  15. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    137
    Hi there,
    You Tiff file is correctly downloaded and generated via GTL
    upload_2021-10-17_12-6-18.png


    Contact me to track to issue :
    GISTech2008@gmail.com (Already mentioned in Support page documentation)

    Best Regards
     
  16. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    137
    GIS Terrain Loader Updated to v2.7

    Released date : Oct 19, 2021

    Terrain Loader
    - Added Support for Tiff Grayscale heightmap
    - Added Support to load elevation from Tiff with MultiBands data.
    - New API to specfic data from Tiff with MultiBands data.
    - Ability to customize EPSG for Tiff files which is not projected in one of GTL supproted projection (Require DotSpatial Lib).
    - GetElevation API improved to Get more accurate values
    - New API to Get and Set gameobject position
    upload_2021-10-19_16-18-7.png
    upload_2021-10-19_16-9-22.png
    Vector Loader
    - Vector Loader Structure updated.
    - Added ability to load 2d Geopoints
    - Added ability to generate 3d models according to the vector data
    upload_2021-10-19_16-10-11.png
    Editor Improvements
    - Added new menu item to add Runtime GTL to scene
    - Some Updates to Editor GTL interface
    - Added an asmdef to Scripts
    upload_2021-10-19_16-24-1.png

    New Scene
    - New example scene for loading geoRef data from terrain generated in Edit mode.
    - Simple scene showing how to Get and Set a real wolrd position in edit mode

    Fixed
    - WebGL warning messages

    Documentation
    - Updated to v1.7
     
unityunity