Board index FlightGear Development Scenery

osm2city.py development

Questions and discussion about enhancing and populating the FlightGear world.

Re: osm2city.py development

Postby Catalanoic » Wed Jun 20, 2018 9:46 am

I 've an older gpu and get better amd smoother graphics and visuals
User avatar
Catalanoic
 
Posts: 1099
Joined: Mon Mar 05, 2012 1:33 am
Location: Barcelona (LEBL)
Callsign: Catalanoic
Version: 2017.3
OS: Lubuntu/Windows 7

Re: osm2city.py development

Postby miguel » Wed Jun 20, 2018 2:30 pm

directed to: vanosten
I follow with great interest the development osm2city.py development when you have something new to publish in http://wiki.flightgear.org/Areas_popula ... ty_scenery Thanks
miguel
 
Posts: 227
Joined: Wed Aug 19, 2015 5:05 pm

Re: OSM Buildings disappear

Postby vanosten » Wed Jun 20, 2018 8:11 pm

powoflight wrote in Mon Jun 18, 2018 10:14 am:.... Now I have recorded this phenomenon.
See youtube: https://youtu.be/7sg0G-U30tI
Image


Yes, I recognise. However I have no clue how to debug this. What is interesting is that not only the osm2city stuff goes away, but also the churches, which are simple shared objects. But: I simply do not know how to help - even if I could reproduce.

P:S: By the way. I will downlad the new version and test it. Because especially in vienna, tall buildings are often displayed with only one floor.


It would be great to get some feedback, whether it improved. Currently I am looking into how to improve the situation, such that the share of gabled roofs gets significantly increased.
Maintaining osm2city. Contributing with ground attack stuff to the OPRF FlightGear military-simulation community.
vanosten
 
Posts: 542
Joined: Sat Sep 25, 2010 6:38 pm
Location: Denmark - but I am Swiss
Pronouns: he/his
Callsign: HB-VANO
Version: latest
OS: Win 10 and Ubuntu

Re: osm2city.py development

Postby powoflight » Thu Jun 21, 2018 9:42 am

I 've an older gpu and get better amd smoother graphics and visuals


This is because the rendering options are on minimum for testing.
powoflight
 
Posts: 212
Joined: Fri Mar 25, 2016 11:04 am
Location: LOWW
Callsign: OE-POW
Version: 2020.4
OS: win7 Ubuntu 18.04

Re: osm2city.py development

Postby powoflight » Fri Jun 22, 2018 7:54 am

It would be great to get some feedback, whether it improved. Currently I am looking into how to improve the situation, such that the share of gabled roofs gets significantly increased.


Download yesterday latest osm2city and osmcity-data (do we need to download osmcity-data once again? Because last update is 1 year old).

1 Run: This area include 3203657.stg and 3203649.stg
python ./build_tiles.py -f GRAZ_TEST/params.ini -b 15.25_47.00_15.50_47.25 -p 2

Osmcity generate 3203657.stg but NOT 3203649.stg

No osm2city-exceptions.log


2 Run: Osmcity generate only 3203649.stg (City of Graz)
python ./build_tiles.py -f GRAZ_TEST/params.ini -b 15.25_47.00_15.50_47.125 -p 2

I got an osm2city-exceptions.log
Code: Select all
******* Exception in tile 3203649 - to reprocess use boundaries: 15.25_47.0_15.5_47.125 ******* at 2018-06-21_133401 - 
Traceback (most recent call last):
  File "/home/bernhard/development/osm2city/utils/utilities.py", line 438, in probe
    elev_is_solid_tuple = self._cache[key]
