Board index FlightGear Development Scenery

Basic Guide to creating more accurate Scenery

Questions and discussion about enhancing and populating the FlightGear world.

Re: Basic Guide to creating more accurate Scenery

Postby montagdude » Thu Feb 13, 2020 5:08 pm

V12 wrote in Thu Feb 13, 2020 9:19 am:What about borders of regenerated terrain tiles ? All my attemps 2 years ago ended with visible seams :(

Do you mean the borders where they meet the original scenery? Unless you are using the same elevation data, I would expect there to be seams.
montagdude
 
Posts: 266
Joined: Tue Dec 31, 2019 7:04 am

Re: Basic Guide to creating more accurate Scenery

Postby Timi » Thu Feb 13, 2020 10:46 pm

montagdude wrote in Sun Feb 09, 2020 5:02 am:I hope you don't mind me asking, but I'm trying to figure out how to convert OSM landuse data to FlightGear format with TerraGear and am coming up empty. First, I downloaded shape files for the region of interest using one of the services listed in the openstreetmap wiki (specifically, the BBBike extract service):.


Just saw this post and figured I'd post the way I have been doing it and that is
by extracting a single land class for a given area from the OSM data and then
converting it to a shape file. The tools I used were osmium and ogr2ogr:

# Extract land-class
osmium tags-filter UK-Ireland.pbf w/amenity=grave_yard -o amenity.grave_yard.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON amenity.grave_yard.shp amenity.grave_yard.pbf

osmium tags-filter UK-Ireland.pbf w/landcover=grass -o landcover.grass.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landcover.grass.shp landcover.grass.pbf

osmium tags-filter UK-Ireland.pbf w/landuse=grass -o landuse.grass.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landuse.grass.shp landuse.grass.pbf

osmium tags-filter UK-Ireland.pbf w/natural=grassland -o natural.grassland.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.grassland.shp natural.grassland.pbf

osmium tags-filter UK-Ireland.pbf w/landcover=trees -o landcover.trees.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landcover.trees.shp landcover.trees.pbf

osmium tags-filter UK-Ireland.pbf w/landuse=forest -o landuse.forest.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landuse.forest.shp landuse.forest.pbf

osmium tags-filter UK-Ireland.pbf w/landuse=wood -o landuse.wood.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landuse.wood.shp landuse.wood.pbf

osmium tags-filter UK-Ireland.pbf w/natural=heath -o natural.heath.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.heath.shp natural.heath.pbf

osmium tags-filter UK-Ireland.pbf w/natural=wood -o natural.wood.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.wood.shp natural.wood.pbf

osmium tags-filter UK-Ireland.pbf w/wetland=bog -o wetland.bog.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON wetland.bog.shp wetland.bog.pbf

osmium tags-filter UK-Ireland.pbf w/woodland=* -o woodland.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON woodland.shp woodland.pbf

osmium tags-filter UK-Ireland.pbf w/landuse=landfill -o landuse.landfill.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landuse.landfill.shp landuse.landfill.pbf

osmium tags-filter UK-Ireland.pbf w/leisure=golf_course -o leisure.golf_course.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON leisure.golf_course.shp leisure.golf_course.pbf

osmium tags-filter UK-Ireland.pbf w/crop=* -o crop.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON crop.shp crop.pbf

osmium tags-filter UK-Ireland.pbf w/landuse=orchard -o landuse.orchard.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landuse.orchard.shp landuse.orchard.pbf

osmium tags-filter UK-Ireland.pbf w/landuse=reservoir -o landuse.reservoir.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landuse.reservoir.shp landuse.reservoir.pbf

osmium tags-filter UK-Ireland.pbf w/natural=water -o natural.water.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.water.shp natural.water.pbf

osmium tags-filter UK-Ireland.pbf w/waterway=* -o waterway.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON waterway.shp waterway.pbf

osmium tags-filter UK-Ireland.pbf w/island=* -o island.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON island.shp island.pbf

osmium tags-filter UK-Ireland.pbf w/natural=coastline -o natural.coastline.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.coastline.shp natural.coastline.pbf

osmium tags-filter UK-Ireland.pbf w/natural=marsh -o natural.marsh.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.marsh.shp natural.marsh.pbf

osmium tags-filter UK-Ireland.pbf w/natural=wetland -o natural.wetland.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.wetland.shp natural.wetland.pbf

osmium tags-filter UK-Ireland.pbf w/wetland=fen -o wetland.fen.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON wetland.fen.shp wetland.fen.pbf

osmium tags-filter UK-Ireland.pbf w/wetland=marsh -o wetland.marsh.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON wetland.marsh.shp wetland.marsh.pbf

osmium tags-filter UK-Ireland.pbf w/landuse=meadow -o landuse.meadow.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landuse.meadow.shp landuse.meadow.pbf

osmium tags-filter UK-Ireland.pbf w/landuse=pasture -o landuse.pasture.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landuse.pasture.shp landuse.pasture.pbf

osmium tags-filter UK-Ireland.pbf w/meadow=pasture -o meadow.pasture.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON meadow.pasture.shp meadow.pasture.pbf

osmium tags-filter UK-Ireland.pbf w/landuse=quarry -o landuse.quarry.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landuse.quarry.shp landuse.quarry.pbf

osmium tags-filter UK-Ireland.pbf w/landcover=gravel -o landcover.gravel.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landcover.gravel.shp landcover.gravel.pbf

osmium tags-filter UK-Ireland.pbf w/natural=bare_rock -o natural.bare_rock.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.bare_rock.shp natural.bare_rock.pbf

osmium tags-filter UK-Ireland.pbf w/natural=cliff -o natural.cliff.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.cliff.shp natural.cliff.pbf

osmium tags-filter UK-Ireland.pbf w/natural=rock -o natural.rock.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.rock.shp natural.rock.pbf

osmium tags-filter UK-Ireland.pbf w/natural=stone -o natural.stone.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.stone.shp natural.stone.pbf

osmium tags-filter UK-Ireland.pbf w/natural=beach -o natural.beach.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.beach.shp natural.beach.pbf

osmium tags-filter UK-Ireland.pbf w/natural=dune -o natural.dune.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.dune.shp natural.dune.pbf

osmium tags-filter UK-Ireland.pbf w/natural=sand -o natural.sand.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.sand.shp natural.sand.pbf

osmium tags-filter UK-Ireland.pbf w/natural=scrub -o natural.scrub.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.scrub.shp natural.scrub.pbf
Timi
 
Posts: 68
Joined: Mon Nov 21, 2016 9:08 am
Callsign: Jaeger
Version: 2020.4.0

Re: Basic Guide to creating more accurate Scenery

Postby montagdude » Fri Feb 14, 2020 3:22 am

Thanks for the info. At least for the areas I've been working on, the NLCD landcover data is much more complete than the OSM data, but this could be useful for regions other than the US.
montagdude
 
Posts: 266
Joined: Tue Dec 31, 2019 7:04 am

Re: Basic Guide to creating more accurate Scenery

Postby montagdude » Fri Feb 14, 2020 4:22 am

I have started a new thread with a walkthrough on how to use the NLCD (land cover) data to improve the scenery in the US. I figured it would be better in its own thread.

https://forum.flightgear.org/viewtopic.php?f=5&t=36913
montagdude
 
Posts: 266
Joined: Tue Dec 31, 2019 7:04 am

Re: Basic Guide to creating more accurate Scenery

Postby wlbragg » Fri Feb 14, 2020 5:18 am

The NLCD landcover data is much more complete than the OSM data


OSM has water data that is useful. I used 3-4 different sources for the water layers a few years back for the Kansas and Ohio scenery.

SRTM had a water land class database (SWBD)
OSM-ThinkGeo
Tiger Census (TGR12) also had a water layer that filled in a bunch of gaps for small ponds.

Seems like one or two of these also had stream line data that completely filled in the watershed data in the areas of interest.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7586
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Basic Guide to creating more accurate Scenery

Postby montagdude » Fri Feb 14, 2020 5:41 am

wlbragg wrote in Fri Feb 14, 2020 5:18 am:
The NLCD landcover data is much more complete than the OSM data


OSM has water data that is useful. I used 3-4 different sources for the water layers a few years back for the Kansas and Ohio scenery.

SRTM had a water land class database (SWBD)
OSM-ThinkGeo
Tiger Census (TGR12) also had a water layer that filled in a bunch of gaps for small ponds.

Seems like one or two of these also had stream line data that completely filled in the watershed data in the areas of interest.

I'm asking from inexperience here, but let's say I wanted to use NLCD for land and SRTM for inland water. It seems like it would be hard to get the two datasets to match up exactly, leaving gaps between them. How do you handle that?
montagdude
 
Posts: 266
Joined: Tue Dec 31, 2019 7:04 am

Re: Basic Guide to creating more accurate Scenery

Postby wlbragg » Fri Feb 14, 2020 7:58 am

Not at all. If I remember correctly I discarded the NLCD water layer as its resolution wasn't as good as the other sources. As far as the other sources, I used the best of each.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7586
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Basic Guide to creating more accurate Scenery

Postby wlbragg » Fri Feb 14, 2020 8:09 am

This was the default NLCD.

Image

This is what I ended up with after using data from additional sources.

Image
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7586
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Basic Guide to creating more accurate Scenery

Postby ludomotico » Fri Feb 14, 2020 10:28 am

montagdude wrote in Fri Feb 14, 2020 5:41 am:It seems like it would be hard to get the two datasets to match up exactly, leaving gaps between them. How do you handle that?


Layers can overlap without problems. There is a priority.txt file to describe what happens when layers overlap. Also, you can use a "default landmass" to fill all gaps.

Years ago, I used CORINE for land use and OSM as the default landmass: its coastline is much better than CORINE's or VMAP0.

You probably want to assign a different class to the default landmass: by default, it's wood area. In my area, defaulting to crops works ok.
User avatar
ludomotico
 
Posts: 1269
Joined: Tue Apr 24, 2012 2:01 pm
Version: nightly
OS: Windows 10

Re: Basic Guide to creating more accurate Scenery

Postby Timi » Fri Feb 14, 2020 1:04 pm

montagdude wrote in Fri Feb 14, 2020 3:22 am:Thanks for the info. At least for the areas I've been working on, the NLCD landcover data is much more complete than the OSM data, but this could be useful for regions other than the US.


I have worked on European areas where the coverage is good and so is the resolution.
A short demonstration flight around the Llanbedr Airport.
Timi
 
Posts: 68
Joined: Mon Nov 21, 2016 9:08 am
Callsign: Jaeger
Version: 2020.4.0

Re: Basic Guide to creating more accurate Scenery

Postby montagdude » Tue Feb 18, 2020 5:15 am

I am trying to generate scenery for a large area by doing it a single 1x1 degree tile at a time. So for each tile, I process SRTM-1 elevation data, generate airports, generate land cover from NLCD data, and then use osm2city for buildings, roads, and other objects. The problem is that the borders of these tiles have gaps that look like a major earthquake struck. I thought it would be fine since I am using the same elevation data for everything. An example picture is below. How do I avoid this?

Image

This may or may not be related, but it also looks like it is treating the tile edges as "cliff edges," with steep slopes down to sea level. I think this may be the problem, or at least part of the problem. Is there a flag to make it not do this? Generating the entire area at once is not going to be possible due to memory requirements.

EDIT: currently I have set the output for each tile in its own subdirectory and added each of these subdirectories to the list of custom scenery in the launcher. I'm not sure if this makes any difference, or if having tg-construct write to a common output directory each time would improve things.
montagdude
 
Posts: 266
Joined: Tue Dec 31, 2019 7:04 am

Re: Basic Guide to creating more accurate Scenery

Postby V12 » Tue Feb 18, 2020 6:24 am

This is general and well known problem. You need use height data same as that used in world scenery generation process. If WorldScenery used SRTM3 and for Your terrain You use SRTM1, this is unavoidable result. Check this : viewtopic.php?f=5&t=36075#p350712, it may help.
Fly high, fly fast - fly Concorde !
V12
 
Posts: 2757
Joined: Thu Jan 12, 2017 5:27 pm
Location: LZIB
Callsign: BAWV12

Re: Basic Guide to creating more accurate Scenery

Postby ludomotico » Tue Feb 18, 2020 11:11 am

montagdude wrote in Tue Feb 18, 2020 5:15 am:I am trying to generate scenery for a large area by doing it a single 1x1 degree tile at a time. So for each tile, I process SRTM-1 elevation data (...)
EDIT: currently I have set the output for each tile in its own subdirectory (...)


You won't be able to remove gaps between your scenery and the official scenery, but you should be able to remove gaps inside your own custom scenery. Some tips based on my experiences some years ago:

- Process elevation (terrafit) only once covering the complete region you are interested on, and use its output for all your tiles. If you run it several times (don't!), the tiles built with the old data will have gaps. Also, consider using parameters that are close to the scenery 2.0, or those that minimize elevation errors as much as possible. Check the "General comments from forum discussion" (http://wiki.flightgear.org/Using_TerraG ... discussion) in the wiki for an explanation of the terrafit parameters.
- Even if the output for each tile is different, the "work" directory (the output directory for gdalchop, genapts and ogr-decode) must be the same to share the border information.
- Run genapts and ogr-decode as few times as possible. Not for every tile, it is not necessary: once per region, once per country...
- You can run tg-construct as many times as you want, once for each tile, for example. But run it always on the same "work" directory.
User avatar
ludomotico
 
Posts: 1269
Joined: Tue Apr 24, 2012 2:01 pm
Version: nightly
OS: Windows 10

Re: Basic Guide to creating more accurate Scenery

Postby xDraconian » Tue Feb 18, 2020 4:16 pm

ludomotico wrote in Tue Feb 18, 2020 11:11 am:- Even if the output for each tile is different, the "work" directory (the output directory for gdalchop, genapts and ogr-decode) must be the same to share the border information.

@ludomotico hit on the most important part. TerraGear will stitch together adjacent tiles if it can find them. When it cannot locate the bordering tile it assumes the adjacent tile is zero elevation and you get that weird skirt as output.
xDraconian
 
Posts: 406
Joined: Sun Jan 21, 2018 6:53 am
Version: Git
OS: Linux Mint

Re: Basic Guide to creating more accurate Scenery

Postby montagdude » Tue Feb 18, 2020 5:58 pm

Thank you all for the advice. It's a little unfortunate that it works that way, because that means I have to decide on the total extent up front.

Anyway, I don't think it will be a problem to process the elevation data and airports for the whole region at once. Using a common output directory is okay too; actually, it simplifies things now that I know I can't just add on tiles as I go. But I do need to divide the landclass processing into smaller tiles. Will it be okay to run ogr-decode on the shapefiles for a single tile at a time, as long as I have all the elevation data processed already and use the same work directory?
montagdude
 
Posts: 266
Joined: Tue Dec 31, 2019 7:04 am

PreviousNext

Return to Scenery

Who is online

Users browsing this forum: No registered users and 4 guests