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:
    228
    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:
    193
    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:
    228
    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:
    193
    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:
    228
    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:
    193
    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:
    228
    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:
    1,248
    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:
    193

    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:
    193
    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:
    40
    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:
    193
    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:
    40
    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:
    193
    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:
    193
    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
     
  17. Adel1986

    Adel1986

    Joined:
    Nov 9, 2021
    Posts:
    16
    Hello . I purchased. I have a problem I have imported LAS (point cloud) but the generation does not occur And it does not give errors. Could the problem be with the coordinate system?
     
  18. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Hi
    There, did you extract Pdal lib ? (Indicated in doc Importe las via pdal pipeline)
     
  19. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Instructions.
    20211110_112840.jpg
     
  20. Adel1986

    Adel1986

    Joined:
    Nov 9, 2021
    Posts:
    16
    [QUOTE = "UnityGISTech, post: 7644280, member: 834677"] Привет

    Там вы распаковали Pdal lib? (Указано в doc Importe las через pdal pipeline) [/ QUOTE]
    Распаковал по инструкции. Игроку добавлен символ GISTerrainLoaderPdal, он перезапустился и еще не получил регенерацию от Las
     
  21. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    if Las example ( found in GIS Data Example Asset) is working that means the is something wrong with your file).
     
  22. Adel1986

    Adel1986

    Joined:
    Nov 9, 2021
    Posts:
    16
    first, I think we need to import the las format into unity without regenerating the terrain
     
  23. Zaskar7777

    Zaskar7777

    Joined:
    Oct 17, 2020
    Posts:
    36
    I am interested in generating a terrain and in placing game objects in lat long coordinates. If we feed it with the coordinates required can GIS Terrain loader instantiate the game objects at the correct lat lon coordinates?
     
  24. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Hi, Yes you can instantiate a gameobject and set new position in Lat-Lon and Elevation or Get Lat-Lon position from UnityWorldSpacePosition (for more take a look at the documentation).
    in the joint file you find a simple scripts already added to GTL example scenes .
     

    Attached Files:

  25. Zaskar7777

    Zaskar7777

    Joined:
    Oct 17, 2020
    Posts:
    36
    Thanks for the response. Which option should go for?
    GIS Terrain loader or Terrain streaming?

    I am interested in loading a terrain at runtime as per the user-chosen area and then placing dynamic gameobjects at a defined lat lon.

    Here is the workflow I am looking at:

    1. User opens the Android app on the phone.
    2. Selects an area of interest - assuming a certain zoom level.
    3. Once selected a few game objects will be instantiated at a specified lat lon [fetched from CSV].
    4. This experience should work on an Android app in an AR scenario using AR Core or non-AR scenario.

    If this is possible, I am going for it right away.
     
  26. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Hi
    Hi there, by using GTL you will be able to generate a geo-referneced terrains from DEM and Raster data. You can also instantiate objects and set the position from real world to unity position and inverse.
    Loading a huge data via GTL will be expensive for your memory.
    By Using Terrain streaming you can load and unload terrains dynamicly around the player.
    You should to know that android plateforme is not supported yet (i'm working on it for the next version).

    Best Regards
     
  27. Zaskar7777

    Zaskar7777

    Joined:
    Oct 17, 2020
    Posts:
    36
    When will be the support for Android released? and please note I am looking for Ar core / AR foundation support as well.
     
    newguy123 likes this.
  28. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Hi, i'm working on it.
    I'm not sure when the next version will be released.
    I will let you know once the dev is finished.
    Best Regards
     
    Zaskar7777 likes this.
  29. olie8

    olie8

    Joined:
    Sep 12, 2014
    Posts:
    3
    Hi I am interesting with this tool and I would like to pay for it, but before that, Is this tool handle elevation below 0 under water by using bathymetry data? if it does, can you give me any tutorial to implement it for my terrain, thanks
     
  30. GiveKiss

    GiveKiss

    Joined:
    Apr 27, 2022
    Posts:
    6
      • My tif file is not recognized. Why,How to set tif file Is there any corresponding video or document
     
  31. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Hi there, sorry i didn't see your post, use you can load under water terrain, Take a look at GIS Terrain loader data example asset + Docs .
    Best Regards
     
  32. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Hi there,
    Your Tiff must be a DEM or GrayScale or contains some elevation band-Data, Take a look at the example data, you also have the documentations.
    if you have any issue with your tiff upload it and send me a link to check it out.
    Best Regards
     
  33. GiveKiss

    GiveKiss

    Joined:
    Apr 27, 2022
    Posts:
    6
    Hello, my file was exported using Globlmapper, but it still failed. I have uploaded the file. Could you please check what is the problem
     

    Attached Files:

    • Y.rar
      File size:
      883.8 KB
      Views:
      214
  34. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Hi there, your file is projected in Mercator, so you just need to use spatialLib (Check docs) or re-project your file to lat-lon.

    Best Regards
     

    Attached Files:

  35. GiveKiss

    GiveKiss

    Joined:
    Apr 27, 2022
    Posts:
    6
    The terrain loads successfully but is completely different from GlobalMapper. I created a new TIF file and exported it as an elevation grid based on your Settings. It's completely horizontal. There's no fluctuation. I put a few photos and a second TIFF file in the zip package
     
  36. GiveKiss

    GiveKiss

    Joined:
    Apr 27, 2022
    Posts:
    6
    I have sent the document to your email
     

    Attached Files:

  37. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Hi try this one.
    upload_2022-5-3_19-23-26.png
     

    Attached Files:

    • Y_2.rar
      File size:
      922.1 KB
      Views:
      198
    Last edited: May 3, 2022
  38. GiveKiss

    GiveKiss

    Joined:
    Apr 27, 2022
    Posts:
    6
    Thank you very much that this file is ok. May I ask how I should set up this TIF file so that it can be correctly recognized and whether I can record a video and send it to my email? Thank you very much! 15303960338 @163.com
     
  39. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Follow the steps
     

    Attached Files:

  40. GiveKiss

    GiveKiss

    Joined:
    Apr 27, 2022
    Posts:
    6
    Thank you very much
     
    UnityGISTech likes this.
  41. Inpixal

    Inpixal

    Joined:
    Jun 18, 2021
    Posts:
    4
    Hi.
    Issue here with very basic usage of the "GIS Data Downloader" plugin. I am unable to find downloaded data.
    Example of config below :
    upload_2022-5-16_9-48-46.png

    Only DEM download -> it seems to download something, but I have no data at all in the relevant folder :
    upload_2022-5-16_9-49-59.png

    As you can see, only a raster JPG is there, no DEM data at all. I do not see any errors in the various logs.

    Unity 2020.3.12f1, Linux Tumbleweed

    Thanks for support !
     
    Last edited: May 16, 2022
  42. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Hi there,
    Please set your terrain path correctly by clicking on the "select location" button, then change the operation to download and generate.
    It will works well.
    A new update is comming soon.

    Best Regards
     
  43. Inpixal

    Inpixal

    Joined:
    Jun 18, 2021
    Posts:
    4
    Thanks, but it is still not working :

    upload_2022-5-16_16-1-3.png

    The path is valid, and selected with "Select Location".
    And I get the following error in the Unity console :
    upload_2022-5-16_16-1-50.png
     
  44. Inpixal

    Inpixal

    Joined:
    Jun 18, 2021
    Posts:
    4
    Also another error when trying to download the raster data, same folder :
    upload_2022-5-16_16-43-27.png
     
  45. Inpixal

    Inpixal

    Joined:
    Jun 18, 2021
    Posts:
    4
    Seems to me that the GIS Data Downloader has not been tested under Linux....
     
  46. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Hi there,
    Contact me on Discord server plz
     
  47. dangtuanlinh06072001

    dangtuanlinh06072001

    Joined:
    Dec 21, 2021
    Posts:
    2
    - I have downloaded the data in "GIS Data Downloader" and when i import the .tif data into GTL the error ?
    - I also don't know how to download .flt and .prj files?
    Hope you help . thank you
    upload_2022-6-3_0-21-3.png
    upload_2022-6-3_0-24-34.png
     
  48. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Hi there,
    I'm not sure about the source of that issue.
    Send me your DEM file to my email please.
    Gistech2008@gmail.com
    Best Regards
     
    dangtuanlinh06072001 likes this.
  49. dangtuanlinh06072001

    dangtuanlinh06072001

    Joined:
    Dec 21, 2021
    Posts:
    2
    Hope you reply to my email soon. I am in dire need of your advice. thank
     
  50. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Hi i need to test your file, i didn't receive any message in my email inbox.
    Best Regards