KeyError: (15.3533606, 47.1186913)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/bernhard/development/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/bernhard/development/osm2city/buildings.py", line 636, in process_buildings
    prepare_textures.facades, prepare_textures.roofs, stats)
  File "/home/bernhard/development/osm2city/building_lib.py", line 1288, in analyse
    if not b.analyse_elev_and_water(fg_elev):
  File "/home/bernhard/development/osm2city/building_lib.py", line 556, in analyse_elev_and_water
    temp_ground_elev = fg_elev.probe_list_of_points(self.pts_outer)
  File "/home/bernhard/development/osm2city/utils/utilities.py", line 455, in probe_list_of_points
    elev_is_solid_tuple = self.probe(ve.Vec2d(point))
  File "/home/bernhard/development/osm2city/utils/utilities.py", line 441, in probe
    elev_is_solid_tuple = really_probe(position)
  File "/home/bernhard/development/osm2city/utils/utilities.py", line 389, in really_probe
    self._open_fgelev()
  File "/home/bernhard/development/osm2city/utils/utilities.py", line 361, in _open_fgelev
    bufsize=1, universal_newlines=True)
  File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1490, in _execute_child
    restore_signals, start_new_session, preexec_fn)
OSError: [Errno 12] Cannot allocate memory
******* Exception in tile 3203649 - to reprocess use boundaries: 15.25_47.0_15.5_47.125 ******* at 2018-06-21_185930 - 
Traceback (most recent call last):
  File "/home/bernhard/development/osm2city/utils/utilities.py", line 438, in probe
    elev_is_solid_tuple = self._cache[key]
KeyError: (15.3533606, 47.1186913)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/bernhard/development/osm2city/build_tiles.py", line 141, in process_scenery_tile
    osm_buildings, file_lock)
  File "/home/bernhard/development/osm2city/buildings.py", line 636, in process_buildings
    prepare_textures.facades, prepare_textures.roofs, stats)
  File "/home/bernhard/development/osm2city/building_lib.py", line 1288, in analyse
    if not b.analyse_elev_and_water(fg_elev):
  File "/home/bernhard/development/osm2city/building_lib.py", line 556, in analyse_elev_and_water
    temp_ground_elev = fg_elev.probe_list_of_points(self.pts_outer)
  File "/home/bernhard/development/osm2city/utils/utilities.py", line 455, in probe_list_of_points
    elev_is_solid_tuple = self.probe(ve.Vec2d(point))
  File "/home/bernhard/development/osm2city/utils/utilities.py", line 441, in probe
    elev_is_solid_tuple = really_probe(position)
  File "/home/bernhard/development/osm2city/utils/utilities.py", line 389, in really_probe
    self._open_fgelev()
  File "/home/bernhard/development/osm2city/utils/utilities.py", line 361, in _open_fgelev
    bufsize=1, universal_newlines=True)
  File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1490, in _execute_child
    restore_signals, start_new_session, preexec_fn)
OSError: [Errno 12] Cannot allocate memory


3 Run: ubuntu run in a Virtual Machine.
So i increase Memory from 8 to 12 Gb and run again
python ./build_tiles.py -f GRAZ_TEST/params.ini -b 15.25_47.00_15.50_47.125 -p 2

Let see what happens...
powoflight
 
Posts: 212
Joined: Fri Mar 25, 2016 11:04 am
Location: LOWW
Callsign: OE-POW
Version: 2020.4
OS: win7 Ubuntu 18.04

Re: osm2city.py development

Postby powoflight » Fri Jun 22, 2018 11:46 am

It would be great to get some feedback, whether it improved. Currently I am looking into how to improve the situation, such that the share of gabled roofs gets significantly increased.

No success .

