User:Laserman/TerraGear: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
Line 1: Line 1:
== bash scripts by IHAM-COL to run TerraGear Tools ==
'''decodeSRTM'''
<syntaxhighlight lang="bash">
#!/bin/bash
# SRTM1 (30m precision) might be too much
# SRTM3 (90m precision) is good enough
#old: hgtchop
#for i in $PWD/data/SRTM-1/*.hgt; do hgtchop 1 $i $PWD/work/SRTM-1; done
# gdalchop in for loop - not so good:
#for i in $PWD/data/SRTM-1/*.hgt; do  $PWD/work/SRTM-1 gdalchop $PWD/data/SRTM-1/N37W116.hgt ; done
#new, correct way to do it:
gdalchop work/SRTM1 SRTM-source/*.hgt
terrafit -e 5 -x 20000 work/SRTM-1
#terrafit work/SRTM-1
#terrafit -e 5 -x 20000  work/SRTM-3
</syntaxhighlight>
'''decodeTerrain'''
<syntaxhighlight lang="bash">
#!/bin/bash
#DECODING Terrain features
ogr-decode --max-segment 500 --area-type Default work/Default data/shapefiles/v0_landmass
ogr-decode --max-segment 500 --line-width 10 --area-type Stream work/Stream data/shapefiles/v0_stream
ogr-decode --point-width 500 --area-type Town work/Town data/shapefiles_custom/cs_town
#The others
ogr-decode --area-type IntermittentLake work/IntermittentLake data/shapefiles/v0_intermittentlake
ogr-decode --area-type Lake work/Lake data/shapefiles_custom/cs_lake
ogr-decode --area-type Scrub work/Scrub data/shapefiles_custom/cs_scrub
ogr-decode --area-type Dirt work/Dirt data/shapefiles_custom/cs_dirt
ogr-decode --area-type DryCrop work/Drycrop data/shapefiles_custom/cs_drycrop
ogr-decode --area-type EvergreenForest work/Evergreenforest data/shapefiles_custom/cs_evergreenforest
ogr-decode --area-type FloodLand work/floodland data/shapefiles_custom/cs_floodland
ogr-decode --area-type Grassland work/grassland data/shapefiles_custom/cs_grassland
ogr-decode --area-type Greenspace work/greenspace data/shapefiles_custom/cs_greenspace
ogr-decode --area-type Marsh work/marsh data/shapefiles_custom/cs_marsh
ogr-decode --area-type NaturalCrop work/Naturalcrop data/shapefiles_custom/cs_naturalcrop
ogr-decode --area-type SubUrban work/SubUrban data/shapefiles_custom/cs_suburban
ogr-decode --area-type Urban work/Urban data/shapefiles_custom/cs_urban
</syntaxhighlight>
'''
buildAirport'''
<syntaxhighlight lang="bash">
#!/bin/bash
#KXTA
#genapts850 --input=data/airports/kxta-active.apt.dat --work=work --airport=KXTA
genapts850 --input=data/airports/L92.apt.dat --work=work --airport=L92
</syntaxhighlight>
'''buildTerrain'''
<syntaxhighlight lang="bash">
#!/bin/bash
#MAXLON=-115.75
#MINLON=-115.90
#MINLAT=37.19
#MAXLAT=37.35
MINLON=-116
MAXLON=-115
MINLAT=37
MAXLAT=38
tg-construct --work-dir=./work --output-dir=./output/Terrain --min-lon=$MINLON --max-lon=$MAXLON --min-lat=$MINLAT --max-lat=$MAXLAT \
AirportArea SRTM-1 AirportObj Default \
Stream Town DryLake Lake Scrub Dirt Drycrop Evergreenforest Floodland Grassland Greenspace Marsh Naturalcrop SubUrban Urban Landmass
</syntaxhighlight>


== bash scripts by NickR for the same task ==
== bash scripts by NickR for the same task ==

Revision as of 18:24, 9 December 2016

bash scripts by NickR for the same task

https://gitlab.com/fg-scenery-build-script/fg-scenery-build-script/tree/master

file sizes

this depends on the file system that you use. many files are only a few bytes, but the smallest unit on a default Linux system is a 4kB block. I am tempted to try ZFS :-)

  • Terrain path of scenery 2.0: 87GB
  • number of Terrain stg files: 772233


elevation data

  • zipped elevation data from viewfinder panoramas (SRTM-3): 15GB
  • unzipped elevation data from viewfinder panoramas (SRTM-3): 52GB
  • size of work folder after hgtchop: 18GB
  • size of work folder after terrafit: 32GB
  • number of 10x10 degree folders: 378 (scenery2.0: 524)
  • 1x1 degree folders northern hemisphere: 15737 (scenery2.0: 19604)
  • 1x1 degree folders southern hemisphere: 4425 (scenery2.0: 13777)
  • number of .arr.gz files after hgtchop: 585280 (76% complete?)
  • number of .fit.gz files after terrafit: 585280 (76% complete?)

landcover

OSM roads for china: 500MB in data + 500MB in work

global land-polygons: 600MB in data + 3GB in work

build times (intel i3, 8GB RAM , SSD)

  • gloabal ogr-decode for land-poygons-split from http://openstreetmapdata.com/data/land-polygons: 5 minutes
  • tgconstruct for 36 tiles ZBAA-airport+terrain, no roads: 41 seconds
  • tgconstruct for 36 tiles ZBAA-airport+terrain+roads: >10 minutes