Board index FlightGear Development Scenery

osm2city.py development

Questions and discussion about enhancing and populating the FlightGear world.

Re: osm2city.py development

Postby slawekmikula » Mon Sep 04, 2017 4:08 pm

I recreated osm2city scenery with the newest code. I think something is not right. There is much less buildings than with the previous version, which I was using (ca. 2017.05).

Cracow/Poland with version pre 2017.2:

Image

The same area with 2017.2 compatibility flag and newest osm2city code:

Image

Tile on the screens: #3269379. My ini file (warning, different boundaries).

Code: Select all
PREFIX = "europe/poland/malopolskie"
PATH_TO_SCENERY = "[...]/osm2city/flightgear/fgfs_terrasync"
PATH_TO_OUTPUT = "[...]/osm2city/fg_customscenery/europe/poland/malopolskie"
PATH_TO_OSM2CITY_DATA = "[...]/osm2city/development/osm2city-data"
OSM_FILE = "europe/poland/malopolskie-latest.osm"

OVERLAP_CHECK_CONVEX_HULL=True
OVERLAP_CHECK_CH_BUFFER_STATIC=15

TEXTURES_REGIONS_EXPLICIT = ["de", "gb", "us"]
FLAG_2017_2 = True

BOUNDARY_WEST = 20.0
BOUNDARY_EAST = 20.25
BOUNDARY_NORTH = 50.125
BOUNDARY_SOUTH = 50.0

NO_ELEV = False
FG_ELEV = '[...]/releases/2017.2.1/fgbin/bin//fgelev'
FG_ELEV_CACHE = False

PROBE_FOR_WATER=True
TRAFFIC_SHADER_ENABLE = True

USE_DATABASE = True
DB_HOST = "localhost"
DB_PORT = 5432
DB_NAME = "osmgis"
DB_USER = "osmgis"
DB_USER_PASSWORD = "osmgis"
slawekmikula
 
Posts: 128
Joined: Sun Feb 19, 2017 10:31 am

Re: osm2city.py development

Postby vanosten » Mon Sep 04, 2017 4:37 pm

I am not sure this is it: But by comparing which buildings are missing I have a non-qualified suspicion that you might not use the newest / corresponding osm2city-data.

Non-related to this regarding roads.py:
  • I can see that there is some task of aligning trams and streets in the same place -> I will add an issue to the log
  • You get the same "white triangle" things on the roads. I still do not exactly know, where they are from (Thorsten has replyied on this in an earlier post).
  • You might want to have a look at the parameters POINTS_ON_LINE_DISTANCE_MAX and MIN_ABOVE_GROUND_LEVEL. It looks like they are too conservative if taken from defaults - depends on the bumpiness of your scenery.
Maintaining osm2city. Contributing with ground attack stuff to the OPRF FlightGear military-simulation community.
vanosten
 
Posts: 540
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 slawekmikula » Mon Sep 04, 2017 5:13 pm

Regarding osm2city-data:
Code: Select all
[remote "origin"]
   url = https://gitlab.com/fg-radi/osm2city-data.git
   fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
   remote = origin
   merge = refs/heads/master



and

Code: Select all
xx@yyy:[..]/development/osm2city-data$ git pull
Already up-to-date.



Thanks, i'll check parameters.

Anyway, additional thing. When processing whole areas (voivodeships) i had exceptions like that:

Code: Select all
******* Exception with tile 3285760 to reprocess use boundaries: 20.0_50.0_20.25_50.125 ******* at 20170830_15:08:23 -
Traceback (most recent call last):
  File "[...]/osm2city/development/osm2city/batch_processing/build_tiles_db.py", line 99, in process_scenery_tile
    roads.process(the_coords_transform, my_fg_elev, my_blocked_areas, my_stg_entries, file_lock)
  File "[...]/osm2city/development/osm2city/roads.py", line 1338, in process
    roads.process(blocked_areas, stg_entries, landuses_lit, stats)  # does the heavy lifting incl. clustering
  File "[...]/osm2city/development/osm2city/roads.py", line 418, in process
    self._cleanup_topology()
  File "[...]/osm2city/development/osm2city/roads.py", line 890, in _cleanup_topology
    self._rejoin_ways(attached_ways_dict)
  File "[...]/osm2city/development/osm2city/roads.py", line 1131, in _rejoin_ways
    second_node.lon, second_node.lat)
  File "[...]/osm2city/development/osm2city/utils/coordinates.py", line 154, in calc_angle_of_line_global
    angle = 2*pi-acos((sin(lat2_r)-sin(lat1_r)*cos(d))/(sin(d)*cos(lat1_r)))