I generate the same area with the last osm2city Version using the same parameters . Starting FG with same parameters at the same point. Now buildings do not disappear.
But if I fly with the UFO "somewhere around" Buildings disappear somewhere else (not far away). :( :?:

Hint:
If I disable OpenStreetMap Data in the Rendering Options every think is allright. I can see Pylons and Detailed Roads. Nothing disappears
Pylons and power lines: Enabled
Detailed Roads and Railways: Enable

Randomly Generated Buildings are OK too. Nothing disappears.
So this behavior belongs only to the OpenStreetMap Data.

I think I should ask in the Suport/Grafic Forum
powoflight
 
Posts: 212
Joined: Fri Mar 25, 2016 11:04 am
Location: LOWW
Callsign: OE-POW
Version: 2020.4
OS: win7 Ubuntu 18.04

Re: osm2city.py development

Postby vanosten » Sun Jun 24, 2018 8:45 am

Have you tried to check the logs by setting --log-level=bulk?
Maintaining osm2city. Contributing with ground attack stuff to the OPRF FlightGear military-simulation community.
vanosten
 
Posts: 542
Joined: Sat Sep 25, 2010 6:38 pm
Location: Denmark - but I am Swiss
Pronouns: he/his
Callsign: HB-VANO
Version: latest
OS: Win 10 and Ubuntu

Re: osm2city.py development

Postby Johnson » Sat Jul 07, 2018 2:11 pm

Is Sweden available as a OSM populated area?
Ive been searching the forum but cant verify. I was sure I saw it. I generated Sweden myself before o2c started using databases(?) then it got too difficult. Idiotically I deleted all my work, didnt feel it was good enough. Would kill for Sweden or rather Stockholm/ESSA now as its my locale. Also Im user Adam-One, forum doesnt let me log in.
Johnson
 
Posts: 3
Joined: Fri May 27, 2016 4:00 pm

Re: osm2city.py development

Postby wkitty42 » Sat Jul 07, 2018 2:57 pm

Johnson wrote in Sat Jul 07, 2018 2:11 pm:Also Im user Adam-One, forum doesnt let me log in.

do you mean user "adam_one" with an underscore? joined at the beginning of 2016 with a "richard Stallman" OS and 55 posts to date? ;)
i don't find an "Adam-One" with caps like that or a dash...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9165
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 22.04

Re: osm2city.py development

Postby adam_one » Sat Jul 07, 2018 3:25 pm

wkitty42 wrote in Sat Jul 07, 2018 2:57 pm:
Johnson wrote in Sat Jul 07, 2018 2:11 pm:Also Im user Adam-One, forum doesnt let me log in.

do you mean user "adam_one" with an underscore? joined at the beginning of 2016 with a "richard Stallman" OS and 55 posts to date? ;)
i don't find an "Adam-One" with caps like that or a dash...

Why yes.
adam_one
 
Posts: 64
Joined: Tue Jan 05, 2016 3:41 pm
Version: alpha
OS: pirated

Re: osm2city.py development

Postby wkitty42 » Sat Jul 07, 2018 5:35 pm

:mrgreen:
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9165
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 22.04

Re: osm2city.py development

Postby adam_one » Sat Jul 07, 2018 6:03 pm

@Vanosten or anyone else who has osm2city set up and ready to generate:

if you could do one pass of Sweden with ***.py or the greater Stockholm area and upload it I would be indefinitely grateful.

Buildings in the water and other bugs are totally fine, it just feels so empty. So please, one pass with ***.py is all i ask.
adam_one
 
Posts: 64
Joined: Tue Jan 05, 2016 3:41 pm
Version: alpha
OS: pirated

Re: osm2city.py development

Postby vanosten » Mon Jul 09, 2018 7:51 pm

I might have a look beginning of August - however I know that Stockholm will not look good - it is one of my test areas, as I live there 4 days per week. The readon is that the mapping in OSM is not done per house but per block. And because Stockholm is anything but flat it looks wired.
Maintaining osm2city. Contributing with ground attack stuff to the OPRF FlightGear military-simulation community.
vanosten
 
Posts: 542
Joined: Sat Sep 25, 2010 6:38 pm
Location: Denmark - but I am Swiss
Pronouns: he/his
Callsign: HB-VANO
Version: latest
OS: Win 10 and Ubuntu

Re: osm2city.py development

Postby saul » Tue Jul 10, 2018 6:00 pm

Hej,

I can work now on Stockholm/Sweden. It is in my todo list after updating OSM Ecuador (which is ready and should be pushed to git).
The main problem with Sweden is that it is a complete different case. Basically the whole country is in OSM and it will generate tons of data. I have not figured out how to handle this problem. My first approximation is to work only on selected areas: Stockholm, Göteborg, Lund/Malmö, Linköping, and maybe Luleå? Only covering Stockholm/Uppsala takes around 1GB...

A little bit off-topic. No need to give up on generating scenery because the change to database based scripts! Once you get the tools working, everything works smoothly. I just did the re-install recently after updating to ubuntu 18.04. I have never used psql before, but managed to get it working. So it is definetely possible for someone else to handle the challenge. Here is my recipe:

