Import real world terrain into Unity (FREE)

This is a free bit of code/tutorial for people who want to know how to import real world data into Unity. You will notice there are several packages about that are quite costly. But here I show you how do that for free.


Import real world terrain into Unity with 2-3 mouse clicks.
Downside of this project is that free online WMS (Web Mapping Services), isn’t so common anymore and the only free ones have LOW RES terrain (maybe you can still use it for a flight sim). If we could re-wind to 2011 it would be a different story with NASA worldwind (better than Google earth and open source), but unfortunately they couldn’t afford to keep servers up.

If you want you can setup a WMS to run on your hard drive instead and acquire a data set from somewhere like USGS, that would be a better solution. You can buy the DVDs of data really cheap or just download it for free (takes a while cause the dataset is huge - terrabytes). Then you can have much higher res data.

So I am still not happy with no good online WMS so I have made a Bing Maps one, that will be free too, in fact its against the rules to sell the data. You will have high res data to download. Bing Maps API uses JSON, a bit more of a current approach. I will upload if anyone is interested.

All the source code is included, just download the zip, unzip it into your project and then a menu called “TerraNator” will appear.
Just drag the white box over the region of interest then click download button.


1366748–68404–$TerraNator.zip (364 KB)

Hello. Exelent system.

But there are some problems.
You can’t use namespace for Monobehavior scripts.
So :

namespace SmellyDogs
{
public class TerraNator : EditorWindow 
}

throw error :

Instance of TerraNator couldn't be created because there is no script with that name.
UnityEditor.EditorWindow:GetWindow(Type)
SmellyDogs.TerraNator:CreateWindow() (at Assets/TerraNator/TerraNator.cs:54)

And : window.maximized = false; // Doesn’t exist in unity < 4.2. use IF_DEF UNITY_4_2

I should point out this ran fine on Unity 4.1 (if Unity did indeed remove that method then…wow…what can I say).
But theres no monobehaviors here, so the namespace is fine (he says, using 4.1 here).

Yes you can. Looks like you’re using an older version.

Yeah!!

Good work :slight_smile:
I thought Bing licence doesn’t allow storing the tiles locally?

Yes we need to be careful not to break any license agreements with Bing. In short I’m not clear if you can use this data for your games, unless you buy a commerical license. Its probably ok to use for free stuff. With my free license it prints a big “copyright” embedded into the textures so that’s a clear indication.

http://www.microsoft.com/maps/product/terms.html

As far as storing files locally goes, I don’t see anywhere where it says that you cannot do that, which would be a little odd anyway because their API serves data direct to your HD. Although I have seen people writing that it breaks the agreement, it seems to refer to offline usage rather than using a local storage. So yes you are probably correct that you couldn’t use Bing for games without a special license.

The map window in TerraNator tool is either too small or I can’t zoom into the area where I want to download the data from. Any suggestions?

Great stuff Smelly Dog.

Yes a zoom on the maps tool would be great.

I seemed to have run into an error. When importing terrain, it took forever and never did it. Possibly find way to make a smaller selection.

I had to force quit.

Then I went to do it again and the tab did not show up. I re-imported the asset again …still no go.

Yep that’s because the servers are down, this is a big problem with free WMS. Try again later.

I’m working on one that pulls data from a more reliable source, using the ESRI REST servers.

Even though it works very well, I pulled the plug on Bing as I’m wary of the copyright issues. :frowning:

As far as map size is concerned well…I guess I can give a bigger map next time.

I think a smaller map…not so much terrain.
When I did my selection from the map it was like all of Portugal;)

Uh, WMS only gives you textures, so your terrain is 2D. Am I missing something important here? Even for a flight sim, in the 21st century you’d want 3D terrain (mountains at least).

Technically you want WCS but there’s no reason a WMS cannot serve heights, e.g. Geotiff, greyscale heights, whatever - its just a raster the same as a map, you just need to interpret the data differently. In this case height is just inferred from GTOPO30.

I was wondering whether you are still updating this amazing asset?

Can I import Google Earth maps for better detail?

Was trying to get this too work. In my project folder, I have several folders. Do I just drop it in the project’s root directory or into Assets or what? I’m using the latest version of Unity. Even if I have to modify the source, it’s fine with me, I’m just not getting thse files to register at all.

Can someone has has successfully imported theses files point me in the right direction?

Thanks.

ummm… im new to untiy and i have a question… how do I import it?

Pretty cool.

1 Like

Hello,

Could someone tell me if it runs on Unity 4.5, please ?
Menu doesn’t display.

Thank you

Bruno

Hello , how were you able to install this asset ? Seems it doesnt work in Unity 5.6 @SmellyDogs

TerraLand 3 is off by 50% if you want to get the ultimate solution cheap: TerraLand 3 - Streaming Huge Real-World & Custom Terrains For Open-World Environments