diff --git a/tikz/gpx-gps-elevation-chart-generator/Makefile b/tikz/gpx-gps-elevation-chart-generator/Makefile new file mode 100644 index 0000000..4388b60 --- /dev/null +++ b/tikz/gpx-gps-elevation-chart-generator/Makefile @@ -0,0 +1,33 @@ +SOURCE = elevation-chart +DELAY = 80 +DENSITY = 300 +WIDTH = 512 + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot + +gif: + pdfcrop $(SOURCE).pdf + convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif + make clean + +png: + make + make svg + inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png + +transparentGif: + convert $(SOURCE).pdf -transparent white result.gif + make clean + +svg: + #inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg + pdf2svg $(SOURCE).pdf $(SOURCE).svg + # Necessary, as pdf2svg does not always create valid svgs: + inkscape $(SOURCE).svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg + rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg + rm $(SOURCE)1.svg diff --git a/tikz/gpx-gps-elevation-chart-generator/README.md b/tikz/gpx-gps-elevation-chart-generator/README.md new file mode 100644 index 0000000..c2ee07e --- /dev/null +++ b/tikz/gpx-gps-elevation-chart-generator/README.md @@ -0,0 +1,3 @@ +Compiled example +---------------- +![Example](elevation-chart.png) diff --git a/tikz/gpx-gps-elevation-chart-generator/data.csv b/tikz/gpx-gps-elevation-chart-generator/data.csv new file mode 100644 index 0000000..886c556 --- /dev/null +++ b/tikz/gpx-gps-elevation-chart-generator/data.csv @@ -0,0 +1,1100 @@ +dist,ele +0.0000,361.8000 +0.0107,374.2000 +0.0206,373.4000 +0.0316,376.1000 +0.0421,370.2000 +0.0523,371.3000 +0.0626,375.1000 +0.0733,372.4000 +0.0852,377.3000 +0.0955,379.4000 +0.1060,377.4000 +0.1172,384.0000 +0.1280,389.8000 +0.1379,394.7000 +0.1489,402.6000 +0.1595,405.5000 +0.1701,407.9000 +0.1806,406.0000 +0.1916,405.8000 +0.2017,406.0000 +0.2126,408.2000 +0.2245,409.7000 +0.2351,414.7000 +0.2460,419.2000 +0.2564,417.4000 +0.2679,414.4000 +0.2781,417.0000 +0.2885,418.3000 +0.2992,418.1000 +0.3093,419.6000 +0.3199,421.2000 +0.3317,423.0000 +0.3427,424.0000 +0.3528,425.3000 +0.3629,425.6000 +0.3737,428.2000 +0.3838,430.0000 +0.3946,430.5000 +0.4062,425.6000 +0.4166,423.5000 +0.4267,422.9000 +0.4367,421.5000 +0.4480,422.4000 +0.4586,419.8000 +0.4699,425.5000 +0.4804,434.7000 +0.4903,437.1000 +0.5011,436.5000 +0.5110,437.9000 +0.5215,438.7000 +0.5319,443.5000 +0.5430,444.6000 +0.5539,446.2000 +0.5643,446.4000 +0.5744,441.1000 +0.5847,440.5000 +0.5954,438.9000 +0.6060,433.0000 +0.6162,436.1000 +0.6263,438.9000 +0.6368,440.3000 +0.6481,442.0000 +0.6596,445.4000 +0.6710,443.8000 +0.6812,445.1000 +0.6922,445.7000 +0.7022,445.7000 +0.7124,447.9000 +0.7233,454.4000 +0.7334,452.6000 +0.7449,454.6000 +0.7559,453.5000 +0.7662,452.8000 +0.7774,451.4000 +0.7877,453.7000 +0.7983,460.5000 +0.8086,459.8000 +0.8203,459.2000 +0.8313,458.8000 +0.8417,458.0000 +0.8528,460.3000 +0.8634,462.5000 +0.8740,464.5000 +0.8852,465.8000 +0.8958,466.3000 +0.9066,466.2000 +0.9168,467.9000 +0.9292,469.3000 +0.9394,471.8000 +0.9497,477.4000 +0.9603,485.2000 +0.9708,488.5000 +0.9815,487.8000 +0.9916,487.9000 +1.0020,491.3000 +1.0123,490.1000 +1.0221,492.4000 +1.0323,497.0000 +1.0431,498.6000 +1.0533,502.3000 +1.0641,506.5000 +1.0746,504.3000 +1.0851,511.4000 +1.0957,514.9000 +1.1063,521.8000 +1.1165,523.3000 +1.1269,524.6000 +1.1366,523.1000 +1.1467,526.0000 +1.1571,530.3000 +1.1680,531.1000 +1.1779,534.9000 +1.1885,535.2000 +1.1988,537.4000 +1.2088,539.3000 +1.2191,545.7000 +1.2309,543.4000 +1.2420,532.0000 +1.2522,532.9000 +1.2627,540.7000 +1.2727,538.7000 +1.2832,545.7000 +1.2932,548.1000 +1.3044,553.0000 +1.3146,554.3000 +1.3251,552.5000 +1.3356,557.9000 +1.3463,556.8000 +1.3567,552.8000 +1.3673,554.1000 +1.3775,552.9000 +1.3877,554.7000 +1.3979,556.3000 +1.4108,558.1000 +1.4217,563.3000 +1.4317,565.6000 +1.4420,572.0000 +1.4530,573.0000 +1.4630,576.4000 +1.4738,577.3000 +1.4842,580.4000 +1.4941,581.5000 +1.5052,583.9000 +1.5151,587.4000 +1.5254,594.7000 +1.5363,597.0000 +1.5468,589.2000 +1.5571,586.5000 +1.5678,584.0000 +1.5784,586.3000 +1.5887,589.2000 +1.5989,581.3000 +1.6091,579.0000 +1.6198,578.1000 +1.6307,579.5000 +1.6410,581.2000 +1.6515,582.8000 +1.6625,581.4000 +1.6741,579.3000 +1.6844,578.8000 +1.6950,579.7000 +1.7052,578.2000 +1.7165,575.8000 +1.7283,562.7000 +1.7387,565.8000 +1.7490,565.1000 +1.7596,568.5000 +1.7699,568.5000 +1.7806,567.5000 +1.7906,564.1000 +1.8013,560.1000 +1.8121,570.6000 +1.8231,573.3000 +1.8334,569.1000 +1.8450,562.9000 +1.8554,565.5000 +1.8666,563.9000 +1.8766,566.0000 +1.8873,565.2000 +1.8986,570.1000 +1.9097,566.0000 +1.9203,559.7000 +1.9309,559.4000 +1.9420,553.5000 +1.9541,552.0000 +1.9646,549.1000 +1.9753,541.0000 +1.9854,537.6000 +1.9981,537.2000 +2.0086,540.2000 +2.0196,542.8000 +2.0301,540.5000 +2.0409,544.3000 +2.0513,544.2000 +2.0614,546.3000 +2.0722,551.0000 +2.0826,551.6000 +2.0938,551.9000 +2.1050,552.5000 +2.1165,553.2000 +2.1285,553.6000 +2.1399,555.0000 +2.1504,554.6000 +2.1611,554.6000 +2.1714,556.1000 +2.1823,556.1000 +2.1933,555.5000 +2.2050,554.6000 +2.2158,551.3000 +2.2268,551.1000 +2.2377,556.7000 +2.2485,560.2000 +2.2594,560.7000 +2.2704,562.0000 +2.2809,562.5000 +2.2923,564.1000 +2.3024,563.7000 +2.3128,563.1000 +2.3232,564.1000 +2.3337,564.9000 +2.3440,550.6000 +2.3571,538.1000 +2.3687,543.2000 +2.3805,549.1000 +2.3915,550.4000 +2.4015,548.8000 +2.4123,550.4000 +2.4231,548.7000 +2.4337,554.2000 +2.4442,553.4000 +2.4545,542.1000 +2.4646,546.0000 +2.4750,549.1000 +2.4849,548.9000 +2.4953,554.9000 +2.5055,554.7000 +2.5160,547.9000 +2.5268,541.9000 +2.5372,530.0000 +2.5477,532.6000 +2.5586,535.4000 +2.5690,539.6000 +2.5789,543.7000 +2.5905,544.1000 +2.6012,530.4000 +2.6118,529.0000 +2.6220,527.0000 +2.6333,520.5000 +2.6437,519.8000 +2.6541,519.0000 +2.6652,521.6000 +2.6754,522.6000 +2.6869,521.6000 +2.6979,516.2000 +2.7100,514.1000 +2.7213,512.8000 +2.7313,507.3000 +2.7422,506.7000 +2.7523,512.2000 +2.7638,513.3000 +2.7739,516.0000 +2.7841,515.2000 +2.7954,513.9000 +2.8064,506.7000 +2.8165,513.4000 +2.8271,515.9000 +2.8377,510.7000 +2.8488,511.9000 +2.8595,511.1000 +2.8699,503.1000 +2.8806,496.8000 +2.8909,494.1000 +2.9017,494.7000 +2.9119,488.3000 +2.9226,485.3000 +2.9327,486.0000 +2.9435,487.8000 +2.9546,485.8000 +2.9657,481.8000 +2.9766,480.0000 +2.9867,477.1000 +2.9969,475.2000 +3.0074,468.6000 +3.0181,463.9000 +3.0282,458.6000 +3.0383,460.2000 +3.0486,457.4000 +3.0595,462.3000 +3.0709,456.9000 +3.0813,455.4000 +3.0923,453.0000 +3.1023,461.0000 +3.1123,443.0000 +3.1247,453.2000 +3.1353,463.7000 +3.1452,465.8000 +3.1560,468.3000 +3.1676,467.9000 +3.1776,466.3000 +3.1892,456.3000 +3.2002,456.4000 +3.2106,454.5000 +3.2217,458.4000 +3.2327,457.5000 +3.2435,464.3000 +3.2554,462.4000 +3.2661,462.9000 +3.2771,463.2000 +3.2889,466.5000 +3.2992,466.5000 +3.3095,469.2000 +3.3205,465.6000 +3.3305,472.3000 +3.3417,472.7000 +3.3536,475.1000 +3.3638,473.1000 +3.3758,485.3000 +3.3869,489.6000 +3.3980,484.8000 +3.4080,483.0000 +3.4183,488.3000 +3.4290,495.5000 +3.4391,497.4000 +3.4496,493.0000 +3.4602,487.0000 +3.4700,494.6000 +3.4811,490.7000 +3.4922,491.2000 +3.5026,505.5000 +3.5127,496.7000 +3.5227,504.3000 +3.5337,508.5000 +3.5444,500.3000 +3.5544,499.7000 +3.5648,513.8000 +3.5755,512.8000 +3.5857,521.2000 +3.5959,528.0000 +3.6071,521.4000 +3.6177,524.0000 +3.6286,526.0000 +3.6390,529.5000 +3.6494,532.3000 +3.6595,525.9000 +3.6700,517.6000 +3.6801,525.7000 +3.6904,529.1000 +3.7014,530.7000 +3.7115,533.6000 +3.7222,538.2000 +3.7329,540.1000 +3.7441,541.1000 +3.7552,536.4000 +3.7660,542.1000 +3.7771,541.9000 +3.7873,539.1000 +3.7977,544.9000 +3.8077,547.1000 +3.8191,549.4000 +3.8301,548.7000 +3.8413,546.7000 +3.8519,546.6000 +3.8621,550.1000 +3.8725,556.8000 +3.8833,557.9000 +3.8955,559.0000 +3.9064,557.2000 +3.9179,556.8000 +3.9279,555.6000 +3.9380,549.9000 +3.9489,550.2000 +3.9592,556.9000 +3.9692,559.4000 +3.9802,553.3000 +3.9905,550.8000 +4.0018,554.4000 +4.0125,557.3000 +4.0238,562.8000 +4.0348,564.7000 +4.0451,568.8000 +4.0557,572.2000 +4.0670,578.4000 +4.0777,577.6000 +4.0878,584.0000 +4.0989,588.0000 +4.1099,591.3000 +4.1200,591.2000 +4.1309,594.4000 +4.1415,591.1000 +4.1514,591.0000 +4.1620,588.2000 +4.1723,586.6000 +4.1835,584.6000 +4.1945,584.9000 +4.2060,579.0000 +4.2174,578.9000 +4.2274,578.0000 +4.2386,578.8000 +4.2500,581.5000 +4.2602,581.0000 +4.2714,588.8000 +4.2821,592.4000 +4.2925,596.6000 +4.3030,598.4000 +4.3132,599.8000 +4.3238,602.9000 +4.3345,601.7000 +4.3447,601.5000 +4.3548,602.9000 +4.3662,602.2000 +4.3766,602.7000 +4.3879,603.3000 +4.3982,604.5000 +4.4091,606.1000 +4.4203,609.4000 +4.4311,610.5000 +4.4415,613.9000 +4.4518,615.8000 +4.4624,616.7000 +4.4730,613.2000 +4.4834,620.8000 +4.4934,617.4000 +4.5038,618.3000 +4.5145,620.3000 +4.5252,622.8000 +4.5359,623.6000 +4.5465,624.7000 +4.5584,627.0000 +4.5692,628.7000 +4.5801,622.7000 +4.5901,635.7000 +4.6007,640.4000 +4.6105,638.8000 +4.6208,636.6000 +4.6314,638.2000 +4.6416,641.5000 +4.6516,626.0000 +4.6616,633.9000 +4.6718,661.5000 +4.6819,685.9000 +4.6927,699.4000 +4.7032,703.4000 +4.7135,700.8000 +4.7245,699.5000 +4.7350,703.5000 +4.7463,712.2000 +4.7569,710.2000 +4.7677,708.1000 +4.7786,704.1000 +4.7891,704.5000 +4.8006,696.0000 +4.8118,697.3000 +4.8226,694.4000 +4.8326,692.9000 +4.8430,696.0000 +4.8538,701.0000 +4.8639,700.9000 +4.8750,692.4000 +4.8854,667.1000 +4.8960,683.7000 +4.9064,682.3000 +4.9167,680.4000 +4.9268,657.8000 +4.9371,686.5000 +4.9472,691.5000 +4.9578,699.4000 +4.9682,703.4000 +4.9785,704.7000 +4.9893,701.0000 +4.9993,705.9000 +5.0094,707.1000 +5.0198,706.9000 +5.0299,707.2000 +5.0411,705.8000 +5.0516,701.7000 +5.0621,696.0000 +5.0725,691.3000 +5.0827,689.5000 +5.0930,687.3000 +5.1032,696.2000 +5.1140,708.0000 +5.1242,708.7000 +5.1345,711.6000 +5.1451,714.7000 +5.1553,721.0000 +5.1657,720.7000 +5.1763,722.8000 +5.1890,719.2000 +5.1999,725.1000 +5.2115,725.0000 +5.2228,723.8000 +5.2335,718.9000 +5.2440,720.3000 +5.2561,719.0000 +5.2667,713.2000 +5.2775,711.4000 +5.2877,714.9000 +5.2980,712.3000 +5.3079,717.7000 +5.3185,713.7000 +5.3287,706.7000 +5.3399,708.7000 +5.3502,715.3000 +5.3603,717.5000 +5.3705,720.1000 +5.3807,720.8000 +5.3913,723.1000 +5.4025,723.0000 +5.4128,728.2000 +5.4249,731.4000 +5.4350,732.0000 +5.4455,735.0000 +5.4556,737.5000 +5.4656,737.7000 +5.4762,740.4000 +5.4870,737.2000 +5.4972,737.8000 +5.5075,738.2000 +5.5178,738.3000 +5.5282,741.0000 +5.5389,745.3000 +5.5491,752.5000 +5.5607,748.1000 +5.5709,751.1000 +5.5808,757.2000 +5.5908,760.6000 +5.6009,759.7000 +5.6112,755.5000 +5.6213,750.5000 +5.6313,756.7000 +5.6416,757.2000 +5.6518,761.2000 +5.6618,755.9000 +5.6730,764.3000 +5.6843,770.6000 +5.6943,771.5000 +5.7045,771.2000 +5.7150,770.5000 +5.7250,772.9000 +5.7355,769.5000 +5.7455,764.1000 +5.7565,766.1000 +5.7670,764.5000 +5.7773,763.5000 +5.7883,764.8000 +5.7984,767.7000 +5.8091,770.1000 +5.8193,771.6000 +5.8296,773.8000 +5.8398,773.3000 +5.8499,776.5000 +5.8600,775.3000 +5.8704,778.0000 +5.8804,779.4000 +5.8908,777.3000 +5.9008,783.7000 +5.9115,787.7000 +5.9218,788.9000 +5.9320,790.1000 +5.9421,789.6000 +5.9521,792.4000 +5.9628,794.7000 +5.9731,795.0000 +5.9831,792.1000 +5.9939,791.2000 +6.0045,792.5000 +6.0145,790.9000 +6.0247,791.7000 +6.0347,792.8000 +6.0452,792.9000 +6.0554,792.5000 +6.0658,799.4000 +6.0758,802.5000 +6.0861,799.5000 +6.0965,799.3000 +6.1068,803.6000 +6.1171,805.2000 +6.1272,807.4000 +6.1376,807.3000 +6.1481,811.1000 +6.1587,810.0000 +6.1692,810.2000 +6.1811,812.6000 +6.1928,816.5000 +6.2027,819.7000 +6.2131,820.7000 +6.2232,818.6000 +6.2332,822.1000 +6.2436,833.3000 +6.2544,830.5000 +6.2650,837.5000 +6.2754,839.7000 +6.2869,840.5000 +6.2975,843.4000 +6.3101,843.3000 +6.3219,851.3000 +6.3326,855.0000 +6.3426,853.6000 +6.3533,855.5000 +6.3633,868.4000 +6.3735,857.7000 +6.3858,873.0000 +6.3969,878.5000 +6.4076,883.6000 +6.4185,883.2000 +6.4288,886.7000 +6.4397,887.6000 +6.4501,888.6000 +6.4608,893.6000 +6.4713,889.9000 +6.4816,896.3000 +6.4916,892.0000 +6.5021,898.3000 +6.5120,897.3000 +6.5231,899.5000 +6.5339,899.1000 +6.5442,901.7000 +6.5550,906.9000 +6.5660,907.1000 +6.5759,907.0000 +6.5865,907.2000 +6.5986,909.3000 +6.6100,904.9000 +6.6199,905.3000 +6.6304,906.6000 +6.6409,912.9000 +6.6516,907.7000 +6.6623,904.0000 +6.6727,904.0000 +6.6841,905.7000 +6.6942,908.4000 +6.7046,903.3000 +6.7147,913.3000 +6.7254,912.3000 +6.7361,914.6000 +6.7472,907.7000 +6.7576,906.9000 +6.7681,907.5000 +6.7785,907.1000 +6.7887,913.6000 +6.7993,916.9000 +6.8094,916.4000 +6.8203,878.6000 +6.8301,909.8000 +6.8426,902.7000 +6.8528,896.9000 +6.8642,894.1000 +6.8749,892.6000 +6.8853,890.9000 +6.8953,880.9000 +6.9055,880.5000 +6.9164,876.5000 +6.9276,832.3000 +6.9377,866.9000 +6.9485,876.6000 +6.9592,874.9000 +6.9700,874.2000 +6.9808,871.1000 +6.9919,870.6000 +7.0039,845.1000 +7.0145,874.0000 +7.0256,876.7000 +7.0365,879.3000 +7.0476,878.7000 +7.0578,877.0000 +7.0688,876.4000 +7.0797,874.2000 +7.0902,873.1000 +7.1008,849.1000 +7.1124,821.7000 +7.1230,821.9000 +7.1338,855.2000 +7.1439,878.9000 +7.1541,869.4000 +7.1649,879.8000 +7.1757,876.3000 +7.1862,879.3000 +7.1974,816.4000 +7.2074,816.6000 +7.2188,815.1000 +7.2313,803.3000 +7.2424,826.9000 +7.2534,849.5000 +7.2641,850.5000 +7.2748,850.1000 +7.2858,858.0000 +7.2961,856.6000 +7.3063,855.4000 +7.3171,858.2000 +7.3279,854.5000 +7.3390,855.4000 +7.3496,855.9000 +7.3596,855.7000 +7.3698,858.6000 +7.3805,859.0000 +7.3909,858.5000 +7.4012,859.4000 +7.4121,857.5000 +7.4221,825.0000 +7.4324,855.5000 +7.4428,859.7000 +7.4534,858.1000 +7.4635,860.9000 +7.4743,861.5000 +7.4845,856.9000 +7.4945,852.6000 +7.5046,854.3000 +7.5155,852.7000 +7.5258,848.2000 +7.5360,846.8000 +7.5464,846.7000 +7.5567,845.5000 +7.5679,840.5000 +7.5780,836.3000 +7.5887,839.6000 +7.5991,831.7000 +7.6097,836.1000 +7.6203,835.1000 +7.6308,826.5000 +7.6437,809.9000 +7.6538,827.0000 +7.6643,827.7000 +7.6749,825.9000 +7.6855,823.0000 +7.6959,819.8000 +7.7068,818.2000 +7.7170,809.7000 +7.7275,811.0000 +7.7384,806.8000 +7.7490,814.7000 +7.7599,804.1000 +7.7707,799.7000 +7.7813,797.6000 +7.7922,798.7000 +7.8024,797.9000 +7.8129,797.0000 +7.8235,797.0000 +7.8336,796.5000 +7.8447,796.8000 +7.8550,792.3000 +7.8652,789.2000 +7.8763,782.9000 +7.8912,783.3000 +7.9013,782.1000 +7.9143,775.5000 +7.9250,775.2000 +7.9351,773.0000 +7.9454,766.4000 +7.9557,765.4000 +7.9656,767.2000 +7.9771,768.4000 +7.9870,765.3000 +7.9971,763.4000 +8.0072,762.6000 +8.0176,759.0000 +8.0301,756.3000 +8.0402,755.6000 +8.0505,752.5000 +8.0610,751.3000 +8.0710,752.7000 +8.0812,746.2000 +8.0912,744.9000 +8.1021,736.2000 +8.1127,729.6000 +8.1232,726.4000 +8.1346,722.8000 +8.1454,722.1000 +8.1557,724.4000 +8.1665,721.4000 +8.1767,722.6000 +8.1878,727.6000 +8.1986,731.9000 +8.2091,727.7000 +8.2199,725.7000 +8.2302,723.7000 +8.2404,722.4000 +8.2513,716.1000 +8.2625,716.7000 +8.2726,713.5000 +8.2842,711.0000 +8.2951,709.6000 +8.3052,705.5000 +8.3162,701.4000 +8.3266,697.5000 +8.3372,696.2000 +8.3482,695.9000 +8.3590,697.3000 +8.3699,695.9000 +8.3802,691.4000 +8.3909,686.4000 +8.4012,680.9000 +8.4118,680.8000 +8.4222,679.8000 +8.4339,679.5000 +8.4440,676.9000 +8.4549,670.1000 +8.4653,671.4000 +8.4763,673.4000 +8.4880,667.8000 +8.4990,665.9000 +8.5094,664.7000 +8.5198,660.9000 +8.5309,650.1000 +8.5420,645.5000 +8.5519,645.8000 +8.5628,645.2000 +8.5733,638.8000 +8.5836,636.8000 +8.5938,636.6000 +8.6037,636.1000 +8.6140,635.3000 +8.6250,631.5000 +8.6359,626.7000 +8.6460,636.8000 +8.6569,636.7000 +8.6683,630.5000 +8.6797,627.2000 +8.6901,625.8000 +8.7006,624.2000 +8.7108,627.1000 +8.7210,629.6000 +8.7320,635.1000 +8.7420,632.7000 +8.7529,632.9000 +8.7641,629.0000 +8.7746,628.9000 +8.7852,621.3000 +8.7971,616.8000 +8.8072,609.2000 +8.8187,607.0000 +8.8292,603.5000 +8.8398,603.8000 +8.8503,602.9000 +8.8608,603.0000 +8.8714,599.0000 +8.8825,597.0000 +8.8930,597.1000 +8.9035,594.7000 +8.9143,593.2000 +8.9250,585.5000 +8.9350,583.9000 +8.9464,569.8000 +8.9570,557.8000 +8.9675,558.7000 +8.9777,553.9000 +8.9884,553.3000 +8.9986,550.4000 +9.0090,550.1000 +9.0206,551.0000 +9.0324,552.2000 +9.0437,552.8000 +9.0540,554.2000 +9.0646,551.9000 +9.0746,553.1000 +9.0858,552.3000 +9.0960,548.9000 +9.1058,550.9000 +9.1173,546.7000 +9.1277,549.2000 +9.1382,545.6000 +9.1483,544.3000 +9.1593,543.2000 +9.1694,543.3000 +9.1798,543.9000 +9.1901,540.5000 +9.2004,541.4000 +9.2117,542.7000 +9.2271,539.6000 +9.2371,545.5000 +9.2489,548.8000 +9.2622,546.4000 +9.2723,540.0000 +9.2830,538.1000 +9.2937,537.7000 +9.3043,536.5000 +9.3145,538.9000 +9.3258,535.9000 +9.3361,535.1000 +9.3469,530.7000 +9.3570,527.3000 +9.3673,521.9000 +9.3793,522.6000 +9.3899,520.2000 +9.4003,522.1000 +9.4117,521.4000 +9.4223,522.1000 +9.4327,522.3000 +9.4438,526.0000 +9.4545,527.2000 +9.4649,520.9000 +9.4751,520.0000 +9.4928,523.9000 +9.5029,525.4000 +9.5145,522.1000 +9.5248,520.2000 +9.5352,521.8000 +9.5453,523.0000 +9.5563,520.4000 +9.5666,524.6000 +9.5773,530.0000 +9.5888,523.0000 +9.5993,522.0000 +9.6098,516.4000 +9.6205,510.1000 +9.6317,505.0000 +9.6423,501.3000 +9.6529,502.7000 +9.6644,498.6000 +9.6746,499.6000 +9.6863,495.8000 +9.6974,491.6000 +9.7090,492.3000 +9.7197,492.7000 +9.7310,491.2000 +9.7425,484.9000 +9.7533,484.7000 +9.7644,484.2000 +9.7747,480.1000 +9.7851,481.7000 +9.7966,478.2000 +9.8068,478.7000 +9.8182,480.6000 +9.8297,482.1000 +9.8400,482.1000 +9.8511,479.3000 +9.8618,480.4000 +9.8736,481.2000 +9.8836,481.0000 +9.8938,481.3000 +9.9047,480.0000 +9.9162,479.0000 +9.9273,476.3000 +9.9379,474.8000 +9.9479,476.4000 +9.9587,476.0000 +9.9690,477.0000 +9.9796,478.1000 +9.9898,478.0000 +10.0005,479.8000 +10.0112,478.8000 +10.0219,477.8000 +10.0334,476.4000 +10.0441,481.8000 +10.0548,482.5000 +10.0654,483.5000 +10.0763,484.4000 +10.0870,483.4000 +10.0976,484.5000 +10.1085,484.8000 +10.1189,482.9000 +10.1290,484.7000 +10.1394,482.8000 +10.1497,480.9000 +10.1600,475.1000 +10.1713,473.5000 +10.1817,472.5000 +10.1916,468.5000 +10.2018,469.3000 +10.2128,472.5000 +10.2244,473.5000 +10.2354,471.5000 +10.2456,472.0000 +10.2566,465.4000 +10.2688,451.8000 +10.2788,445.3000 +10.2890,442.7000 +10.2996,438.6000 +10.3104,435.2000 +10.3207,432.4000 +10.3311,431.2000 +10.3414,432.0000 +10.3521,428.8000 +10.3630,433.9000 +10.3732,433.6000 +10.3843,435.1000 +10.3951,436.7000 +10.4053,436.6000 +10.4156,432.3000 +10.4265,432.7000 +10.4368,431.3000 +10.4478,431.2000 +10.4586,428.4000 +10.4698,430.1000 +10.4799,427.9000 +10.4909,428.9000 +10.5014,427.4000 +10.5118,425.4000 +10.5223,423.9000 +10.5333,425.3000 +10.5435,421.7000 +10.5542,421.0000 +10.5645,419.5000 +10.5744,416.7000 +10.5855,416.2000 +10.5956,413.5000 +10.6061,411.2000 +10.6179,409.6000 +10.6288,405.6000 +10.6390,402.7000 +10.6498,400.7000 +10.6605,400.2000 +10.6713,397.9000 +10.6820,397.2000 +10.6929,395.5000 +10.7032,398.2000 +10.7141,397.0000 +10.7260,393.5000 +10.7366,392.3000 +10.7472,388.3000 +10.7584,389.4000 +10.7702,385.1000 +10.7811,382.5000 +10.7919,379.6000 +10.8024,376.9000 +10.8138,377.5000 +10.8242,375.9000 +10.8380,374.8000 +10.8485,374.8000 +10.8592,377.7000 +10.8696,377.8000 +10.8798,375.0000 +10.8904,374.5000 +10.9011,374.4000 +10.9111,376.9000 +10.9220,375.5000 +10.9323,376.6000 +10.9445,373.8000 +10.9563,374.5000 +10.9671,375.7000 +10.9778,372.8000 +10.9897,372.6000 +11.0002,373.5000 +11.0120,376.9000 +11.0231,375.2000 +11.0339,373.2000 +11.0440,371.9000 +11.0542,369.5000 +11.0652,369.6000 +11.0753,372.7000 +11.0861,368.6000 +11.0966,366.6000 +11.1075,367.2000 +11.1204,365.1000 +11.1306,361.8000 +11.1426,361.7000 +11.1533,361.5000 +11.1642,358.7000 +11.1747,357.2000 +11.1854,358.3000 +11.1960,359.4000 +11.2070,360.2000 +11.2184,362.4000 +11.2287,364.8000 +11.2392,364.4000 +11.2496,364.6000 +11.2597,362.1000 +11.2707,363.9000 +11.2836,365.3000 +11.2950,365.3000 +11.3059,366.0000 +11.3163,364.9000 +11.3268,361.2000 +11.3374,363.2000 +11.3482,361.6000 +11.3584,359.8000 +11.3693,359.4000 +11.3798,360.7000 +11.3911,357.3000 +11.4039,355.2000 +11.4143,351.9000 +11.4273,353.6000 +11.4379,352.7000 +11.4481,352.3000 +11.4585,348.8000 +11.4692,346.9000 +11.4803,344.0000 +11.4922,343.9000 +11.5022,342.6000 +11.5128,347.2000 +11.5245,347.4000 +11.5348,350.8000 +11.5492,352.1000 +11.5632,354.1000 +11.5746,356.5000 +11.5858,359.2000 +11.5968,361.6000 +11.6084,361.7000 +11.6184,354.6000 +11.6292,355.2000 +11.6395,354.4000 +11.6509,351.3000 +11.6612,351.2000 +11.6718,350.5000 +11.6818,351.5000 +11.6916,347.6000 +11.7016,355.2000 +11.7123,360.5000 +11.7230,356.6000 +11.7330,351.6000 diff --git a/tikz/gpx-gps-elevation-chart-generator/elevation-chart.png b/tikz/gpx-gps-elevation-chart-generator/elevation-chart.png new file mode 100644 index 0000000..c767fef Binary files /dev/null and b/tikz/gpx-gps-elevation-chart-generator/elevation-chart.png differ diff --git a/tikz/gpx-gps-elevation-chart-generator/elevation-chart.tex b/tikz/gpx-gps-elevation-chart-generator/elevation-chart.tex new file mode 100644 index 0000000..67d2a1d --- /dev/null +++ b/tikz/gpx-gps-elevation-chart-generator/elevation-chart.tex @@ -0,0 +1,23 @@ +\documentclass[varwidth=true, border=2pt]{standalone} + +\usepackage{pgfplots} + +\begin{document} +\begin{tikzpicture} + \begin{axis}[ + ybar, + ylabel={Elevation in m}, + ylabel style={at={(0.02,0.5)}}, + xlabel={Traveled distance in km}, + width=0.8*\textwidth, + height=5cm, + x tick label style={/pgf/number format/.cd,% + scaled x ticks = false, + set decimal separator={,}, + fixed}% + ] + \addplot[mark=none, mark size=0.2, smooth] + table [x=dist, y=ele, col sep=comma] {data.csv}; + \end{axis} +\end{tikzpicture} +\end{document} diff --git a/tikz/gpx-gps-elevation-chart-generator/elevation_chart_gen.py b/tikz/gpx-gps-elevation-chart-generator/elevation_chart_gen.py new file mode 100644 index 0000000..e9f0f85 --- /dev/null +++ b/tikz/gpx-gps-elevation-chart-generator/elevation_chart_gen.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +"""Generate an elevation chart from a GPX file.""" + +import gpxpy +import logging +import sys +from math import sin, cos, sqrt, atan2, radians + +logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', + level=logging.DEBUG, + stream=sys.stdout) + + +def main(gpx_file): + """Orchestrate.""" + gpx_points = parse_gpx_points(gpx_file) + logging.info("Loaded %i points from file '%s'.", len(gpx_points), gpx_file) + chart_points = get_chart_points(gpx_points) + with open("data.csv", "w") as f: + f.write("dist,ele\n") + for p in chart_points: + f.write("%0.4f,%0.4f\n" % (p['dist']/1000.0, p['ele'])) + + +def get_dist(lat1, lon1, lat2, lon2): + """Get the distance in km of two points on earth.""" + R = 6373.0 + + lat1 = radians(52.2296756) + lon1 = radians(21.0122287) + lat2 = radians(52.406374) + lon2 = radians(16.9251681) + + dlon = lon2 - lon1 + dlat = lat2 - lat1 + + a = sin(dlat / 2)**2 + cos(lat1) * cos(lat2) * sin(dlon / 2)**2 + c = 2 * atan2(sqrt(a), sqrt(1 - a)) + + distance = R * c + return distance + + +def parse_gpx_points(gpx_file): + """Get all points as a list from gpx_file.""" + with open(gpx_file) as f: + gpx_data_txt = f.read() + gpx = gpxpy.parse(gpx_data_txt) + points = [] + for track in gpx.tracks: + for segment in track.segments: + for point in segment.points: + points.append({'lat': point.latitude, + 'lon': point.longitude, + 'ele': point.elevation}) + return points + + +def get_chart_points(points): + """Get a list of points (x, y) with x=traveled distance, y=eleveation.""" + chart_points = [{'dist': 0, 'ele': points[0]['ele']}] + dist = 0.0 + get_dist = gpxpy.geo.haversine_distance + for i in range(1, len(points)): + dist += get_dist(points[i - 1]['lat'], points[i - 1]['lon'], + points[i]['lat'], points[i]['lon']) + chart_points.append({'dist': dist, 'ele': points[i]['ele']}) + return chart_points + + +def get_parser(): + """Get parser object for elevation_chart_gen.py.""" + from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter + parser = ArgumentParser(description=__doc__, + formatter_class=ArgumentDefaultsHelpFormatter) + parser.add_argument("-f", "--file", + dest="filename", + help="GPX file", + metavar="FILE", + required=True) + return parser + + +if __name__ == "__main__": + args = get_parser().parse_args() + main(args.filename)