1) INSTALL in Ubuntu 18.04
https://www.digitalocean.com/community/ ... untu-18-04

Useful commands:
https://www.digitalocean.com/community/ ... n-a-vps--2

Open a database
psql database_name

Delete a database
sudo -u postgres dropdb database_name

Open a database as a superuser
psql database_name

quit database
\q

See the roles
\du

2) Change the password of postgres
sudo -u postgres psql
alter user postgres password 'TYPE_YOUR_PASSWD';


3) CREATE the giuser

https://www.digitalocean.com/community/ ... untu-18-04

from terminal
sudo -u postgres createuser --interactive

or inside psql
sudo -u postgres psql
createuser --interactive


Here follow the interactive instructions to create a user.

3) TROUBLESHOOTING

3.1) postgres authentication failed:

https://stackoverflow.com/questions/186 ... ying-to-ge

The problem is in your pg_hba.conf file (/etc/postgresql/9.1/main/pg_hba.conf). Open the file and change the following line:

local all postgres peer

to:

local all postgres md5


After changing the line, restart the server:

sudo service postgresql restart

3.2) giuser password not set

sudo -u postgres psql

and change the password

alter user giuser password 'hola';

3.3) The listeing port in OSM instructions is different than in the instructions:

The default port is 5432

Working line:

~/osmosis --read-pbf file="sto.pbf" --log-progress --write-pgsql database=stockholm host=localhost:5432 user=giuser password=hola

4) Example scripts taken from ECUADOR project:
#create_ecuador.sh
#delete existing database
sudo -u postgres dropdb ecuador

#create a new database with giuser as owner
sudo -u postgres createdb --encoding=UTF8 --owner=giuser ecuador

#magic lines
psql --username=postgres --dbname=ecuador -c "CREATE EXTENSION postgis;"
psql --username=postgres --dbname=ecuador -c "CREATE EXTENSION hstore;"
psql --username=postgres -d ecuador -f /home/saul/flightgear/dev_osmcity/osmosis/script/pgsnapshot_schema_0.6.sql
psql --username=postgres -d ecuador -f /home/saul/flightgear/dev_osmcity/osmosis/script/pgsnapshot_schema_0.6_bbox.sql

#fill the database
~/osmosis --read-pbf file="ecuador-latest.osm.pbf" --log-progress --write-pgsql database=ecuador host=localhost:5432 user=giuser password=hola

And the params.ini file:

PREFIX = "ECUADOR"

MAX_SLOPE_ROAD = 0.20
MIN_ABOVE_GROUND_LEVEL = 0.02

PATH_TO_SCENERY = "/home/saul/flightgear/scenery"
PATH_TO_OUTPUT = "/home/saul/flightgear/custom_scen/ECUADOR"

PATH_TO_OSM2CITY_DATA = "/home/saul/flightgear/dev_osmcity/osm2city-data"

DB_HOST = "localhost"
DB_PORT = 5432
DB_NAME = "ecuador"
DB_USER = "giuser"
DB_USER_PASSWORD = "hola"


NO_ELEV = False
FG_ELEV = "/home/saul/flightgear/stable/install/flightgear/bin/fgelev"

#TEXTURES_REGIONS_EXPLICIT = ["de"]
#Is this needed anymore???
#FLAG_2017_2 = True

Command to create the tiles with osm2city objects:
/usr/bin/python3.6 build_tiles.py -f ecuador/params.ini -b *-78.62_-0.585_-78.24_0.06 -p 4
saul
 
Posts: 40
Joined: Tue Nov 26, 2013 10:57 pm

Re: osm2city.py development

Postby adam_one » Wed Jul 11, 2018 1:31 pm

vanosten wrote in Mon Jul 09, 2018 7:51 pm:I might have a look beginning of August - however I know that Stockholm will not look good - it is one of my test areas, as I live there 4 days per week. The readon is that the mapping in OSM is not done per house but per block. And because Stockholm is anything but flat it looks wired.

i want the weird one, can i have it please
adam_one
 
Posts: 64
Joined: Tue Jan 05, 2016 3:41 pm
Version: alpha
OS: pirated

PreviousNext

Return to Scenery

Who is online

Users browsing this forum: No registered users and 4 guests