Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

KML import to Unity to create a level?

Discussion in 'Editor & General Support' started by EwanRGR, Jan 5, 2014.

  1. EwanRGR

    EwanRGR

    Joined:
    Jan 5, 2014
    Posts:
    76
    I'll begin by saying I did see the $350 product set in the asset store that is designed to allow you to use Unity to do GIS generation, add tress, etc.

    However, I really only need to do this one time as I would like to bring in an area based around a certain lake in Northern California, and then would anticipate this as being one large level with a lot of "rooms" as you move into different areas (would presume the memory requirements and time for load of bringing in the whole area at once would be prohibitive).

    That said, is there any way to bring in a KML file, or some other means of bringing in an elevation map and then adding some default textures that wouldn't be quite so heavy on the pocketbook? :D

    Thanks in advance!
     
  2. SmellyDogs

    SmellyDogs

    Joined:
    Jul 16, 2013
    Posts:
    387
    Yes, and its rather easy and quick. I wouldn't waste any money on toys from the asset store.

    I'm writing a comprehensive tutorial on the subject but its taking a while due to lack of time, so far I'm at 20 pages and it covers how to import terrain manually, how to script it and how to obtain it from a web service.

    If you have a background in GIS it should be even easier because you understand the background and terminology.

    I am using Global Mapper free edition, and exporting bing maps tiles and then simply import by hand or using a simple script.

    You mentioned KML, so if you post the source data you want to import I'll take a look and tell you how to do it. Generally I work with DTED and Geotiff formats but it might even be easier to parse KML direct to Unity. Having said that Global Mapper or Grass offer huge advantages to manipulating terrain data if you want to pre-process the data first depending on what you need to do.
     
    ryanhornbeck and jgwinner like this.
  3. EwanRGR

    EwanRGR

    Joined:
    Jan 5, 2014
    Posts:
    76
    Attached is the KML for the general area I have in mind. I suspect that to use within Unity I would need to do several of these at a higher zoom to pick out more detail from each area. Unless your method is reasonably good at filling in? This was done off an elevation view which I assumed was preferable to a satellite image. In Google Maps you simply choose to create a custom map, search for the location you are interested in, click the file folder, and choose "Export as KML".

    Let me/us know.
     

    Attached Files:

    Last edited: Jan 5, 2014
    ryanhornbeck likes this.
  4. SmellyDogs

    SmellyDogs

    Joined:
    Jul 16, 2013
    Posts:
    387
    Ok well, actually what you need to do is define a square of the area you want to capture in coordinates and then find some data that's suitable. How much do you know about GIS? If you don't know what things like UTM, Geotiff and DTED, etc are then it will take more explanation on how to extract real world data. And also the KML you provided is empty ;)

    Also have you used a site like this to download data? http://earthexplorer.usgs.gov/
     
    Last edited: Jan 6, 2014
  5. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,337
    I'm also very interested in GIS. Is there any third party plugin to import GIS data on Unity?
     
  6. EwanRGR

    EwanRGR

    Joined:
    Jan 5, 2014
    Posts:
    76
    I thought that seemed kind of small. Not sure if that is a Google limitation or not. The steps I outlined "used" to work, but I know they've been getting more picky on folks accessing KML data who don't have a Pro subscription.

    I used to work quite a bit with GIS, but haven't for a couple years. When I did it was for a firm that used the data to locate their members to determine if they were in areas that might be in danger for a natural disaster or such. So part of my problem is figuring out how to do the same things I used to do when I had much more expensive software and licenses for data ;)

    I haven't, but will try to give it a look see tonight or tomorrow.
     
  7. SmellyDogs

    SmellyDogs

    Joined:
    Jul 16, 2013
    Posts:
    387
    Ok cool. What tools are you most familiar with?
     
  8. jgwinner

    jgwinner

    Joined:
    Dec 21, 2016
    Posts:
    20
    Looks like it's been a few years since you've been around, how far did you get with that tutorial? Thought I'd check, just getting into KML now.

    == John ==
     
    icave2 likes this.
  9. Bduinat

    Bduinat

    Joined:
    Nov 26, 2018
    Posts:
    17
    I was wondering if any solution have been found for that. I'm currenting trying to import some kmz data into Unity and I can't figure out how to do it.
    I use the OnlineMap plugin to display map from open street map, and I want to overlay my Kmz data.
    Online map can't load kmz.