tonywob Posted January 25, 2014 Report Posted January 25, 2014 (edited) I'm in the process or creating a tool which will add buildings, obstacles and forests from OpenStreetMaps. I know there is already a tool called OSM2XP existing, but it has a couple of problems and development seems to have stalled on it for the time being. The tool presently supports the following:Multipolygon buildings (buildings with holes) are supported. This makes a big difference in cities.Multipolygon forests and relations are supported. Lots of forests (especially in Europe) are grouped together in OSM into relations, and OSM2XP couldn't find these, which made large areas in Europe where there are forests empty.Complex Rules supported. Example, you can specify that a building with a particular set of tags, and area or height should use a particular facade. This means you can also place obstacles not only based on their tag, but also on their height and other information.If a building has colour information, the tool will generate a facade for it with the exact colour of the wall and roof specified. This all depends on the information in OSM of course, but in some major cities, it's really well done, and people have started to add this information.Resume support, so if you are generating a large scenery area. You can stop the program, try it out, and continue the generation later for other tiles.The program is still in alpha and is currently command-line only, however it's already generating some good scenery. These shots below show a run I did in Berlin: I'm not intending for the program to compete with OSM2XP, as I'm designing it for scenery developers who understand the options and aren't scared of config files and the command-line. Of course, if anyone is willing to create a GUI for it, I'd be happy for the help :-) Edited January 25, 2014 by tonywob 7 Quote
qdavweb Posted January 26, 2014 Report Posted January 26, 2014 Sounds great. You're right OSM2XP does a good job but the buildings have a very generic look to them. And it misses larger buildings due to its limitation of excluding buildings with walls larger than 100m. Best of luck with this. Quote
scotchegg Posted January 26, 2014 Report Posted January 26, 2014 Good work Tony! This will get rid of one of my big bugbears with OSM autogen. Quote
tonywob Posted January 26, 2014 Author Report Posted January 26, 2014 Yes, it's cross platform. I'm developing on a Mac, but don't see any reason why it won't run on both Windows and Linux. Couple more screenshots of Berlin and Warsaw. I've added support for the OSM building:material and roof:material tags, so if a building is specified as blue stone walls, and a grey concrete roof, the program will generate a custom facade and texture for it. The program also now picks up some of the monstrous park and woodland multi polygons that are used in Berlin and across Germany, so it also adds trees (also respecting the type of tree given) and even park benches if you so chose :-) If anyone can offer a hand with the facade file format, please let me know. I'm having some problems getting it to align textures properly to the buildings. Quote
JohnMAXX Posted January 26, 2014 Report Posted January 26, 2014 Tony glad to see you are getting your hands dirty......looks great BTW Quote
tonywob Posted January 26, 2014 Author Report Posted January 26, 2014 Thanks John! Notice all screens are enhanced by Skymaxx Pro ;-) I believe that there is so much potential in OSM data, that it's crazy not to try and best use it as much as possible. 1 Quote
Daikan Posted January 26, 2014 Report Posted January 26, 2014 A very interesting project you have here! At Simheaven.com we added the multipolygons (mainly buildings and forests) using a separate tool (MultiOSM2XP) which I wrote in Java. It works but it's quite messy and has it's limitations. For example one unsolved problem are multipart buildings where the parts share one or more sides (or "ways" in OSM terms). Currently this results in some facades that cause ugly Z-Buffer thrashing ("clipping"). Also, the facade rules are currently hard-coded, which isn't very flexible... Looking forward to see your dynamic facade colors and complex rules put to work! Quote
tonywob Posted January 26, 2014 Author Report Posted January 26, 2014 At Simheaven.com we added the multipolygons (mainly buildings and forests) using a separate tool (MultiOSM2XP) which I wrote in Java. It works but it's quite messy and has it's limitations. For example one unsolved problem are multipart buildings where the parts share one or more sides (or "ways" in OSM terms). Currently this results in some facades that cause ugly Z-Buffer thrashing ("clipping"). Also, the facade rules are currently hard-coded, which isn't very flexible... I know the multipart buildings you mean, they're a right pain. I found a few of them in Berlin and firstly I try and join the shapes together which often works, but in cases where it doesn't, I use a concave hull polygon boundary, which produces something which is similar in shape, and is good enough. If you're using such a tool at simheaven, then I'm hoping this program will come in useful for you and Pilotbalu, and anyone else who wants to create city sceneries. It should do most of the hard work for you, and it can already import and use osm2xp facade sets. Quote
Colin S Posted January 27, 2014 Report Posted January 27, 2014 Just an observation (beautiful work) but having only two or three roof colours is a little strange looking... might want to aim for 10-12. Also, when this becomes available, I'd want to do my local areas (Vancouver and Kamloops)... so in the meantime, might as well get to work adding building information... what layer of OpenStreetMap does this use? I've never been able to figure this out for OSMXP. Can't wait, this is definitely high demand! Thank you! Quote
PilotBalu Posted January 27, 2014 Report Posted January 27, 2014 I'm always interested making my OSM sceneries more realistic, so your tool will help to do so. First shots are impressive! There's much more information in OSM data, that we can use for more realistic buildings, e.g. color or kind of building, roof... or combine OSM with other data, like getting roof images from satellite shots. or to judge if OSM data is sufficent and set exclusions for autogen objects (smart exclusions in my and Bens term). Also regional facades are possible. I follow this topic, but if you need some assistance, please contact me. 1 Quote
tonywob Posted January 27, 2014 Author Report Posted January 27, 2014 Just an observation (beautiful work) but having only two or three roof colours is a little strange looking... might want to aim for 10-12. Also, when this becomes available, I'd want to do my local areas (Vancouver and Kamloops)... so in the meantime, might as well get to work adding building information... what layer of OpenStreetMap does this use? I've never been able to figure this out for OSMXP. Thanks for the feedback Colin. I agree with you, and in this instance, for buildings without colour information, I simply imported the same facade set that OSM2XP uses. The facade set needs lots of work, and more variety. Once I have an initial release out, I'm hoping people will work on creating more facades, to add more variety. I'm no artist, so making such facade sets is not only time consuming, I wouldn't do a very good job of it :-), so I'm reaching out for help with this. Anyway, this is the beauty of having the generation highly configurable, it's very easy to add new sets and building types. In terms of OpenStreetMap layers, there isn't a particular layer as such, but to see 3D buildings have a look at this http://map.f4-group.com/. At the moment, the building generatiion will look for the following tags: building:colour = #rrggbb or red,green,blue, orange, etc...roof:colour = #rrggbb or red,green,blue, orange, etc...building:material = stone,brick,concrete,glass,wood, etc..roof:material = stone,brick,concrete,glass,wood, etc.. building:levels = <number of stories>height = 20m, i.e. Height in metresIt will combine these tags to create a facade texture (which still needs lots of work). With the lack of this information, it simply uses the default OSM2XP facade set, but also allows filters in the facade set to render different areas and shape types with different textures, e.g. If a residential buildings is less that 50m2, then it could use a cottage texture, if it was bigger, we could use a terrace texture, etc.. It could also switch facade sets based on gps coordinates, so continental sceneries could have regional buildings. I'm always interested making my OSM sceneries more realistic, so your tool will help to do so. First shots are impressive! There's much more information in OSM data, that we can use for more realistic buildings, e.g. color or kind of building, roof... or combine OSM with other data, like getting roof images from satellite shots. or to judge if OSM data is sufficent and set exclusions for autogen objects (smart exclusions in my and Bens term). Also regional facades are possible. I follow this topic, but if you need some assistance, please contact me. Thanks PilotBalu, it's great to see you here and I love the work you've done so far with the OSM packs, and I'm sure you and Daikan have had many headaches trying to get it to work. As I said above to Colin, the generation is highly configurable, so regional facades, colors, kind will already work (I just don't have any facade sets to work with). Roof images from satelite shots sounds really cool, and I think when it's out, I could reach out to the developer of g2xpl and see if he can assist me in getting this working (Even if it could just open the X-Plane scenery tile, and grab a colour). I'm not sure how the smart exclusion algorithm would work, but I'm presuming it would scan small areas of the tile to see what's there, and if there's nothing (in a preset area), it would remove the exclusion (or more correctly, not create one in the first place). Also, on my todo list is boundary exclusions, so that if you generate Germany, and then Austria as seperate sceneries, the exclusion zone from Germany won't exclude objects in Austria (so, the boundary tiles would have a boundary zone, wrapping the last points on the tile). Quote
PilotBalu Posted January 27, 2014 Report Posted January 27, 2014 The scenery gap between countries is the reason I do whole continents. With smart exclusions it should also work, as there are only exclusions set where facades are, but I have a prework algorithm to speed up the generation of OSM sceneries also for huge data files. Also a problem with multipolygons was, if a building or forest is over the border line of two tiles, you have to split up into two separate objects. And sometimes we had to correct the faulty points of an inner/outer ring or to decrease the number of points. There were many many things we worked on with the MultiOSM2XP tool... At the beginning I thought, well, that's easy, two days of work for Daikan, than we needed several weeks... Quote
alpilotx Posted January 27, 2014 Report Posted January 27, 2014 This is very interesting, and I am very happy that there are more and more "approaches" to OSM coming to life .... its always nice to have choices, as they usually open up different ways to go ... or to tweak / improve in different ways. Myself i was also thinking about an additional "feature", which PilotBalu was dreaming about a long time. Namely, to not translate every OSM building footprint as facades .... But instead only larger objects (in cities, industry etc.)! For all smaller / simpler (consisting of only 4-10-16-etc. line segments, being non complex, covering a small area etc.) footprints instead we could use objects, which would vastly improve the ability to customize / beautify the result (and even make more complex objects, like churches etc. possible, which is hard to do with facades only). PilotBalus (and others) idea was (and I thought about it ... and see it as a good idea) .... to categorize the footprints, and for the small / simple ones, do derive the - geometric - center point, derive its orientation (with some approximation, this could be done with quite simple analysis of the geometry), and maybe derive some "characteristic" from the footprint size and generic form. Then use all of this information to add objects in the X-Plane world instead of the facades. This could result in some fantastic stuff especially in rural areas, where the plain "facade" approach is not always "optimal" (whereas the facades are great in cities, and for all mor complex buildings of course!) .... Then there is one final thought .... which also results from the object approach. There is one thing, which all of this - and even th facade approach - is missing. Namely, the artwork (PilotBalu brought this up quite a few times - and not much happened). The object approach would work best, if we had a large library of simple (low polygon count), nice looking, and with good texture usage (where not each object needs its own texture file, but many objects take their "paint" from a few, large, texture files) building objects to choose from. I might even consider participating in such an initiative (I am not a master 3D modeler, but did already do some "easy" Blender work for some of my sceneries) ... What would also be cool, if the artwork used in all OMS approaches (being OSM2XP, PilotBalus facade sets, this new approach by tonywob etc.) could be put in some "open" library (like OpenSceneryX - or maybe we could even push for a more coordinated / massive extension of current v2 OpenSceneryX to cover more art assets for OSM needs), where everybody could use / reference them for their own OSM scripts (thus we would make it even easier for others to chip in) ... and hopefully even extend the artwork set over time. ... Well, just dreaming a bit ... but I think this might move forward all OSM ideas quite a bit (where I have a few "ideas" too ... but without artwork readily available, its often a long way). Quote
tonywob Posted January 27, 2014 Author Report Posted January 27, 2014 (edited) I thought of doing something similar for smaller objects, and also for the likes of churches which presently have a random rotation (if building=church is used). Again, the lack of artwork prevented me from doing this. There is the fflibrary, and the R2 library which do contain some European style buildings with different footprints. I will put this on the todo list to add it into the config file after I have facades working correctly, something along the lines of<rule> <filter>building=house</filter> <min-area>50</min-area> <max-area>100</max-area> <objects> <object rotate="determine">some-nice-building.obj</object> <object rotate="determine">some-nice-building.obj</object> <object rotate="determine">some-nice-building.obj</object> </objects></rule> Of course, that's simplistic, and would produce many generic buildings which fit loosely to the polygon footprint underneath it. But, since you can actually evaluate groovyscript http://groovy.codehaus.org/ code inside a filter rule, you could easily write your own rules and filters if you needed to do so. Also, to make this work, the facades would have to look like the objects, so that when the program mixes them, they at least look convincing :-) Edited January 27, 2014 by tonywob Quote
benny Posted January 27, 2014 Report Posted January 27, 2014 good job I'm not working on osm2xp since a long time, so it's nice to see someone working on a new osm tool The last thing i was working on (and that wasn't released, as it was wip) is the use of objects as much as possible instead of facades.I think that's the thing to do if we want a better looking scenery, because let's face it, facades are not really good looking.The approach was more or less to have a description of each 3D object (size, type etc), and when finding an osm polygon that can hold the object in terms of dimensions (and that comply with osm user rules), rotate it to the right position and place it.Problem, those 3D objects had to comply to some rules, like therotation point at 0/0 to be able to place them at the right angle/position.So that would need some 3D work to have enough 3D objects for as much osm buildings as possible.So some limitations, but that was working and looking better than facades.Another interesting thing i also was working on was to place light sources based on osm tags, it was an idea from Olli (from truscenery) and it's giving great results.It's also a feature where you need some 3D work to have light objects. So as Andrea said, artworks are the key to good looking sceneries. Cheers Ben Quote
tonywob Posted January 27, 2014 Author Report Posted January 27, 2014 So as Andrea said, artworks are the key to good looking sceneries. Hi Benny, it's great to see you here, and I really love the work you've done on OSM2XP. It's a pity life got in the way and development has stalled. . This tool also supports object placement based on areas: In these examples, it has placed some buildings into the polygon footprints and rotated them to fit. Any buildings that don't fit, pass through the filter and use the standard facade filters. I added three filters and used three houses from the R2 library which had a 10, 15, and 19m2 area respectively. However, the problem I found, which you've indicated is that some of the objects' origins aren't centred, and some objects have a rotation already applied to them. What we badly need is a large collection of buildings which have various footprints. They don't have to fit the shape exactly, but should have parameters like 10mx15m, 12m15m, 10x10m etc.. We really need to try and organise this, but I know the developers of the R2 library for example, want it kept as a separate library. There have been no updates of the opensceneryx library for months as well. The lights are a good idea also, but would either require the system to create an OBJ file for each light, or have a library of them it could use. AFAIK, the height is part of the OBJ file and can't be set. Also I like how you generate street lights. I tried a little hack a while ago, and basically filtered out all roads except motorway junctions and residential roads using osmfilter, and then generated the street lights using OSM2XP. It looked really good, as only residential areas where lit up :-) Quote
tonywob Posted January 27, 2014 Author Report Posted January 27, 2014 Some more screenshots. I've tweaked the building generation a little bit, so there are less red roofs, and also I've inserted a few real object houses into the scenery replacing any buildings which have a 10x10, 14x19 and 19x19 footprint. Doing this also slightly improves framerates and improves night lighting. Quote
Jakob Ludwig Posted January 27, 2014 Report Posted January 27, 2014 Stunning. Hope that this gets soon into a product like simheaven continent Osm packages Quote
Colin S Posted January 28, 2014 Report Posted January 28, 2014 All I can say is this is amazing... Wow! I'm going on OSM rampages to get as many local buildings put in as possible I'm about 170 buildings total so far and counting. Could we see some examples of what skyscrapers end up looking like? 1 Quote
tonywob Posted January 28, 2014 Author Report Posted January 28, 2014 All I can say is this is amazing... Wow! I'm going on OSM rampages to get as many local buildings put in as possible I'm about 170 buildings total so far and counting. Could we see some examples of what skyscrapers end up looking like? I generated Chicago, but the screenshot looks bad because I forgot I didn't have any scenery installed , so the entire city is floating on water. Althought height information is good in Chicago, there is no colour or material information so most buildings just look generic. A good way to see 3D buildings is this http://map.f4-group.com/#. It will show you height, colour information, etc, and I've used it so far for scouting cities :-) 2 Quote
tonywob Posted January 28, 2014 Author Report Posted January 28, 2014 Could we see some examples of what skyscrapers end up looking like? Let me know which city you've been doing, and I'll give it a try. I might not have the base scenery installed, so it might be floating on water, but you'll get an idea of what the buildings look like Quote
mroe Posted January 28, 2014 Report Posted January 28, 2014 (edited) In these examples, it has placed some buildings into the polygon footprints and rotated them to fit. Any buildings that don't fit, pass through the filter and use the standard facade filters. I added three filters and used three houses from the R2 library which had a 10, 15, and 19m2 area respectively. However, the problem I found, which you've indicated is that some of the objects' origins aren't centred, and some objects have a rotation already applied to them. What we badly need is a large collection of buildings which have various footprints. They don't have to fit the shape exactly, but should have parameters like 10mx15m, 12m15m, 10x10m etc.. We really need to try and organise this, but I know the developers of the R2 library for example, want it kept as a separate library. There have been no updates of the opensceneryx library for months as well. Hi tonywob ,It seems missing artwork is the main issue .Therefore it is better you can use existing work.What about a spreadsheet holding the dates of possible objects and feeding it in your tool.A line could look like this:type width length height dx dy dr (origin deltas to center) object-pathThat could be filled manually or by parsing a library or a batch of object-files . BRmroe Edited January 28, 2014 by mroe Quote
Colin S Posted January 28, 2014 Report Posted January 28, 2014 Ok I'm going to start working on Vancouver RIGHT AWAY because X-Plane thinks that downtown Vancouver is a trailer park at the moment. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.