ZeroDivisionError: float division by zero


I was already thinking about posting an issue, but .. i had modified my auto-generate scripts to reprocess data (newest at: https://github.com/slawekmikula/scripts-osm2city) and the same areas does not raise errors when processing single. Any idea why ? :)
slawekmikula
 
Posts: 128
Joined: Sun Feb 19, 2017 10:31 am

Re: osm2city.py development

Postby slawekmikula » Tue Sep 05, 2017 1:47 pm

vanosten, thanks for tips on POINTS_ON_LINE_DISTANCE_MAX and MIN_ABOVE_GROUND_LEVEL. I have set MIN_ABOVE_GROUND_LEVEL=0.1 and POINTS_ON_LINE_DISTANCE_MAX=100. Roads are much better. The scenery degradation still exists. I'm processing europe/poland/malopolskie from gofabrik with boundaries: 19.75_49.875_20.25_50.125 (4 tiles).

Anyway, i have another issue with OSM2City objects in FG. When i start FG (latest git version) building load normally as here:

Image

When I travel for some time (ufo aircraft, ca 150 kias) at some time (ca 15-20 sec) whole area (tile?) of OSM buildings disappears:

Image

When traveling further (to next tiles, they loads normally, but the 'lost' tile keeps hiddend state. Only restart helps. Tiles disappears randomly.
slawekmikula
 
Posts: 128
Joined: Sun Feb 19, 2017 10:31 am

Re: osm2city.py development

Postby wkitty42 » Tue Sep 05, 2017 4:02 pm

what are your LOD setting in-sim?

are you applying any LOD settings to the OSM buildings when you run the script? this really should not be being done... let the sim handle the LOD based on your position instead of the building telling the sim when it can load... the building doesn't know... the sim does and it should be the one to handle it... there are a lot of objects that come with a xml file that messes with LOD settings and really shouldn't...
"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: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: osm2city.py development

Postby slawekmikula » Tue Sep 05, 2017 5:22 pm

In-sim: detailed: 5000, Rough: 9000, Bare: 30000
No, i haven't done any changes to default osm2city LOD settings.

My current settings (for mentioned area):

Code: Select all
PREFIX = "europe/poland/malopolskie"
PATH_TO_SCENERY = "[...]/osm2city/flightgear/fgfs_terrasync"
PATH_TO_OUTPUT = "[...]/osm2city/fg_customscenery/europe/poland/malopolskie"
PATH_TO_OSM2CITY_DATA = "[...]/osm2city/development/osm2city-data"
OSM_FILE = "europe/poland/malopolskie-latest.osm"

OVERLAP_CHECK_CONVEX_HULL=True
OVERLAP_CHECK_CH_BUFFER_STATIC=15

TEXTURES_REGIONS_EXPLICIT = ["de", "gb", "us"]
FLAG_2017_2 = True

MIN_ABOVE_GROUND_LEVEL=0.1
POINTS_ON_LINE_DISTANCE_MAX=100

BOUNDARY_WEST = 19.75
BOUNDARY_EAST = 20.25
BOUNDARY_NORTH = 50.125
BOUNDARY_SOUTH = 49.875

NO_ELEV = False
FG_ELEV = '[...]/flightgear/releases/2017.2.1/fgbin/bin//fgelev'
FG_ELEV_CACHE = False

PROBE_FOR_WATER=True
TRAFFIC_SHADER_ENABLE = True

USE_DATABASE = True
DB_HOST = "localhost"
DB_PORT = 5432
DB_NAME = "osmgis"
DB_USER = "osmgis"
DB_USER_PASSWORD = "osmgis"
slawekmikula
 
Posts: 128
Joined: Sun Feb 19, 2017 10:31 am

Re: osm2city.py development

Postby vanosten » Tue Sep 05, 2017 6:28 pm

Is there any specific reason for you to pick OVERLAP_CHECK_CH_BUFFER_STATIC=15? I normally run with OVERLAP_CHECK_CH_BUFFER_STATIC=0.0. I guess this does not solve the current challenge of missing a lot of houses. But it might be worth a try.
Maintaining osm2city. Contributing with ground attack stuff to the OPRF FlightGear military-simulation community.
vanosten
 
Posts: 540
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 slawekmikula » Tue Sep 05, 2017 6:32 pm

I have included it from paju responses regarding spain/portugal osm2city generation - checking if osm building overlaps with static scenery there.
slawekmikula
 
Posts: 128
Joined: Sun Feb 19, 2017 10:31 am

Re: osm2city.py development

Postby vanosten » Sun Sep 10, 2017 6:48 pm

The code for roofs on buildings has changed quite a bit. Based on my default test sceneries around Lucern and Stockholm it seems to work nicely. The main "feature" introduced are a set of parameters to guide the heuristics on what type of roofs to use if the roof:shape tag in OSM is missing (which is almost always the case). See http://osm2city.readthedocs.io/en/lates ... -buildings.

Also parameter PATH_TO_SCENERY_OPT now takes a list of paths to do overlap checking.

Next on my list is giving it a try to (re)enable inner rings in buildings.
Maintaining osm2city. Contributing with ground attack stuff to the OPRF FlightGear military-simulation community.
vanosten
 
Posts: 540
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 vanosten » Fri Sep 22, 2017 5:16 pm

vanosten wrote in Sun Sep 10, 2017 6:48 pm:Next on my list is giving it a try to (re)enable inner rings in buildings.


Well, it is not. I generated the scenery around Prague (the 2017.3 default airport) and found a new set of issues. The first one is now corrected: chimneys (also the ones tagged as buildings) are now shown using static models.

Other issues are:
  • tram ways on top of roads
  • default building heights look odd
  • churches look "amazing" as a combination of buildings (the way they are mapped in OSM), but should be replaced by static models.

When all that is done, I might have a look at inner rings again (which are not so much in need in Prague given the way buildings are mapped there.
Maintaining osm2city. Contributing with ground attack stuff to the OPRF FlightGear military-simulation community.
vanosten
 
Posts: 540
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 paju1986 » Fri Sep 22, 2017 6:17 pm

Excelent, looking forwars for regenerating my old scenerys with all the improvemets after the next version comes out :)
paju1986
 
Posts: 246
Joined: Sun Oct 30, 2011 8:42 pm
Location: Badajoz (Spain) - LEBZ
OS: Arch Linux

Re: osm2city.py development

Postby vanosten » Sat Sep 23, 2017 1:58 pm

vanosten wrote in Fri Sep 22, 2017 5:16 pm:Other issues are:
  • tram ways on top of roads
  • default building heights look odd
  • churches look "amazing" as a combination of buildings (the way they are mapped in OSM), but should be replaced by static models.


There is now a new parameter USE_TRAM_WAYS per default set to False. See also https://gitlab.com/fg-radi/osm2city/issues/52 -> to be corrected in the future.

Regarding odd building heights: it turns out that building:levels in the majority of cases is wrongly set to 1, when special data for Czech Republic is imported into OSM (http://wiki.openstreetmap.org/wiki/RUIAN). I have added some primitive heuristics to "correct" the levels again.
Maintaining osm2city. Contributing with ground attack stuff to the OPRF FlightGear military-simulation community.
vanosten
 
Posts: 540
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 www2 » Mon Sep 25, 2017 11:32 am

I found an intresting project from OSM google summer of code.
and 3D Model Repository[1]

[1] https://blog.openstreetmap.org/2017/09/ ... code-2017/
www2
 
Posts: 319
Joined: Thu Apr 16, 2009 2:58 pm
OS: Ubuntu

Re: osm2city.py development

Postby vanosten » Tue Sep 26, 2017 4:40 pm

Looks interesting despite the fact, that the library does not seem to go live before some months from now. And we will have to see, what the licensing specs will be. However it looks to me more of an effort for doing unique static buildings than resuable generic buildings (i.e. not osm2city). Otherwise, OBJ-format is not a big problem (I have an unfinished implementation of a converter to the ac-format).
Last edited by Johan G on Sun Nov 12, 2017 3:31 pm, edited 1 time in total.
Reason: No need to quote the entire preceeding post
Maintaining osm2city. Contributing with ground attack stuff to the OPRF FlightGear military-simulation community.
vanosten
 
Posts: 540
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 www2 » Tue Sep 26, 2017 6:59 pm

My guest for the licensing is CC-BY v4 or CC-BY-SA v4 or ODBL.
www2
 
Posts: 319
Joined: Thu Apr 16, 2009 2:58 pm
OS: Ubuntu

PreviousNext

Return to Scenery

Who is online

Users browsing this forum: No registered users and 9 guests