-
Notifications
You must be signed in to change notification settings - Fork 10
Home
Welcome to the chartmaker wiki!
node make or, node make arg from the /chartmaker command prompt
Chartmaker can process one of the following arguments: area-single=X, area-all, full-single=X, full-all where X is an ordinal index number from the appropriate list in settings.json. If no argument is provided, you will be prompted with a menu selection with these choices:
Select:
----------------------------------------------------------------
1 = Process a single area VFR chart
2 = Process all 52 area VFR charts individually
3 = Process a single full chart from the full chart list
4 = Process all of the full charts in the full chart list
----------------------------------------------------------------
Your selection:
After entering your selection, if it is one of the two "single" options you will be prompted with an indexed list to choose from. (see lists in settings.json below.)
The FAA publishes charts 20 days before the official chart date, and chartmaker will automatically select the nearest chart date from this file of official FAA chart 56-day release dates, all the way up to the year 2044. If the next chart date is more than 20 days out, chartmaker will get the current chart date.
- Edit the values in chartprocessindexes with any ordinal index numbers from the faachartnames list for charts you want to process, in the order you want them processed. The default is all charts in the index list, in index order. The setting array faachartnames are the actual zip filenames the FAA uses and are for reference only. Changes to the downloadtemplate or faachartnames, layertypes, and tiledrivers lists is not recommended!
- The zoom range value can either be in the format n-n, or you can use a single zoom level n
- You can change the tileimagequality percentage from 1 up to 100 and tiledriverindex index to 2 (webp) to reduce mbtiles file size. The smaller the percentage, the fuzzier the chart will be at high zoom levels.
- The tiledimagequality setting works for both png and webp images.
- To save disk space, you can set cleanprocessfolders to true.
- The merge and/or pngquant work folders will be many gigabytes for the entire chart set and are not needed once processing is complete
- To preserve the processed databases, you can set renameworkarea to true. This will rename the workarea folder to include the processed chart date so the next run will not overwrite the folder.
- attribution is a database metadata value that many mapping applications use for acknowledgement of the database creator*
"attribution": "Aviation charts <a href='https://github.com/n129bz/chartmaker'>github.com/n129bz/chartmaker</a>",
- curl download templates, values inside brackets <> are programmatically replaced with values to match FAA's file names*
"vfrdownloadtemplate": "https://aeronav.faa.gov/visual/<chartdate>/All_Files/<charttype>.zip",
"ifrdownloadtemplate": "https://aeronav.faa.gov/enroute/<chartdate>/<charttype>.zip",
"vfrindividualtemplate": "https://aeronav.faa.gov/visual/<chartdate>/sectional-files/<charttype>.zip",
"usvfrwallplanningtemplate": "https://aeronav.faa.gov/visual/<chartdate>/Planning/US_WallPlan.zip",
- application flags
"renameworkarea": false, <- if true, will append chart date to the working folder name
"logtofile": true, <- if true will produce a file "debug.log"
"cleanprocessfolders": false, <- if true then working folders are removed after processing
- tile image quality percentage, tileimagequality has a huge effect on png processing time, not quite as much with webp*
"tileimagequality" : 50, <- percentage (1-100) greatly affects processing speed and database size
"zoomrange" : "1-12", <- range of overviews to produce, higher takes longer and can make db huge
"dbfolder: "", <- optional folder, if a valid path is used the app will put db files here, otherwise will use default
- chartprocessindexes control which chart types to process. Each faachartname is an array with 3 values: FAA chart name, chart type, and an alias (not used for vfr charts.) The chartprocessindexes array values correspond to the ordinal position (zero-based) in the fullchartlist. Array entries can be reordered or omitted for specific chart(s) processing. Alternatively, any of the full charts can be processed by responding to the prompt with the appropriate value.
Examples: [0,6] or [6,5,3]
WARNING: Editing of any of the fullchartlist values will break the application!*
"chartprocessindexes": [0,1,2,3,4,5,6,7], <- charts represented by indexes 0-5 will be processed, in this order
"fullchartlist": [
["Sectional", "vfr", ""], <- as in [FAA chart name, type, alias] (no alias used for vfr charts)
["Caribbean", "vfr", ""],
["Grand_Canyon", "vfr", ""],
["Terminal", "vfr", ""],
["Helicopter", "vfr", ""],
["DDECUS", "ifr", "Enroute_Low"], <- aliases for DDECUS are required (Digital Data Enroute Continental US)
["DDECUS", "ifr", "Enroute_High"],
["US_VFR_Wall_Planning", "vfr", ""]
],
- individualchartlist allows processing of all 52 area charts, either individually or all:
"individualchartlist": [
[0, "Albuquerque"],
[1, "Anchorage"],
[2, "Atlanta"],
[3, "Bethel"],
[4, "Billings"],
[5, "Brownsville"],
[6, "Cape_Lisburne"],
[7, "Charlotte"],
[8, "Cheyenne"],
[9, "Chicago"],
[10, "Cincinnati"],
[11, "Cold_Bay"],
[12, "Dallas-Ft_Worth"],
[13, "Dawson"],
[14, "Denver"],
[15, "Detroit"],
[16, "Dutch_Harbor"],
[17, "El_Paso"],
[18, "Fairbanks"],
[19, "Great_Falls"],
[20, "Green_Bay"],
[21, "Halifax"],
[22, "Hawaiian_Islands"],
[23, "Houston"],
[24, "Jacksonville"],
[25, "Juneau"],
[26, "Kansas_City"],
[27, "Ketchikan"],
[28, "Klamath_Falls"],
[29, "Kodiak"],
[30, "Lake_Huron"],
[31, "Las_Vegas"],
[32, "Los_Angeles"],
[33, "McGrath"],
[34, "Memphis"],
[35, "Miami"],
[36, "Montreal"],
[37, "New_Orleans"],
[38, "New_York"],
[39, "Nome"],
[40, "Omaha"],
[41, "Phoenix"],
[42, "Point_Barrow"],
[43, "Salt_Lake_City"],
[44, "San_Antonio"],
[45, "San_Francisco"],
[46, "Seattle"],
[47, "Seward"],
[48, "St_Louis"],
[49, "Twin_Cities"],
[50, "Washington"],
[51, "Western_Aleutian_Islands"],
[52, "Wichita"]
],
- layertypeindex controls the layertype and therefore how it will be rendered on a map, for example If you will be overlaying an OSM map with your chartmaker map*
"layertypeindex": 1,
"layertypes": [
"baselayer",
"overlay"
],
- tiledriverindex determines the tiledriver type, for example webp produces the smallest image size but png produces the sharpest images*
"tiledriverindex": 0,
"tiledrivers": [
"png",
"jpg",
"webp"
]
The chart zip files are downloaded from the FAA digital raster chart repository and unzipped. After the unzipping process all of the the resultant GEOtiff image names (and their matching tfw world file names) are "normalized" to all lower-case filenames with underscores in place of dashes and spaces and any apostrophes removed. This simplifies the down-stream processing of these files since GDAL can interpret spaces as argument separators.
Install list: sqlite3, python3, Nodejs + npm, Perl, cpanminus, pngquant, imagemagick, curl, unzip, build-essential, libgdal-dev, and GDAL v3.6.2 (minimum)
Note: Most linux machines have Perl installed by default
Step 1. Apt Install
sudo \
apt install -y \
sqlite3 \
pngquant \
imagemagick \
curl \
unzip \
build-essential \
libssl-dev \
libgdal-dev \
cpanminus \
gdal-bin
Step 2. - Install node and npm NOTE: USE OF NVM HIGHLY RECOMMENDED as it will install both node and npm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
After this is done, we must re-source .bashrc to get nvm into the path environment variable, then install node:
copy and paste it back into the prompt and hit enter, then:
source /root/.bashrc
nvm install --lts
nvm use --lts
Step 3. - Clone the repository (shown as cloned from the /home/user folder
cd /home/userid
git clone https://github.com/n129bz/chartmaker.git
Step 4. Set execute permissions on perlsetup.sh - In a terminal, navigate to your cloned instance of chartmaker
cd /home/userid/chartmaker
chmod +x perlsetup.sh
Step 5. - Run the script
./perlsetup.sh
*Note: This will install the following Perl utilities:
strict
warnings
autodie
Carp
Modern::Perl
Params::Validate
File::Slurp
File::Copy
Step 1. - Pull debian 12 docker image
docker run -it debian:stable-slim
Step 2. - Install all required programs
apt install -y \
sqlite3 \
pngquant \
imagemagick \
curl \
unzip \
build-essential \
libgdal-dev \
libssl-dev \
cpanminus \
gdal-bin \
git
Step 3. - install node and npm NOTE: USE OF NVM HIGHLY RECOMMENDED as it will install both node and npm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
After this is done, open /root/.bashrc for editing:
nano /root/.bashrc
Add this line at the end of the .bashrc file: export GTIFF_SRS_SOURCE=GEOKEYS, save and close the file, and then:
source /root/.bashrc
nvm install --lts
nvm use --lts
Step 4. - clone the repository into the base folder**
cd /
git clone https://github.com/n129bz/chartmaker.git
cd chartmaker
Step 5. (Optional) - install and use your favorite text editor (nano shown) and edit the settings.json file to select which chart(s) to process or to set a dbfolder value if you want the application to put db files in a mounted docker volume (see Step 11 below)
apt install nano
nano /chartmaker/settings.json
Step 6. MOST IMPORTANT STEP - commit the docker container to persist it as a new image
NOTE: See https://ktomk.github.io/pipelines/doc/DOCKER-NAME-TAG.html
Enter docker ps -a to list all containers. Make note of the container
being used and copy the container ID (not an image ID) and enter:
docker commit <containerid> <your desired image name>
Step 7. After committing the new container, get the new image id:
docker images
Step 8. Run the application in a new container
docker run -it <new image id>
When the terminal prompt is ready,
cd /chartmaker
npm install
node make
Optional Step 9. You can create a new image using a dockerfile. The following examples show how you could build a new image from n129bz/chartmaker:v1.35 and then run the application, processing all 53 area charts, and having those chart db's placed in a local folder:
#dockerfile
FROM n129bz/chartmaker:v1.41
ENV PATH="$PATH:/root/.nvm/versions/node/v20.16.0/bin"
WORKDIR /chartmaker
CMD ["node", "make", "*"]
Build the new image from the dockerfile:
docker build -t mynewchartmakerimage
Launch the new image non-interactive (no -it switch), using the volume (-v) switch to specify a local folder that will receive all of the db files. This example requires that you edited settings.json key dbfolder with the value localfolder. Docker will mount the local folder into the chartmaker folder on the container:
docker run -v /mylocalfolder/dbfolder:/chartmaker/localfolder mynewchartmakerimage
Optional Step 10. If you want to save this new image as an archive file
NOTE: See https://docs.docker.com/reference/cli/docker/image/save/
NOTE: docker will save the file as a .tar archive
docker save -o <your file name>.tar <new image id>
TO LOAD saved your image archive directly into docker,
docker load --input <your saved image archive name>.tar