Board index FlightGear Development Scenery

osm2city.py development

Questions and discussion about enhancing and populating the FlightGear world.

Re: osm2city.py development

Postby vanosten » Tue Mar 06, 2018 8:46 pm

the short answer is: everything in your last paragraph is already implemented. So yes: it only populates areas, where the density of OSM-buildings seems to be too low based on parametrized heuristics.

Currently I am changing the whole land-use implementation. Lit zones is already done and will give fewer on/off street lighting annoyances plus thereby hopefully fewer residuals. The next step is to drop land-use zones as mapped in OSM and instead create city blocks (using simple cycles in a street network graph), which then get a land-use type assigned. This is especially important in city/town like zones, such that all buildings in a block get the same height/levels (unless OSM values tell otherwise by building). Right now city zones actually look rather odd compared to real life. And when this is available we can work with more aligned textures instead of the once available right now.

When this is done (and I have no time plan due to paid work and family), then I will return to building generation and make it more intelligent in dense areas (residential family house type of zones are easy and therefore "done").
Maintaining osm2city
vanosten
 
Posts: 290
Joined: Sat Sep 25, 2010 5:38 pm
Location: Denmark - but I am Swiss
Callsign: HB-VANO
Version: latest
OS: Win 10 and Ubuntu

Re: osm2city.py development

Postby vanosten » Sat Apr 07, 2018 5:38 pm

A new push of features, most of them hidden, as they are infrastructure for later changes.

You might notice that roof types dome and onion are now implemented (quite visible in Prague) and that lit streets are more consistent in larger areas.

Next step is to profit from new city blocks and make buildings more aligned in down-town areas.
Maintaining osm2city
vanosten
 
Posts: 290
Joined: Sat Sep 25, 2010 5:38 pm
Location: Denmark - but I am Swiss
Callsign: HB-VANO
Version: latest
OS: Win 10 and Ubuntu

Re: osm2city.py development

Postby vanosten » Fri May 11, 2018 2:34 pm

For the osm2city scenery generation, I made some performance experiments comparing standard CPython 3.6 on Linux and PyPy3.6 version 6.0. It unfortunately shows that PyPy does not improve speed, actually it decreases run-time in osm2city (i.e. no easy fix without touching the code). However if you actually for some reason need to use PyPy, then it actually works. The manual has been updated accordingly.

As the runtime of osm2city constantly increases due to the addition of features (meaning more geometric data crunching), one might have to look into using Cython or reprogramming (parts) in C/C++. However currently that is not on my priority list.
Maintaining osm2city
vanosten
 
Posts: 290
Joined: Sat Sep 25, 2010 5:38 pm
Location: Denmark - but I am Swiss
Callsign: HB-VANO
Version: latest
OS: Win 10 and Ubuntu

KeyError: 'building:part'

Postby powoflight » Tue May 15, 2018 12:35 pm

Now i have done my first tests after a long time now in ubuntu 16.04 with the postgisDB

1 I download from geofabrik.de/europe/germany bremen-latest.osm.pbf.
2 Write in DB: ./osmosis --read-pbf /media/sf_VMOrdner/OSM/BREMEN/bremen-latest.osm.pbf --log-progress --write-pgsql database=kbos user=gisuser password=xxxx

3 Then Start: python ./build_tiles.py -f BREMEN/params.ini -b 8.7726_53.0569_8.8443_53.099 -p 1 -l DEBUG -o
and get the KeyError: 'building:part'

Code: Select all
******* Exception in tile 3089347 - to reprocess use boundaries: 8.7726_53.0569_8.8443_53.099 ******* at 2018-05-15_123333 - 
Traceback (most recent call last):
  File "/home/bernhard/development/osm2city/build_tiles.py", line 145, in process_scenery_tile
    generated_buildings, file_lock)
  File "/home/bernhard/development/osm2city/buildings.py", line 641, in process_buildings
    _clean_building_parents_with_one_child(the_buildings)
  File "/home/bernhard/development/osm2city/buildings.py", line 457, in _clean_building_parents_with_one_child
    building.make_building_from_part()
  File "/home/bernhard/development/osm2city/building_lib.py", line 136, in make_building_from_part
    part_value = self.tags['building:part']
KeyError: 'building:part'
******* Exception in tile 3089347 - to reprocess use boundaries: 8.7726_53.0569_8.8443_53.099 ******* at 2018-05-15_134446 - 
Traceback (most recent call last):
  File "/home/bernhard/development/osm2city/build_tiles.py", line 145, in process_scenery_tile
    generated_buildings, file_lock)
  File "/home/bernhard/development/osm2city/buildings.py", line 641, in process_buildings
    _clean_building_parents_with_one_child(the_buildings)
  File "/home/bernhard/development/osm2city/buildings.py", line 457, in _clean_building_parents_with_one_child
    building.make_building_from_part()
  File "/home/bernhard/development/osm2city/building_lib.py", line 136, in make_building_from_part
    part_value = self.tags['building:part']
KeyError: 'building:part'


Here is the osm2city_main_2018-05-15_133603.log and osm2city_process_SpawnPoolWorker-1_2018-05-15_133607.log
https://c.gmx.net/@327459158418791162/R ... -YY6t7l1Og

Do i something wrong?

Bernhard
powoflight
 
Posts: 43
Joined: Fri Mar 25, 2016 10:04 am
Location: LOWW
Version: 2017.3
OS: win7

Re: osm2city.py development

Postby vanosten » Tue May 15, 2018 7:48 pm

My best guess is that you are not running the latest code, at this has been corrected some time back.
Maintaining osm2city
vanosten
 
Posts: 290
Joined: Sat Sep 25, 2010 5:38 pm
Location: Denmark - but I am Swiss
Callsign: HB-VANO
Version: latest
OS: Win 10 and Ubuntu

Re: osm2city.py development

Postby powoflight » Wed May 16, 2018 3:28 pm

I have download the latest version and now it works. The scenery is very nice now.

Thank you .
powoflight
 
Posts: 43
Joined: Fri Mar 25, 2016 10:04 am
Location: LOWW
Version: 2017.3
OS: win7

Previous

Return to Scenery

Who is online

Users browsing this forum: No registered users and 5 guests