Osm2city.py: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
No edit summary
(Copy editing; Updating links to repository; -cat: Scenery software. Making the osm2city category a subcategory to it instead.)
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{note|To use osm2city, you need to download both the {{gitlab source|user=osm2city|repo=osm2city|text=development repository}} and the {{gitlab source|user=osm2city|repo=osm2city-data|text=texture data}} from GitLab.}}
{{note|Please use the {{forum link|t=22809|title=osm2city.py development}} for discussion and support.}}
{{OSM Navigation}}
{{OSM Navigation}}
[[File:LOWI with OSM buildings.jpg|thumb|LOWI with OSM buildings]]


== Overview ==
'''osm2city''' is a set of procedural programs, which create plausible FlightGear scenery objects (buildings, roads, power lines, piers, platforms etc.) based on {{wikipedia|OpenStreetMap}} (OSM) data.
osm2city is a set of procedural programs, which create plausible FlightGear scenery objects (buildings, roads, power lines, piers, platforms etc.) based on OpenStreetMap (OSM) data.


* The development [https://gitlab.com/fg-radi/osm2city repository] is hosted on gitlab.
* Please use the forum thread [http://forum.flightgear.org/viewtopic.php?f=5&t=22809 osm2city.py development] for discussion and support.
* Documentation regarding installation and usage can be found on [http://osm2city.readthedocs.io/en/latest/index.html osm2citiy's Read The Docs site].
* Documentation regarding installation and usage can be found on [http://osm2city.readthedocs.io/en/latest/index.html osm2citiy's Read The Docs site].
* Written in Python 3.5, developed on Linux. It should also run on Windows and Mac OSX, however most testing is done on Linux.
* Written in Python 3.5, developed on Linux. It should also run on Windows and Mac OSX, however most testing is done on Linux.


== Features ==
== Programs and feature areas ==
* reads buildings from OSM. Honors height and level tags, reads relations ('buildings with holes')
''osm2city'' contains the following programs to generate scenery objects based on OSM data:
* reads existing .stg, won't place OSM building if there's a static model nearby
* reads pre-calculated terrain elevation: places buildings at correct elevation
* simplify/automate elevation probing by using fgelev
* LOD animation based on building height and area (see below)
* cluster a number of buildings into a single .ac files. Clusters overlap to alleviate sharp LOD borders
* complex sloped roof generation (using Olivier Teboul's implementation of the straight skeleton algorithm)
* texture manager: DB of facade/roof textures
:* ~10 different, hi-res facade textures, some roof textures
:* find matching texture for given building (number of levels, modern/old building, etc)
:* find matching roof texture for given facade texture
* basic lightmap support
* obstruction lights on tall buildings
* command line interface and parameters file (thanks to forum user vanosten)
* shows statistics on processed buildings
* writes .ac, .xml, .stg


== Planned Features ==
; buildings.py
(in random order)
: Generates buildings honoring OSM height and level tags as well as reads relations ('buildings with holes'). Includes lightmaps, complex sloped roofs (using Olivier Teboul's implementation of the straight skeleton algorithm), obstruction lights on tall buildings. Texturing of roofs and facades based on a texture manager, which find matching texture for given building (number of levels, modern/old building, etc).
* more complex facade generation. Currently, all sides get same texture  {{not done}}
* Rembrandt lighting {{not done}}
* put a piece of matching ground texture around buildings ('garden') {{progressbar|10}}
* put shared models if/where OSM indicates so: gas stations... {{not done}}
* geometry cleanup, simplify too complex buildings {{done}}
* use residential/industrial/commercial tags/areas. ATM, all is residential. {{not done}}
* geometry cleanup, simplify too complex buildings {{done}}
* Batch processing of greater areas including downloads {{done}}
* use more LOD levels, write them to different .ac so users can easily reduce building density, therefore improve performance {{progressbar|50}}
:* put large buildings into one ac, sort/rate buildings by stand-out-ness {{done}}
:* then ship light/med/full .stg {{not done}}
* mid-term: develop this into a city-engine that procedurally generates a city based on OSM roads. {{not done}}
:* read, drape, texture roads and railways {{progressbar|70}}
:* texture road intersections  {{not done}}
:* illuminate roads {{not done}}
:* procedural bridges  {{progressbar|50}}
:* place shared models along roads if no OSM data available {{not done}}
* long-term: integrate into FG to do all this on the fly. {{not done}}


== Contributing ==
; roads.py
You know some Python? Or you're keen on writing docs? Contact the team on the FG forum.
: Generates different types of roads and railways incl. texturing and automatically calculated bridges.
None of the above? Take [[Howto:Create_textures_from_photos|pictures]] of buildings where you live and [[Osm2city.py Textures|create textures]]! We are especially interested in south-east Asian style architecture, as a future default airport for FlightGear might be Hong Kong Kai Tak (VHXX).
 
; pylons.py
: Generates pylons and cables between them for power lines, aerial ways, railway overhead lines as well as street-lamps, wind turbines and storage tanks.
 
; piers.py
: Generates piers and boats.
 
; platforms.py
: Generates railway platforms.
 
All generated objects are added as static or shared objects to FlightGear scenery with correct elevation read on the fly from existing FlightGear scenery. Tagging and topology in OSM are respected as far as possible and complemented with some heuristics (given the developer team's origin mostly inspired by how stuff looks in Europe).
 
== Issues and feature requests ==
Please register issues and feature requests in the {{gitlab source|user=osm2city|repo=osm2city|text=repository}} as issues and label them accordingly.
 
== Screenshots ==
[[File:LOWI with OSM buildings.jpg|thumb|800px|left|LOWI with OSM buildings]]
 
[[File:Wick_harbour_created_using_osm2city_and_osm2piers.png|thumb|800px|left|Example of piers.py output]]
 
[[File:Roed sand2.png|thumb|800px|left|osm2city placed wind turbines at Rød Sand 2 in Denmark.]]
 
[[File:Bridge and cables.png|thumb|800px|left|osm2city generated pylons with cables, street with bridge over railway with overhead cables.]]
 
[[File:Buildings and roads at night.png|thumb|800px|left|osm2city generated buildings and roads with light effects at night]]{{-}}


== Related content ==
== Related content ==
=== Documentation ===
* http://osm2city.readthedocs.io/en/latest/index.html
=== Wiki articles ===
=== Wiki articles ===
* [[Areas populated with osm2city scenery]]
* [[Areas populated with osm2city scenery]]
* [[Project3000]] - Can be used together with osm2city
* [[Howto:Using osm2city.py on Windows]]


=== Forum topics ===
=== Forum topics ===
* [http://forum.flightgear.org/viewtopic.php?f=5&t=21131 OSM buidings EHLE]
* {{forum link|t=22809|title=osm2city.py development }} - Development and user discussions regarding osm2city
* [http://forum.flightgear.org/viewtopic.php?f=5&t=22809 osm2city.py development]
* {{forum link|t=32254|title=osm2city available scenery}} - Announcements of new available osm2city scenery
* [http://forum.flightgear.org/viewtopic.php?f=5&t=19625 LOWI city buildings]
* {{forum link|t=35581|title=osm2city worldbuild}} - World build of osm2city scenery
* [http://forum.flightgear.org/viewtopic.php?f=38&t=8837 <nowiki>[</nowiki>Proposal<nowiki>]</nowiki> Autogen Cities using PixelCity]
* {{forum link|t=19625|title=LOWI city buildings}} - Where it all started
* [http://forum.flightgear.org/viewtopic.php?f=5&t=17598 Procedural buildings in OSM before part of Scenery]


[[Category:Scenery software]]
=== Source code ===
* {{gitlab source|user=osm2city|repo=osm2city}}

Revision as of 13:17, 31 March 2020

Note  To use osm2city, you need to download both the development repository and the texture data from GitLab.
Note  Please use the osm2city.py development topic on the forum This is a link to the FlightGear forum. for discussion and support.
Autogen Scenery
Started in 11/2013
Description Improved autogen support for FlightGear using OSM data
Contributor(s) radi, vanosten, Soitanen, portreekid
Status Under active development as of 02/2016
Topic branches:
$FG_SRC https://gitlab.com/osm2city/osm2city/
fgdata https://gitlab.com/osm2city/osm2city-data/


osm2city is a set of procedural programs, which create plausible FlightGear scenery objects (buildings, roads, power lines, piers, platforms etc.) based on OpenStreetMap This is a link to a Wikipedia article (OSM) data.

  • Documentation regarding installation and usage can be found on osm2citiy's Read The Docs site.
  • Written in Python 3.5, developed on Linux. It should also run on Windows and Mac OSX, however most testing is done on Linux.

Programs and feature areas

osm2city contains the following programs to generate scenery objects based on OSM data:

buildings.py
Generates buildings honoring OSM height and level tags as well as reads relations ('buildings with holes'). Includes lightmaps, complex sloped roofs (using Olivier Teboul's implementation of the straight skeleton algorithm), obstruction lights on tall buildings. Texturing of roofs and facades based on a texture manager, which find matching texture for given building (number of levels, modern/old building, etc).
roads.py
Generates different types of roads and railways incl. texturing and automatically calculated bridges.
pylons.py
Generates pylons and cables between them for power lines, aerial ways, railway overhead lines as well as street-lamps, wind turbines and storage tanks.
piers.py
Generates piers and boats.
platforms.py
Generates railway platforms.

All generated objects are added as static or shared objects to FlightGear scenery with correct elevation read on the fly from existing FlightGear scenery. Tagging and topology in OSM are respected as far as possible and complemented with some heuristics (given the developer team's origin mostly inspired by how stuff looks in Europe).

Issues and feature requests

Please register issues and feature requests in the repository as issues and label them accordingly.

Screenshots

LOWI with OSM buildings
Example of piers.py output
osm2city placed wind turbines at Rød Sand 2 in Denmark.
osm2city generated pylons with cables, street with bridge over railway with overhead cables.
osm2city generated buildings and roads with light effects at night


Related content

Documentation

Wiki articles

Forum topics

Source code