{"id":1868,"date":"2014-07-14T11:15:07","date_gmt":"2014-07-14T09:15:07","guid":{"rendered":"http:\/\/www.dotmana.com\/weblog\/?p=1868"},"modified":"2015-01-05T15:59:12","modified_gmt":"2015-01-05T14:59:12","slug":"xcsoar-generate-custom-maps","status":"publish","type":"post","link":"http:\/\/www.dotmana.com\/weblog\/2014\/07\/xcsoar-generate-custom-maps\/","title":{"rendered":"XCSoar: generate custom maps"},"content":{"rendered":"<h1>Introduction<\/h1>\n<p><a href=\"http:\/\/www.xcsoar.org\/\" target=\"_blank\">XCSoar<\/a> is an Open Source software for tactical glide computer: run it on any PDA\/Smartphone\/eBook and you have a powerfull computer for sailplane, paradlider and hang glider. (see previous post about <a href=\"http:\/\/www.dotmana.com\/weblog\/2014\/05\/kobo-mini-gps-mod\/\">adding a GPS to an eReader<\/a>)<\/p>\n<p>Generated map can be <a href=\"http:\/\/www.dotmana.com\/weblog\/xcsoar-skyways-map\/\">downloaded here<\/a><\/p>\n<p>The geo file format used by XCSoar are:<\/p>\n<ul>\n<li>elevation geotiff raster with altitude encoded (custom format)<\/li>\n<li>waypoints<\/li>\n<li>airspace<\/li>\n<li>any <a href=\"http:\/\/en.wikipedia.org\/wiki\/Shapefile\" target=\"_blank\">shapefile <\/a><\/li>\n<\/ul>\n<p>We will use the latest to add custom geo referenced information on XCSoar (in this case, <a href=\"http:\/\/thermal.kk7.ch\/\" target=\"_blank\">paragliding skyways from thermal.kk7<\/a>)<\/p>\n<h1>Software requirement<\/h1>\n<ul>\n<li><a href=\"http:\/\/www.gdal.org\/\" target=\"_blank\">GDAL &#8211; Geospatial Data Abstraction Library<\/a><\/li>\n<li style=\"text-align: left;\"><a href=\"http:\/\/www.qgis.org\/en\/site\/\" target=\"_blank\">QGIS &#8211; Geographic Information System<\/a><\/li>\n<\/ul>\n<h1>\u00a0Processing files<\/h1>\n<blockquote><p>#remove and create temp folder for file processing<br \/>\nrm -rf tmp\/; mkdir tmp\/<br \/>\n#convert PNG+PGW to GeoTiff and resize for faster processing (resize to any % or none)<br \/>\ngdal_translate .\/skyways_all.png tmp\/skyways_all.tif -outsize 50% 50%<br \/>\n#vectorize contour to shapefile red layer<br \/>\ngdal_contour tmp\/skyways_all.tif tmp\/skyways_all_r.shp -i 50 -b 1<br \/>\n#vectorize contour to shapefile green layer<br \/>\ngdal_contour tmp\/skyways_all.tif tmp\/skyways_all_g.shp -i 80 -b 2<br \/>\n#vectorize contour to shapefile blue layer<br \/>\ngdal_contour tmp\/skyways_all.tif tmp\/skyways_all_b.shp -i 200 -b 3<\/p>\n<p>&nbsp;<\/p><\/blockquote>\n<h1>Visualisation with QGIS<\/h1>\n<p>Import from Layer-&gt;Add Vector Layer and select your 3 files<\/p>\n<p><a href=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-112947.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1875\" title=\"Screenshot from 2014-07-14 11:29:47\" src=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-112947.png\" alt=\"\" width=\"854\" height=\"649\" srcset=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-112947.png 854w, http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-112947-300x227.png 300w, http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-112947-394x300.png 394w\" sizes=\"auto, (max-width: 854px) 100vw, 854px\" \/><\/a>Then if everything is fine, save the 3 as Shapefiles:<\/p>\n<p><a href=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-113042.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1876\" title=\"Screenshot from 2014-07-14 11:30:42\" src=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-113042.png\" alt=\"\" width=\"854\" height=\"649\" srcset=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-113042.png 854w, http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-113042-300x227.png 300w, http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-113042-394x300.png 394w\" sizes=\"auto, (max-width: 854px) 100vw, 854px\" \/><\/a><\/p>\n<p>Place the generated file into the XCM (XCSoar compressed archive map)<\/p>\n<p><a href=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-131821.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-1880\" title=\"Screenshot from 2014-07-14 13:18:21\" src=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-131821.png\" alt=\"\" width=\"800\" height=\"577\" srcset=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-131821.png 800w, http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-131821-300x216.png 300w, http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-131821-415x300.png 415w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a>Dont forget to edit the topology.tpl to add the names of the new files:<\/p>\n<p><a href=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-132046.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1881\" title=\"Screenshot from 2014-07-14 13:20:46\" src=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-132046.png\" alt=\"\" width=\"972\" height=\"365\" srcset=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-132046.png 972w, http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-132046-300x112.png 300w, http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-14-132046-500x187.png 500w\" sizes=\"auto, (max-width: 972px) 100vw, 972px\" \/><\/a>You can edit color (RGB, 0-255)\u00a0 and transparency (0-255)<\/p>\n<p>The order is important: element are displayed from top to bottom (first to last)<\/p>\n<h1>Result<\/h1>\n<p>Original raster file, PNG + PGW format.<\/p>\n<p><a href=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-15-085009.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1886\" title=\"Screenshot from 2014-07-15 08:50:09\" src=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-15-085009.png\" alt=\"\" width=\"672\" height=\"565\" srcset=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-15-085009.png 672w, http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-15-085009-300x252.png 300w, http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Screenshot-from-2014-07-15-085009-356x300.png 356w\" sizes=\"auto, (max-width: 672px) 100vw, 672px\" \/><\/a><\/p>\n<p>Generated shapefile maps in XCSoar (desktop version)<\/p>\n<p><a href=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Sent211440.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1873\" title=\"Sent&gt;211440\" src=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Sent211440.png\" alt=\"\" width=\"642\" height=\"509\" srcset=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Sent211440.png 642w, http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Sent211440-300x237.png 300w, http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Sent211440-378x300.png 378w\" sizes=\"auto, (max-width: 642px) 100vw, 642px\" \/><\/a><\/p>\n<p>Same in XCSoar but eReader version optimised for black and white gray levels.<\/p>\n<p><a href=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Sent211440sd.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1874\" title=\"Sent&gt;211440sd\" src=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Sent211440sd.png\" alt=\"\" width=\"800\" height=\"450\" srcset=\"http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Sent211440sd.png 800w, http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Sent211440sd-300x168.png 300w, http:\/\/www.dotmana.com\/weblog\/wp-content\/uploads\/Sent211440sd-500x281.png 500w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<p>Generated map can be <a href=\"http:\/\/www.dotmana.com\/weblog\/xcsoar-skyways-map\/\">downloaded here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction XCSoar is an Open Source software for tactical glide computer: run it on any PDA\/Smartphone\/eBook and you have a powerfull computer for sailplane, paradlider and hang glider. (see previous post about adding a GPS to an eReader) Generated map &hellip; <a href=\"http:\/\/www.dotmana.com\/weblog\/2014\/07\/xcsoar-generate-custom-maps\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1868","post","type-post","status-publish","format-standard","hentry","category-ubuntu"],"_links":{"self":[{"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/posts\/1868","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/comments?post=1868"}],"version-history":[{"count":10,"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/posts\/1868\/revisions"}],"predecessor-version":[{"id":1983,"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/posts\/1868\/revisions\/1983"}],"wp:attachment":[{"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/media?parent=1868"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/categories?post=1868"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.dotmana.com\/weblog\/wp-json\/wp\/v2\/tags?post=1868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}