#OrtoTex4XPL
It is tool for downloading ortho photos from online map web services and transforming to textures for X-Plane.
Can be used for:
- update existing ortho textures in sceneries generated by g2xpl tool
- creating airport base - importing orthophotos to WED (X-Plane world editor)
usage: OrtoTex4XPL.py [-h] [--zl ] [--src {gmaps,mapy}] [--base ] [--coord2 lat lng] [--remove-logo] [--keep-downloaded] [--dds-textures] [--dds-maxcpu ] [--wed-import] lat lng positional arguments: lat GPS lattitude --- for ex. 49.15296966 lng GPS longtitude -- for ex. 16.66625977 optional arguments: -h, --help show this help message and exit --zl <level> required map zoom level (10-24) -- default: 18 --src {gmaps,mapy} map source (mapy.cz, google maps) -- default: gmaps --base <path> output directory base -- default: /tmp/orto4xpl --coord2 lat lng Second GPS coordinates (lower right corner) --remove-logo try to remove logo merging with higher zoom level --keep-downloaded do not delete temporary img files after processing --dds-textures enable converting textures to dds (instead of png) --dds-maxcpu <num> maximum CPU cores used for DDS converting --wed-import enable creating DSF and POL files for import orto to WED
##Requires
The script is tested on GNU Linux (Debian) and Windows 7.
- Python 2.7+
- OpenCV python module (cv2) (optional)
- mercator.py
- DDStool, DSFtool
##Examples
####Updating textures from g2xpl
We have ortho scenery for one tile (X-Plane/Custom Scenery/example z_CZ_49_16-terrain). The folder usually contains 3 subfolders:
- Earth nav data - dsf file, mash definition (in this case)
- terrain - ter files, referenced from dsf, reffered to textures
- Textures - textures in dds format
We want to update all textures. The GPS coordinates of tile are needed. The coords can be obtained directly from ter files, especially from top left and bottom right ter file. The name of ter file is usually in following format: g2xpl_8_16_35680_43024.ter. Last two numbers are x and y coordinates.
We are looking for filename with lowest and highest x/y coordinates. In my case, x was in range 35680-35864, y in 43024-43312. Now, we need to open (in favourite text editor) files g2xpl_8_16_35680_43024.ter and g2xpl_8_16_35864_43312.ter. The GPS coordinates are on the line starting with LOAD_CENTER keyword.
A 800 TERRAIN LOAD_CENTER 48.994637 16.018066 3207 2048 BASE_TEX_NOWRAP ../textures/g2xpl_8_16_35680_43024.dds
I found 48.994637 16.018066 and 50.021858 17.028809 coordinates (lat lng) in my case. What is top left / bottom right? We can use google maps for check - just open web browser and put coords to google maps search box. In my case, first coordinate was bottom left and second top right. Coorect coords for the script are 50.021858 16.018066 and 48.994637 17.028809.
OrtoTex4XPL.py --zl16 50.021858 16.018066 --coord2 48.994637 17.028809 --keep-downloaded
NEW: You can also use script find_coords.py for getting coordinates (tested in Linux only)
./find_coords.py /opt/X-Plane\ 10/Custom\ Scenery/z_CZ_49_16-terrain/terrain/ 50.021858 16.018066 - 48.994637 17.028809