Osm2city.py: Difference between revisions

Jump to navigation Jump to search
192 bytes removed ,  11 September 2016
no edit summary
No edit summary
Line 6: Line 6:
The development [https://gitlab.com/fg-radi/osm2city repository] is hosted on <del>gitorious</del> gitlab.
The development [https://gitlab.com/fg-radi/osm2city repository] is hosted on <del>gitorious</del> gitlab.
Forum thread [http://forum.flightgear.org/viewtopic.php?f=5&t=22809 osm2city.py development]
Forum thread [http://forum.flightgear.org/viewtopic.php?f=5&t=22809 osm2city.py development]
Written in Python 2.7, developed on GNU/Linux. It should also run on Mac OSX. Windows users, see [[Osm2city.py#Install_on_Windows|below.]]
Written in Python 3.5, developed on GNU/Linux. It should also run on Mac OSX. Windows users, see [[Osm2city.py#Install_on_Windows|below.]]


It's at a rather early stage of development. There's no GUI, everything is controlled by an input file. But it produces realistic city layouts (after all, it uses realistic data). The whole process -- from scratch to flying in FG -- for a city the size of LOWI takes perhaps 30 min, including maybe a total of 15 min manual work.
It's at a rather early stage of development. There's no GUI, everything is controlled by an input file. But it produces realistic city layouts (after all, it uses realistic data). The whole process -- from scratch to flying in FG -- for a city the size of LOWI takes perhaps 30 min, including maybe a total of 15 min manual work.
Line 118: Line 118:
== Install ==
== Install ==
1. dependencies: Install the following packages (names from Debian packages):
1. dependencies: Install the following packages (names from Debian packages):
   python-numpy python-shapely python-matplotlib python-scipy python-pil python-networkx curl python-enum34
   python-numpy python-shapely python-matplotlib python-scipy python-pil python-networkx curl
2. get [https://gitlab.com/fg-radi/osm2city osm2city] and [https://gitlab.com/fg-radi/osm2city-data osm2city-data] from gitlab.
2. get [https://gitlab.com/fg-radi/osm2city osm2city] and [https://gitlab.com/fg-radi/osm2city-data osm2city-data] from gitlab.


3. add the directory with osm2city modules to your [http://docs.python.org/2/using/cmdline.html#envvar-PYTHONPATH PYTHONPATH] (unless your PYTHONPATH already contains . (the dot))
3. add the directory with osm2city modules to your [http://docs.python.org/2/using/cmdline.html#envvar-PYTHONPATH PYTHONPATH]
You can add  
You can add  
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
Line 157: Line 157:
In general, you'll want to follow the above install section. This section lists some additional Windows particularities.  
In general, you'll want to follow the above install section. This section lists some additional Windows particularities.  


Osm2city is pure python, so install Python if you have not already done so https://www.python.org/downloads/release/python-278/
Osm2city is pure Python, so install Python if you have not already done so https://www.python.org/downloads/.


{{caution|Python 2.7 is recommended unless you're an experienced Python developer willing to update the Python scripts to support Python 3. Also pay attention to versions and cpu builds of the below helper files. Make sure they match your OS build and Python version.}}  
{{caution|Python 3.5 or later is required. Also pay attention to versions and cpu builds of the below helper files. Make sure they match your OS build and Python version.}}  


Install the following packages, then proceed with [[Osm2city.py#Install|step 2. above]].
Install the following packages, then proceed with [[Osm2city.py#Install|step 2. above]].
Line 168: Line 168:
* http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy-stack
* http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy-stack
* https://pypi.python.org/pypi/Pillow/2.5.0#downloads
* https://pypi.python.org/pypi/Pillow/2.5.0#downloads
* enum34


== Workflow ==
== Workflow ==
648

edits

Navigation menu