The International Simutrans Forum

Development => Extension Requests => Topic started by: h4ck3rm1k3 on April 18, 2010, 03:36:15 PM

Title: Openstreetmap
Post by: h4ck3rm1k3 on April 18, 2010, 03:36:15 PM
is there anyone working on being able to import openstreetmap data into the game?
any tips on how to start?
mike
Title: Re: Openstreetmap
Post by: vilvoh on April 18, 2010, 03:58:44 PM
As far as I know, nobody who migh be working on it has made a public announcement about such an issue. Anyway, I'm afraid you couldn't export all data from OPM to Simutrans, just terrain and roads layouts, but not the street names for example.
Title: Re: Openstreetmap
Post by: prissi on April 18, 2010, 08:39:24 PM
As short glance at openstreetmap shows maps without height definitions. Those are not suited for simutrans; moreover real connections are not suited to a game map without deleting most of them. (I.e. german would have a very dense net even onely with Autobahns.)
Title: Re: Openstreetmap
Post by: gauthier on April 18, 2010, 09:38:48 PM
I just imagine Paris'suburb with all its highways ...
Title: Re: Openstreetmap
Post by: rainer on April 19, 2010, 06:11:27 PM
Penny, an admin and programmer and me thought about that idea a while ago, but considered it as far too complicated.
I fiddled around with some PHP code using Openstreetmap output, but it still needs a lot of hand made work to have usable results.

Anyway, this would an interesting project. I would really love to be able to convert "real world maps" to .ppm for to use them in Simutrans. For now, I do not see a realistic chance - but that might change in future.
Title: Re: Openstreetmap
Post by: ij on November 29, 2010, 09:25:30 PM
I'm considering it, SRTM data would be used to get the elevations included. I expect to need very large maps though to make it even slightly real looking and still some pruning is likely to be necessary.
Title: Re: Openstreetmap
Post by: !i! on February 12, 2011, 12:12:19 PM
Hi, I'm coming from the openstreetmap project, too and would like to see if I could do this.

Even if I'm a bit familar with OSM data processing I don't see a simutrans developer documentation. So can anybody tell me further details on the files, their formats ... please?
Think I understood this pak thing only :)
Title: Re: Openstreetmap
Post by: prissi on February 12, 2011, 08:27:10 PM
If you can generate a height map, this could be a good starting point. Other than that I thing I would parse text files during map creations. Something like pairs of x,y coordinates
road=12,23,18,19,...
river=200,41,77,41,...
Title: Re: Openstreetmap
Post by: !i! on February 12, 2011, 09:45:54 PM
Hi, yes generating the PPM raster maps should be an easier step. But how about buildings and infrastructure. How is the scenery file composed? Depend they on the PPK and it's dimensions?
Title: Re: Openstreetmap
Post by: Zeno on February 12, 2011, 10:00:11 PM
Not only in the dimension (actually it doesn't matter) but each building's object name, which are different in all paksets. So I guess a generic thing would not be able to deal with buildings; maybe a first step like "city=x,y;size=z" would do the job.
Anyway, and considering how the game deals with scales, I would consider detailing as much as mapping streets in a city something hardly doable (only an oppinion though).
Title: Re: Openstreetmap
Post by: VS on February 12, 2011, 11:21:39 PM
There is some code that deals with replacing houses instead of compat.tab. A house can be defined just as com/ind/res of level n at x,y. So, this part is perfectly reusable.
Title: Re: Openstreetmap
Post by: !i! on February 13, 2011, 07:57:39 AM
@zeno there can we use an abstraction layer that dispatchs OSM objects into the right names per PAK and that can be addapted by an external config file

@VS Sorry I dont understand. Is there an example input?
Title: Re: Openstreetmap
Post by: Zeno on February 13, 2011, 08:47:00 AM
City buildings can be defined as commercial, residential or industrial (com/res/ind), and they have a "level" which determines number of people live in them and how many "mail" they generate/receive (small houses will have low level, while skyscrappers will have a very high one).
Then you could specify a list of buildings like "type=T;level=L;position=X,Y;"; the code that VS says would do the rest and pick a proper building to match your specifications of type and level.
Title: Re: Openstreetmap
Post by: !i! on February 13, 2011, 08:49:00 AM
So are there specific type definitions? What does I have to choose to add e.g. a hospital?
Title: Re: Openstreetmap
Post by: Zeno on February 13, 2011, 09:13:47 AM
The type is only a generic property, and can only be commercial, residential or industrial. Commercial buildings should look like offices or shops, residential ones like houses or flat buildings, and industrial like small industrial buildings. That is the maximum detail you can get of this. There are only this types, and there are no types such as "hospital" or "supermarket" :(
More deep in this, there are several types of industries (which produce goods, and include supermarkets, coal mines, steel mills, etc), but again these are PAK dependant.
Title: Re: Openstreetmap
Post by: !i! on February 13, 2011, 09:23:49 AM
thanks, this is one first step towards :)
Title: Re: Openstreetmap
Post by: !i! on February 14, 2011, 07:51:33 AM
Well another question: Forests etc. aren't modeled by the heightmap, don't they?
Title: Re: Openstreetmap
Post by: prissi on February 14, 2011, 10:29:36 AM
No. But it would be very easy to incorporate them, if they are defined in a file.
Title: Re: Openstreetmap
Post by: !i! on March 25, 2011, 10:55:24 AM
You might be interested, that we hope to start a project concerning games at the upcomming Google Summer of Code
http://wiki.openstreetmap.org/wiki/GSoC_Project_Ideas_2011#OSM_4_games