Browse Source

Opendata altimetry

Phyks (Lucas Verney) 4 years ago
parent
commit
a0df9dd8da

+ 89
- 0
blog/2015/02/index.html View File

@@ -0,0 +1,89 @@
1
+<!DOCTYPE html>
2
+<html lang="fr">
3
+    <head>
4
+        <meta charset="utf-8">
5
+        <title>Phyks' blog - 2015/02</title>
6
+		<link rel="stylesheet" href="//phyks.me/design.css"/>
7
+        <link type="text/plain" rel="author" href="//phyks.me/humans.txt"/>
8
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
+        <link rel="alternate" type="application/rss+xml" title="RSS" href="//phyks.me/rss.xml" />
10
+    </head>
11
+    <body>
12
+        <div id="wrapper">
13
+            <!-- Sidebar -->
14
+                <aside id="sidebar-wrapper">
15
+                    <header><h1><a href="//phyks.me">~Phyks</a></h1></header>
16
+
17
+                    <h2>Catégories</h2>
18
+                        <nav id="sidebar-tags">
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20
+                        </nav>
21
+
22
+                    <h2>Derniers articles</h2>
23
+                        <ul id="sidebar-articles">
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25
+                        </ul>
26
+
27
+                    <h2>Liens</h2>
28
+                        <ul id="sidebar-links">
29
+                            <li><a href="//phyks.me/contact.html" title="Contact">Me contacter</a></li>
30
+                            <li class="monospace"><a href="//links.phyks.me" title="Mon Shaarli">find ~phyks -type l</a></li>
31
+                            <li><a href="https://github.com/phyks/" rel="me" title="Github">Mon Github</a></li>
32
+                            <li><a href="//phyks.me/divers.html" title="Divers">Divers</a></li>
33
+                        </ul>
34
+                </aside>
35
+
36
+            <!-- Page content -->
37
+                <header id="header">
38
+                    <h1><a href="//phyks.me">~Phyks</a></h1>
39
+                </header>
40
+
41
+                <div id="note_responsive">
42
+                    <p><em>Note</em> : Cliquez sur la bande bleue à gauche pour faire apparaître le menu.</p>
43
+                </div>
44
+
45
+                <div id="articles">
46
+<article>
47
+	<aside>
48
+		<p class="day">13</p>
49
+		<p class="month">Février</p>
50
+	</aside>
51
+	<div class="article">
52
+		<header><h1 class="article_title"><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></h1></header>
53
+		<!-- 
54
+    @author=Phyks
55
+    @date=13022015-1735
56
+    @title=Looking for altitude OpenData
57
+    @tags=GeoData, OpenData
58
+-->
59
+
60
+<p>Recently, for a personal project, I looked for opendata for altitude in France. These are not so easy to find, although there are some really good opendata out there, with a very great accuracy. Indeed, <a href="http://www.openstreetmap.org/#map=5/51.500/-0.100">OpenStreetMaps</a> provides really accurate opendata for maps (street names and so on), but absolutely nothing concerning the altitude.</p>
61
+<p>I finally found two datasets available for France, one published by <a href="https://www.data.gouv.fr/fr/datasets/bd-alti-75m/">IGN</a> and the other one being the <a href="http://wiki.openstreetmap.org/wiki/SRTM">SRTM</a> dataset published by the NASA. The one from IGN provides altitude information for the whole French territory, at a resolution of 75m, which is quite good for numerically modeling the terrain. The one from NASA is more complete and provides altitude information for the whole globe surface between -60° and 60° latitude at a resolution of about 90m, obtained by averaging on 30m samples.</p>
62
+<h2>IGN BD ALTI opendata</h2>
63
+<p>First of all, let's have a look at the BD ALTI from IGN, which is not as widely used as the SRTM one (at least in a hobbyist context) and does not have much documentation around there.</p>
64
+<p>IGN provides an archive containing the data for the whole French territory. In the archive, there are several folders. The interesting one, in our case, is <code>1_DONNEES_LIVRAISON_*</code> which contains all the data files.</p>
65
+<p>Altitude data is available in two formats: GeoTiff (Tiff with geolocation metadata) and ASCII Esri grid. I personally used the ASCII Esri Grid files. For more info about this file format, you can refer to <a href="https://en.wikipedia.org/wiki/Esri_grid#ASCII">the Wikipedia page</a>.</p>
66
+<p>Each file starts with some header informations: number of rows and cols (1000), position of the lower-left corner in X and Y coordinates, size of an elementary cell and value used to indicate missing data. The file then contains a matrix representing the values of each cell, as described in the Wikipedia page.</p>
67
+<p>Position on the map is indicated in X and Y coordinates, and not using the standard latitude and longitude coordinates. This is a different projection system, called <a href="https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert">Lambert93</a>, and used for official maps of France. <a href="https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert">Wikipedia</a> contains the relevant information to translate from the standard WGS84 (satellite latitude and longitude coordinates) to the Lambert93 coordinates, and reciprocally but the best way seems to be to use the <a href="http://trac.osgeo.org/proj/">Proj.4 libray</a> which has a <a href="https://pypi.python.org/pypi/pyproj?">Python binding</a> to handle the conversion.</p>
68
+<p>To find a specific point, you should then iterate over the available data files and check if the position of the point is between <code>xllcorner, yllcorner</code> and <code>xllcorner + ncols * cellsize, yllcorner + nrows * cellsize</code>. Then, you just have to get the value of the matching cell in the matrix description in the file.</p>
69
+<p>An example script is available at <a href="https://github.com/Phyks/IGN_OpenData">https://github.com/Phyks/IGN_OpenData</a>. It takes a rectangle defined by two latitudes and longitudes in input, as well as the data folder to process, and will output the relevant data from the BD ALTI dataset, in XYZ file format, which is equivalent to a CSV file with columns X, Y and altitude (Z), separated by tabulations, and sorted. This is also an example use of the Proj.4 Python binding to handle basic coordinates system transforms.</p>
70
+<h2>SRTM opendata</h2>
71
+<p>The SRTM dataset exists in multiple versions and different samplings. Have a look at <a href="https://github.com/Phyks/IGN_OpenData">this wiki page</a> to have more information about it. I was interested in SRTMGL3 version 3, which is the third iteration of the dataset sampled at 3 arcseconds (which is about 90m). It is available at <a href="this address">http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/</a> (before clicking the main folder in this address, please note that this is very heavy and long to process as it contains all the files for the whole world). <a href="">rv</a> uses it and provides a basic import script to a PostgreSQL database, available <a href="https://gitlab.crans.org/leger/rv/blob/master/height/populate_height_table.cc">here</a>.</p>
72
+<p>All files are named with a convention to describe the tile they represent. For instance, the tile starting at 0° North and 6° East is called <code>N00E006.*</code>.</p>
73
+<p>There is a really nice <a href="https://gis.stackexchange.com/questions/43743/how-to-extract-elevation-from-hgt-file">StackOverflow post</a> to explain how to handle these files and the following will almost be a rewriting of this post.</p>
74
+<p>First of all, take the integer part of the position you want (latitude and longitude), and look for the corresponding file at the previous address. You will download a (zipped) hgt file containing the altitude data. This file is a big-endian binary file that you will have to parse.</p>
75
+<p>First, you have to find the pixels coordinates representing your geographic point. To this purpose, you have to take the floating part of the latitude and longitude of the point you want and convert them to arcseconds (e.g. for 50° 24' 58.888", you will have 24 * 60 + 58.888 = 1498.888). As the sampling is done at 3 arcseconds, the pixel coordinates are given by the closest integer to the latitude (resp. longitude) of your point, expressed in arcseconds, divided by 3. Latitude will give you the row index, whereas longitude will give you the col index.</p>
76
+<p>The first row in the file is the northernmost one, so if we are looking at row 500 from the lower edge, we actually have to look at row 1201 - 500 from the beginning of the files (1200 being 3600&nbsp;/ 3, the total number of rows in the data file).</p>
77
+<p>We then have to iterate on cols to find the correct one, using the same principle.</p>
78
+<p>An example script is available <a href="https://github.com/Phyks/IGN_OpenData/blob/master/srtm_alti.py">here</a> although it was not thoroughly tested. If you fix any problem with it, please report&nbsp;:) </p>
79
+		<footer><p class="date">Le 13/02/2015 à 17:35</p>
80
+		<p class="tags">Tags : <a href="//phyks.me/tags/GeoData.html">GeoData</a>, <a href="//phyks.me/tags/OpenData.html">OpenData</a></p></footer>
81
+	</div>
82
+</article>
83
+            </div>
84
+            <footer id="rss">
85
+                <p><a href="//phyks.me/rss.xml"><img src="//phyks.me/img/rss.png" alt="RSS"/></a></p>
86
+            </footer>
87
+        </div>
88
+    </body>
89
+</html>

+ 89
- 0
blog/2015/02/opendata_altimetry.html View File

@@ -0,0 +1,89 @@
1
+<!DOCTYPE html>
2
+<html lang="fr">
3
+    <head>
4
+        <meta charset="utf-8">
5
+        <title>Phyks' blog - Looking for altitude OpenData</title>
6
+		<link rel="stylesheet" href="//phyks.me/design.css"/>
7
+        <link type="text/plain" rel="author" href="//phyks.me/humans.txt"/>
8
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
+        <link rel="alternate" type="application/rss+xml" title="RSS" href="//phyks.me/rss.xml" />
10
+    </head>
11
+    <body>
12
+        <div id="wrapper">
13
+            <!-- Sidebar -->
14
+                <aside id="sidebar-wrapper">
15
+                    <header><h1><a href="//phyks.me">~Phyks</a></h1></header>
16
+
17
+                    <h2>Catégories</h2>
18
+                        <nav id="sidebar-tags">
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20
+                        </nav>
21
+
22
+                    <h2>Derniers articles</h2>
23
+                        <ul id="sidebar-articles">
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25
+                        </ul>
26
+
27
+                    <h2>Liens</h2>
28
+                        <ul id="sidebar-links">
29
+                            <li><a href="//phyks.me/contact.html" title="Contact">Me contacter</a></li>
30
+                            <li class="monospace"><a href="//links.phyks.me" title="Mon Shaarli">find ~phyks -type l</a></li>
31
+                            <li><a href="https://github.com/phyks/" rel="me" title="Github">Mon Github</a></li>
32
+                            <li><a href="//phyks.me/divers.html" title="Divers">Divers</a></li>
33
+                        </ul>
34
+                </aside>
35
+
36
+            <!-- Page content -->
37
+                <header id="header">
38
+                    <h1><a href="//phyks.me">~Phyks</a></h1>
39
+                </header>
40
+
41
+                <div id="note_responsive">
42
+                    <p><em>Note</em> : Cliquez sur la bande bleue à gauche pour faire apparaître le menu.</p>
43
+                </div>
44
+
45
+                <div id="articles">
46
+<article>
47
+	<aside>
48
+		<p class="day">13</p>
49
+		<p class="month">Février</p>
50
+	</aside>
51
+	<div class="article">
52
+		<header><h1 class="article_title"><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></h1></header>
53
+		<!-- 
54
+    @author=Phyks
55
+    @date=13022015-1735
56
+    @title=Looking for altitude OpenData
57
+    @tags=GeoData, OpenData
58
+-->
59
+
60
+<p>Recently, for a personal project, I looked for opendata for altitude in France. These are not so easy to find, although there are some really good opendata out there, with a very great accuracy. Indeed, <a href="http://www.openstreetmap.org/#map=5/51.500/-0.100">OpenStreetMaps</a> provides really accurate opendata for maps (street names and so on), but absolutely nothing concerning the altitude.</p>
61
+<p>I finally found two datasets available for France, one published by <a href="https://www.data.gouv.fr/fr/datasets/bd-alti-75m/">IGN</a> and the other one being the <a href="http://wiki.openstreetmap.org/wiki/SRTM">SRTM</a> dataset published by the NASA. The one from IGN provides altitude information for the whole French territory, at a resolution of 75m, which is quite good for numerically modeling the terrain. The one from NASA is more complete and provides altitude information for the whole globe surface between -60° and 60° latitude at a resolution of about 90m, obtained by averaging on 30m samples.</p>
62
+<h2>IGN BD ALTI opendata</h2>
63
+<p>First of all, let's have a look at the BD ALTI from IGN, which is not as widely used as the SRTM one (at least in a hobbyist context) and does not have much documentation around there.</p>
64
+<p>IGN provides an archive containing the data for the whole French territory. In the archive, there are several folders. The interesting one, in our case, is <code>1_DONNEES_LIVRAISON_*</code> which contains all the data files.</p>
65
+<p>Altitude data is available in two formats: GeoTiff (Tiff with geolocation metadata) and ASCII Esri grid. I personally used the ASCII Esri Grid files. For more info about this file format, you can refer to <a href="https://en.wikipedia.org/wiki/Esri_grid#ASCII">the Wikipedia page</a>.</p>
66
+<p>Each file starts with some header informations: number of rows and cols (1000), position of the lower-left corner in X and Y coordinates, size of an elementary cell and value used to indicate missing data. The file then contains a matrix representing the values of each cell, as described in the Wikipedia page.</p>
67
+<p>Position on the map is indicated in X and Y coordinates, and not using the standard latitude and longitude coordinates. This is a different projection system, called <a href="https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert">Lambert93</a>, and used for official maps of France. <a href="https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert">Wikipedia</a> contains the relevant information to translate from the standard WGS84 (satellite latitude and longitude coordinates) to the Lambert93 coordinates, and reciprocally but the best way seems to be to use the <a href="http://trac.osgeo.org/proj/">Proj.4 libray</a> which has a <a href="https://pypi.python.org/pypi/pyproj?">Python binding</a> to handle the conversion.</p>
68
+<p>To find a specific point, you should then iterate over the available data files and check if the position of the point is between <code>xllcorner, yllcorner</code> and <code>xllcorner + ncols * cellsize, yllcorner + nrows * cellsize</code>. Then, you just have to get the value of the matching cell in the matrix description in the file.</p>
69
+<p>An example script is available at <a href="https://github.com/Phyks/IGN_OpenData">https://github.com/Phyks/IGN_OpenData</a>. It takes a rectangle defined by two latitudes and longitudes in input, as well as the data folder to process, and will output the relevant data from the BD ALTI dataset, in XYZ file format, which is equivalent to a CSV file with columns X, Y and altitude (Z), separated by tabulations, and sorted. This is also an example use of the Proj.4 Python binding to handle basic coordinates system transforms.</p>
70
+<h2>SRTM opendata</h2>
71
+<p>The SRTM dataset exists in multiple versions and different samplings. Have a look at <a href="https://github.com/Phyks/IGN_OpenData">this wiki page</a> to have more information about it. I was interested in SRTMGL3 version 3, which is the third iteration of the dataset sampled at 3 arcseconds (which is about 90m). It is available at <a href="this address">http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/</a> (before clicking the main folder in this address, please note that this is very heavy and long to process as it contains all the files for the whole world). <a href="">rv</a> uses it and provides a basic import script to a PostgreSQL database, available <a href="https://gitlab.crans.org/leger/rv/blob/master/height/populate_height_table.cc">here</a>.</p>
72
+<p>All files are named with a convention to describe the tile they represent. For instance, the tile starting at 0° North and 6° East is called <code>N00E006.*</code>.</p>
73
+<p>There is a really nice <a href="https://gis.stackexchange.com/questions/43743/how-to-extract-elevation-from-hgt-file">StackOverflow post</a> to explain how to handle these files and the following will almost be a rewriting of this post.</p>
74
+<p>First of all, take the integer part of the position you want (latitude and longitude), and look for the corresponding file at the previous address. You will download a (zipped) hgt file containing the altitude data. This file is a big-endian binary file that you will have to parse.</p>
75
+<p>First, you have to find the pixels coordinates representing your geographic point. To this purpose, you have to take the floating part of the latitude and longitude of the point you want and convert them to arcseconds (e.g. for 50° 24' 58.888", you will have 24 * 60 + 58.888 = 1498.888). As the sampling is done at 3 arcseconds, the pixel coordinates are given by the closest integer to the latitude (resp. longitude) of your point, expressed in arcseconds, divided by 3. Latitude will give you the row index, whereas longitude will give you the col index.</p>
76
+<p>The first row in the file is the northernmost one, so if we are looking at row 500 from the lower edge, we actually have to look at row 1201 - 500 from the beginning of the files (1200 being 3600&nbsp;/ 3, the total number of rows in the data file).</p>
77
+<p>We then have to iterate on cols to find the correct one, using the same principle.</p>
78
+<p>An example script is available <a href="https://github.com/Phyks/IGN_OpenData/blob/master/srtm_alti.py">here</a> although it was not thoroughly tested. If you fix any problem with it, please report&nbsp;:) </p>
79
+		<footer><p class="date">Le 13/02/2015 à 17:35</p>
80
+		<p class="tags">Tags : <a href="//phyks.me/tags/GeoData.html">GeoData</a>, <a href="//phyks.me/tags/OpenData.html">OpenData</a></p></footer>
81
+	</div>
82
+</article>
83
+            </div>
84
+            <footer id="rss">
85
+                <p><a href="//phyks.me/rss.xml"><img src="//phyks.me/img/rss.png" alt="RSS"/></a></p>
86
+            </footer>
87
+        </div>
88
+    </body>
89
+</html>

+ 29
- 337
blog/2015/index.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>
@@ -45,347 +45,39 @@
45 45
                 <div id="articles">
46 46
 <article>
47 47
 	<aside>
48
-		<p class="day">12</p>
49
-		<p class="month">Janvier</p>
48
+		<p class="day">13</p>
49
+		<p class="month">Février</p>
50 50
 	</aside>
51 51
 	<div class="article">
52
-		<header><h1 class="article_title"><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></h1></header>
52
+		<header><h1 class="article_title"><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></h1></header>
53 53
 		<!-- 
54 54
     @author=Phyks
55
-    @date=12012015-2153
56
-    @title=Passage à Known
57
-    @tags=Phyks
55
+    @date=13022015-1735
56
+    @title=Looking for altitude OpenData
57
+    @tags=GeoData, OpenData
58 58
 -->
59 59
 
60
-<p>Cela fait quelques semaines que je teste <a href="https://withknown.com/">Known</a> sur <a href="https://known.phyks.me/">mon instance</a>. Je publie systématiquement mes articles aux deux endroits, sur mon blog et sur Known, depuis quelques temps, et je pense migrer définitivement car je suis pleinement satisfait par Known et ne voit pas vraiment l'intérêt de maintenir deux espaces différents avec le même contenu (sans compter que ce blog a certains bugs, comme le décompte des articles dans le panneau de gauche…).</p>
61
-<p>Du coup, quelques changements mineurs sont à prévoir. Il risque d'y avoir pas mal de liens morts, vu que je ne vais pas pouvoir rerouter tous mes articles vers les nouvelles URLs légèrement différentes. Mais tous mes anciens articles seront sur mon instance de Known.</p>
62
-<p>Le flux RSS va aussi changer d'adresse, pensez à mettre à jour les adresses&nbsp;! La nouvelle adresse sera <a href="https://known.phyks.me/?_t=rss">https://known.phyks.me/?_t=rss</a> (ou de façon équivalente <a href="https://phyks.me/?_t=rss">https://phyks.me/?_t=rss</a> quand la migration sera terminée, ce qui n'est pas encore le cas, les deux liens resteront valables dans le futur). Je pense migrer définitivement d'ici la fin de la semaine.</p>
63
-<p>Sino, je réfléchis aussi pour remplacer mon <a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli">Shaarli</a> sur Known (vu qu'il gère les “likes” et les marque-pages), mais c'est en cours et sera sûrement l'objet d'un prochain article. </p>
64
-		<footer><p class="date">Le 12/01/2015 à 21:53</p>
65
-		<p class="tags">Tags : <a href="//phyks.me/tags/Phyks.html">Phyks</a></p></footer>
66
-	</div>
67
-</article>
68
-<article>
69
-	<aside>
70
-		<p class="day">11</p>
71
-		<p class="month">Janvier</p>
72
-	</aside>
73
-	<div class="article">
74
-		<header><h1 class="article_title"><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></h1></header>
75
-		<!-- 
76
-    @author=Phyks
77
-    @date=11012015-2330
78
-    @title=Self-hosting Firefox sync 1.5
79
-    @tags=Phyks
80
--->
81
-
82
-<p>I used to self-host Firefox Sync but since the new Firefox Accounts + Firefox Sync (appeared in Firefox 29), it has became more difficult to self-host it, and I didn't take time to handle it. However, lately, the doc has greatly improved and it's rather straightforward. Although, most of the doc available (for Firefox Accounts mostly) is mainly oriented toward dev and testing rather than setting a production ready instance. So, I will try to describe as best as I can the different steps I took to get a working setup.</p>
83
-<p>Please refer at any time to the <code>README</code> file in the cloned repo, which contains very useful information that may be missing in this article. Please report me also any such information, so that I can keep an up-to-date comprehensive guide on this installation.</p>
84
-<p>As said before, there are now two components that are needed for the sync server. The first one is the sync server itself, written in Python, as it already used to be in the past. The new one is the Firefox Account instance, written in Node, which is used as a common authentication mechanism for all the Mozilla services like Sync, Firefox Marketplace, Firefox's find-my-device, etc.</p>
85
-<p>It is <strong>optional</strong> to self-host the Firefox accounts part, and you can rely on the Mozilla servers if you want. They will only do the authentication part, and their server will never handle your plaintext password, so that they cannot in any case decrypt your data, as explained <a href="https://blog.mozilla.org/services/2014/05/08/firefox-accounts-sync-1-5-and-self-hosting/">here</a>. This is a good compromise if you want a quick and easy running solution.</p>
86
-<p>At the beginning, I was planning on selfhosting everything for myself. But the Firefox Accounts part is really tricky to set, and you should know that no official Mozilla server will be able to handle authentification against a non-Mozilla Firefox Accounts server. This means that if you use your own Firefox Accounts server, it can be used for Sync (and for FindMyDevice if you have a FirefoxOS phone and tweak a bit), but not for the Marketplace or so. So I decided it was not worth the energy and time passed to update it and keep track of security updates and selfhost only the Firefox Sync part.</p>
87
-<h2>Firefox sync server</h2>
88
-<p>Actually, the doc is really good for this part and you should just read <a href="https://docs.services.mozilla.com/howtos/run-sync-1.5.html">the official instructions</a>. A french doc is available <a href="https://dattaz.fr/blog/?id=13">on dattaz's blog</a>.</p>
89
-<p>For further configuration, the <code>syncserver.ini</code> file is well commented and the comments should be self-explanatory.</p>
90
-<h2>Firefox Accounts server</h2>
91
-<p>To self-host this component, you will need node and npm. Firefox Account itself is split in multiple components: an auth server, a database backend and a content server to serve the interface. We will install all the firefox accounts part in <code>/home/fxa</code>. The official doc is available <a href="https://docs.services.mozilla.com/howtos/run-fxa.html#howto-run-fxa">here</a>.</p>
92
-<h3>Firefox Accounts authentication server</h3>
93
-<p>Let us first focus on the authentication server and its database backend. First step is to install the necessary stuff: <code>node</code>, <code>npm</code>, <code>pgrep</code>, <code>libgmp-dev</code> and <code>mysql</code> (or <code>mariadb</code>). The <code>train-NN</code> branches are kind of tagged versions, and you should git checkout the latest, which is 27 as of writing this article.</p>
94
-<pre><code>cd&nbsp;/home/fxa
95
-git clone git clone git://github.com/mozilla/fxa-auth-server.git
96
-git checkout train-27
97
-cd fxa-auth-server
98
-npm install
99
-</code></pre>
100
-
101
-<p>This will clone and install the auth-server. Then, let's clone the database backend as well:</p>
102
-<pre><code>cd&nbsp;/home/fxa
103
-git clone https://github.com/mozilla/fxa-auth-db-server
104
-cd fxa-auth-db-server
105
-npm install
106
-</code></pre>
107
-
108
-<p>In <code>fxa-auth-db-server/</code>, you will have to edit your database credentials. Edit (or create) the file <code>.fxa_dbrc</code> and put the following content inside:</p>
109
-<pre><code>{
110
-    "master": {
111
-        "user": "fxa",
112
-        "password": "mysecret",
113
-        "database": "fxa"
114
-    },
115
-    "slave": {
116
-        "user": "fxa",
117
-        "password": "mysecret",
118
-        "database": "fxa"
119
-    }
120
-}
121
-</code></pre>
122
-
123
-<p>Where <code>fxa</code> is a previously created user in <code>MySQL</code>, with restricted rights and full rights over a database <code>fxa</code>, and <code>mysecret</code> is its password.</p>
124
-<p>Then, we will create a new user to handle firefox account stuff, <code>fxa</code> and give him rights on the previously created repos:</p>
125
-<pre><code>useradd --home&nbsp;/home/fxa fxa
126
-chown -R fxa:fxa&nbsp;/home/fxa
127
-su fxa
128
-</code></pre>
129
-
130
-<p>Let us initialize the database with</p>
131
-<pre><code>
132
-NODE_ENV=prod node bin/db_patcher.js
133
-</code></pre>
134
-
135
-<p>and the server keys with</p>
136
-<pre><code>cd ../fxa-auth-server
137
-NODE_ENV=prod node ./scripts/gen_keys.js
138
-</code></pre>
139
-
140
-<p>Let us customize the configuration:</p>
141
-<pre><code>cd config
142
-cp dev.json prod.json
143
-vim prod.json
144
-</code></pre>
145
-
146
-<p>(there is basically not much to do, except tweaking the smtp settings)</p>
147
-<h3>Firefox Accounts content server</h3>
148
-<p>First, let us clone the repo:</p>
149
-<pre><code>cd&nbsp;/home/fxa
150
-git clone https://github.com/mozilla/fxa-content-server/
151
-chown -R fxa:fxa fxa-content-server
152
-cd fxa-content-server
153
-</code></pre>
154
-
155
-<p>Then, checkout the last version, using git tags. As of writing this article, it is <code>git checkout v0.27.0</code>. The tagged versions of the content server should be in sync with the <code>train-NN</code> branches in the auth-server, and you should clone the same version number for the two of them (at least as of writing this article). Install the dependencies with <code>npm install</code>.</p>
156
-<p>Customize the config. In <code>server/config/production.json</code>, add (change what has to be changed):</p>
157
-<pre><code>"client_sessions": {
158
-    "cookie_name": "session",
159
-    "secret": "YOU MUST CHANGE ME",
160
-    "duration": 86400000
161
-}
162
-</code></pre>
163
-
164
-<p><strong>Note:</strong> The README file says that this should go in <code>.fxa_dbrc</code> file. But it is not yet supported and the doc is not right on this point, cf <a href="https://github.com/mozilla/fxa-auth-db-server/issues/107">this issue</a>. This might however change in the near future. Have a look.</p>
165
-<p>Finally, run <code>grunt server:dist</code> to build production resources (will take some time) and run a local server on port 3030 with production resources.</p>
166
-<h3>Launch all the stuff</h3>
167
-<p>Ideally, this should be run in a <code>screen</code> (or as daemons) with less privileged user (such as the previous <code>fxa</code> user).</p>
168
-<pre><code>screen -S fxa
169
-cd ~fxa/fxa-auth-db-server
170
-NODE_ENV=prod; npm start
171
-(new window)
172
-cd ~fxa/fxa-auth-server
173
-NODE_ENV=prod; node ./test/mail_helper.js
174
-(new window)
175
-export NODE_ENV=prod; node ./bin/key_server.js | node ./bin/notifier.js >/dev/null
176
-(new window)
177
-cd ~fxa/fxa-content-server
178
-grunt server:dist
179
-</code></pre>
180
-
181
-<p>You can head to <code>your_ip:3030</code> to create a Firefox Account. You may want to setup an Apache proxy to serve it, but this is not covered in this guide. For the last settings in Firefox, I let you have a look at <a href="https://docs.services.mozilla.com/howtos/run-fxa.html#howto-run-fxa">the official doc</a>.</p>
182
-<p>Of course, you can run it behind an Apache proxy, or do more advanced configuration. However, as I am not using it and considered useless to spend much time configuring it, I did not look at these parts. </p>
183
-		<footer><p class="date">Le 11/01/2015 à 23:30</p>
184
-		<p class="tags">Tags : <a href="//phyks.me/tags/Phyks.html">Phyks</a></p></footer>
185
-	</div>
186
-</article>
187
-<article>
188
-	<aside>
189
-		<p class="day">08</p>
190
-		<p class="month">Janvier</p>
191
-	</aside>
192
-	<div class="article">
193
-		<header><h1 class="article_title"><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></h1></header>
194
-		<!-- 
195
-    @author=Phyks
196
-    @date=08012015-1740
197
-    @title=Personal review of the Lenovo Thinkpad T440
198
-    @tags=Phyks
199
--->
200
-
201
-<p>I recently changed my laptop and bought a Lenovo T440. I used to have a Clevo W150ERQ (actually a LDLC Saturne, but LDLC is just rebranding Clevo's laptops). It was a really good laptop, but I bought it at a time when I when I was looking for a powerful computer more than a light notebook, and it was way too heavy. Plus as a side effect, it had a poor battery (3 hours autonomy maximum) which I magically managed to maintain, thanks to much tweaks, and despite the battery having lost almost 50% of its original capacity. Finally, it was built around NVIDIA optimus technology, that was lacking serious Linux support.</p>
202
-<h2>Criteria</h2>
203
-<p>So, my goals when looking for a new laptop were that it was small, lightweight (the previous Clevo was 3kgs), powerful enough for my needs (no need for a high end GPU as I'm not doing gaming on my laptop, but still some decent CPU, with built-in AES encryption capabilities), a large autonomy, to be able to travel without worrying about finding a power plug and a large matte screen (no less than 14", and HD resolution). One that was fitting almost all my needs was the Lenovo T440, with some options (intel i5 instead of the i3 in the base model, and HD screen). I had time to play a bit with it, so I write some feedback, in case it can be useful to anyone. This feedback might be updated as time passes. Note that I won't comment anything related to Windows, as there are plenty of infos about this notebook running Windows on the web, and I never used it with Windows.</p>
204
-<h2>Windows refund</h2>
205
-<p>Unfortunately, no Windows refund is available with Lenovo (it came with Windows 8.something preinstalled). They would only refund the entire laptop =(</p>
206
-<h2>Price</h2>
207
-<p>I did not want to spend too much on my laptop. Especially, I did not want to pay it more than 1k€, which is often the price for such laptops. I got mine with HD screen, the biggest external battery and Intel i5 for 800€ (with 200€ discount from Lenovo).</p>
208
-<h2>External aspect</h2>
209
-<p>The laptop is quite thin, and matte, which makes it look very elegant&nbsp;:) The charger is very slim, and the total weight is very reasonable, below 2kgs with extra battery and charger. The screen looks nice and comfortable, although it does not have very wide viewing angles (not to say they are rather narrow…). It's very bright and can be set at any level between 0 and 100%, with standard Linux tools such as <code>xbacklight</code> (good point compared to the previous Clevo which only had a few possible levels). It has an internal battery (25Wh) and an extra external battery can be used for more power.</p>
210
-<p>It has standard ports, 2 USBs, a mini display port, a VGA port, an SD card reader and a true ethernet port. It only has one single port for the micro and the headphones.</p>
211
-<h2>Opening it</h2>
212
-<p>I took one of the cheaper model, and wanted to put an SSD I had from before inside, to avoid having mechanical drive in such a laptop. So, I had to open it, before anything else. Contrary to the other Lenovo laptops, this one is very slim and very compact. Then, there is no easy access to the components (direct access to memory chips or hard drives for instance). You have to take out the whole base cover to change any component inside. That may sound impressive, but is not very difficult to do (but will mean higher costs if you don't want to do it yourself).</p>
213
-<p>First, disable the internal battery in the BIOS. Then, the best way I found to do it is to remove the 8 screws (standard screw driver) below the laptop and unclipse the base cover, starting from the rear (below the external battery). Do not use any tool, but your nail, to prevent any damage to the base cover, and to easily remove it. Note that the screws cannot be fully removed from the base cover, and that you should not have to force at any time. If so, check that the screws are well unscrewed, and if it still need some force applied, try opening the other side, to loop back to this position.</p>
214
-<p>I had never opened such a computer before, and it took me around 30 minutes to swap the hard drives.</p>
215
-<p>For info, if you have a version without 3G modem, you have an M2 slot (42mm if I remember correctly) available to put an extra SSD. This slot may be already taken by the SSD cache in case you chose an HDD + SSD cache.</p>
216
-<h2>Support status under Linux</h2>
217
-<p>I run ArchLinux, so my remarks may not be applicable to other distributions. The laptop has <a href="https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_T440s">a wiki page</a> in the doc. It is for the variant with a touchscreen but most remarks are applicable. Once the necessary packages available, everything works just fine.</p>
218
-<p>I chose not to fight with UEFI, and use the regular BIOS (BIOS emulation) instead. I just had to disable SecureBoot and choose it in the BIOS. The BIOS is really nice designed, with many options (Fn is the leftmost key on the keyboard for instance, but you can swap Fn and Ctrl in the BIOS, which is very practical as I prefer this layout). I installed the Intel drivers for Xorg, the synaptics driver for the ClickPad and the <code>iwlwifi</code> drivers for the wifi card, and everything worked nice out of the box.</p>
219
-<p>I use i3wm, so I did not have any mappings predefined for the function keys. All of them are recognized as Xf86 function tools, and I just needed a config line in my i3 config file to assign them to <code>xbacklight</code> calls to increase and decrease brightness. Same thing for basically all the other function keys, nothing difficult to notice there.</p>
220
-<p>The backlight for the keyboard works also out of the box. It is either fully hardware or well supported under Linux, but I did not have to install anything to use it. There are two levels of illumination available.</p>
221
-<h2>Autonomy</h2>
222
-<p>I did not do any power saving as of now, and the laptop is really impressive on this point! I was fearing that the preinstalled Windows may be overoptimized for the laptop, and that I would have a poor autonomy on Linux, but that's not the case at all.</p>
223
-<p>I have an internal 25Wh battery, and an external 75Wh battery. The laptop was marketed around 15 hours of autonomy, and I must say that it's actually running 15 hours. It is consuming no more than 5W with Wifi connectivity (and browsing the web), my SSD, and backlight set to 10%. That's really impressive and Intel has made a very good job with their latest generation of core i5. I compiled some stuff (Python <code>matplotlib</code>), still with 10% backlight, and jumped up to 15W, no more. For similar performances (at least, similar felt performances), my previous Clevo was consuming around 40W.</p>
224
-<p>Then, out of the box, with the external battery, one can easily work in continuous for between 10 and 15 hours. Tests say that it can run up to 28 hours in idle mode. Totally satisfied on this point&nbsp;!</p>
225
-<h2>Webcam</h2>
226
-<p>Not much to say, it works. It is an integrated webcam so nothing particularly good or bad.</p>
227
-<h2>Bluetooth</h2>
228
-<p>Not tested yet.</p>
229
-<h2>SD card reader</h2>
230
-<p>Not tested yet.</p>
231
-<h2>Audio quality</h2>
232
-<p>Not much to say. Not very bad, not exceptionally good.&nbsp;:)</p>
233
-<h2>Fan and temperature</h2>
234
-<p>The CPU in normal use is at around 40°C. The laptop does not get very hot and is very silent (I've never heard the fan as of today).</p>
235
-<h2><code>Tp_smapi</code></h2>
236
-<p><code>Tp_smapi</code> is a tool to handle some ACPI calls for Thinkpad. It can (apparently) handle the HDAPS feature, to detect shocks and avoid damages to the hard drive. As I have a SSD, I do not use this feature.</p>
237
-<p>A more interesting tool is <a href="https://aur.archlinux.org/packages/tpacpi-bat/">tpacpi-bat</a> available from the AUR, which allows you to set thresholds for charging and discharging the battery. This way, you can set thresholds at 40% and 80% to keep the battery in its best area, according to Lenovo advices.</p>
238
-<p>This works really nice and is well documented <a href="https://aur.archlinux.org/packages/tpacpi-bat/">in the Archwiki</a>.</p>
239
-<h2>Touchpad</h2>
240
-<p>There is a trackpad in the keyboard (but I'm not a huge fan of trackpads). The touchpad is a bit tricky to handle correctly. Indeed, it is composed of a single sensitive area (without any physical buttons) and is a single button (the whole touchpad can be clicked, but as far as I know, it is a single button). Then, you have to map it correctly in Xorg, so that you define "Virtual buttons" and couple the position of your finger on the touchpad to the click event. This can be done quite easily and people have posted many configurations such as <a href="http://rscircus.org/post/72978821261/t440s-clickpad-fix-which-feels-good">this one</a>.</p>
241
-<p>I did not have yet a fully working configuration for my use, and this needs some tweaks, but nothing really problematic, in my opinion. I also use <code>syndaemon</code> as it is very easy to hit the touchpad accidentally while typing.</p>
242
-<h2>Conclusion</h2>
243
-<p>This is a great laptop, in my opinion, with minor points that could be improved. But, it has a really good price&nbsp;/ performance ratio. The autonomy is really impressive, in particular and it works very well out of the box under Linux.</p>
244
-<p>For a full test (more hardware and pure perfs than Linux compatibility and so on), <a href="http://www.notebookcheck.net/Review-Update-Lenovo-ThinkPad-T440s-20AQ0069GE-Notebook.110564.0.html">here is one</a>. </p>
245
-		<footer><p class="date">Le 08/01/2015 à 17:40</p>
246
-		<p class="tags">Tags : <a href="//phyks.me/tags/Phyks.html">Phyks</a></p></footer>
247
-	</div>
248
-</article>
249
-<article>
250
-	<aside>
251
-		<p class="day">07</p>
252
-		<p class="month">Janvier</p>
253
-	</aside>
254
-	<div class="article">
255
-		<header><h1 class="article_title"><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></h1></header>
256
-		<!-- 
257
-    @author=Phyks
258
-    @date=07012015-1620
259
-    @title=Publishing through the Known API
260
-    @tags=Known
261
--->
262
-
263
-<p>As stated in <a href="https://known.phyks.me/2015/thoughts-on-blogging-engine">my last article</a>, I'm considering moving my blog to Known. But I'm not a huge fan of WSIWYG editors. I find it handy sometimes, and can enjoy editing in Markdown on Github, but for a long post, I really prefer writing content on my own text editor and sending it online after. Plus I can maintain drafts this way and benefits from spell checking abilities with my dictionary.</p>
264
-<p>My goal is then to find a way to post to Known from my own PC, using some kind of local app or script.</p>
265
-<p>That's really really easy in fact, as every single URL in Known is also an API endpoint.</p>
266
-<p>But, first, let's talk about a standard way of doing it, that is not Known specific. You can install the <a href="https://github.com/idno/indiepub">IndiePub</a> plugin in Known to enable a <a href="https://indiewebcamp.com/Micropub">MicroPub</a> endpoint in Known.</p>
267
-<p><em>Note</em>: Take care of cloning the repo correctly in <code>IdnoPlugins</code> as the case matters. Indeed, I cloned it as <code>indiepub</code> (lower case) and it took me some time to figure out why it was not working. After having renamed the folder <code>IndiePub</code> everything works fine.</p>
268
-<p>Micropub is a standard way of publishing content to another website, so that, after having received an authorization from you, an app can publish content to your website. Some kind of standard (part of the <a href="https://indiewebcamp.com/">IndieWebCamp</a> stuff) API, like the one used by apps on silos to post things on your page.</p>
269
-<p>Then, you can use anything that speaks the Micropub to publish on your website. The most famous one may be <a href="http://quill.p3k.io/">Quill</a>, a webapp by <a href="http://aaronparecki.com/">aaronparecki</a>. Most of the available tools are written in PHP, but you can also find some libs in <a href="https://indiewebcamp.com/Python">Python</a> to handle this kind of stuff (although there does not seem to be any Micropub publishing libraries at the moment).</p>
270
-<p>But known also offers its own API which may be way easier to use, at least to start with. It can be used in basically the same way, but you don't have to worry as much about authentication and endpoints discovery.</p>
271
-<p>So, every URL endpoint is also an API endpoint. For instance, on your Known homepage, if you click on "status update" to post a new status update, and have a look at the form that appears, you will notice that it posts data to <code>/status/edit</code> (actually, when you click the "status update" button, you will notice there is a link on it to <code>/status/edit</code>, in case you do not have JS enabled). The form is a <code>POST</code> form and you have a <code>body</code> textarea. Let's try to have a look at the page at <code>status/edit</code> (with your browser). As you can see, you have the same form that allows you to publish a new status. But you can also directly send a query to this address, to post a new entry.</p>
272
-<p>For this purpose, you will have to go to your Settings, in the "Tools and apps" menu and get your API key. Then, you must authenticate every query you send to the API. To this purpose, Known uses a HMAC signature, to prevent from sending the API key in plaintext over the network. Your API key is private and should be kept secret on your side. You will have to create a HMAC signature, using sha256, of the URL you query, thanks to your API key. Snippets to do this in many languages are available <a href="http://www.jokecamp.com/blog/examples-of-creating-base64-hashes-using-hmac-sha256-in-different-languages/">here</a>. In these snippets, <code>message</code> is the API endpoint you query (for instance <code>/status/edit</code> in our previous example) and key is your API key.</p>
273
-<p>Then, you have to add specific headers to your query to authenticate. These are <code>X-KNOWN-USERNAME</code> which should be equal to your Known username and <code>X-KNOWN-SIGNATURE</code> which should be set to the previously computed signature. This can be done very easily with <code>curl</code> thanks to the command (updating the values of the headers to the correct one)</p>
274
-<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" http://known.example.org/status/edit</code></p>
275
-<p>For quick tests of the API, you can use the <code>API Tester</code> plugin, which will take care of forging the correct query based on your inputs. Then, you do not have to worry about building a HMAC signature and so on. You can also use it to check that the requests you send have valid signature (by comparing the generated one and yours) and so on.</p>
276
-<p>Then, you have to send a payload beside the headers. This payload will be the actual content that will be posted. You should pass it as a JSON encoded array (but you can also use other formats, see the <code>API Tester</code> plugin or directly the source code), as it is the easiest way. You should send it with <code>POST</code>.</p>
277
-<p>Let's have a look in details at our previous example, status update posting, <em>via</em> <code>/status/edit</code>. As we saw, the basic thing to send is the actual content of the status update, through the <code>body</code> field. Then, to post a "blah" status, the JSON encoded payload would look like</p>
278
-<p><code>{"body": "blah"}</code></p>
279
-<p>And you can post it with the following curl command:</p>
280
-<p><code>curl -H "X-KNOWN-USERNAME: USERNAME" -H "X-KNOWN-SIGNATURE: SIGNATURE" -X POST --data '{"body": "blah"}' http://known.example.org</code></p>
281
-<p>And here we go&nbsp;! Your first status update posted through the API&nbsp;!</p>
282
-<p>Depending on the choosen API endpoint, you might want to pass extra parameters. For example, with "posts" (<code>entry/</code> in the URLs), you have both a title (logically called <code>title</code>) and a body (as previously). Then, the payload for a post with title "blah" and content "blahblah" will look like</p>
283
-<p><code>{"title": "blah", "body": "blahblah"}</code></p>
284
-<p>Most of the endpoints also offer the ability to tweak the <code>created</code> param, to post a content in the paste or in the future (defaults to now). This is what I used to upload the articles from my previous blog to Known, for instance. This parameter is passed to the <a href="http://php.net/manual/fr/function.strtotime.php"><code>strtotime</code></a> PHP function, and should then be in a valid format for this function. Many valid formats are available, including relative ones (see the <a href="http://php.net/manual/fr/function.strtotime.php">doc</a> for more info), but the most straight-forward one, with absolute dating, might be to use ISO 8601, that is <code>YYYY-MM-DD HH:MM:SS</code>.</p>
285
-<p>The common endpoints that I have used so far are <code>/status/edit</code> and <code>/entry/edit</code> to post, respectively, status updates and long posts. A working script example (in Python) can be found <a href="https://git.phyks.me/Phyks/blog/blob/master/known.py">on my blog repository</a> (taking an entry in the format I used to have for my previous blog, and posting it to Known).</p>
286
-<p>Finally, if you want to use extra endpoints, there is no ready to use doc at the moment (see <a href="issue #225">https://github.com/idno/idno/issues/225</a> on Github), but the source code is very easily readable, once you know where to look for the infos&nbsp;:) So, you should know that almost everything in Known is an <code>Entity</code> (which is a common way to describe the content you post). Then, all the specific types of <code>Entities</code> (status, long posts, photos, like etc.) are handled by plugins, located in the <code>IdnoPlugins</code> folder. For instance, status are handled by <code>IdnoPlugins/Status</code> and long posts are handled by <code>IdnoPlugins/Text</code>.</p>
287
-<p>Every plugin declares its routes in the <code>Main.php</code> file. For instance, the <code>Status</code> plugin declares the routes <code>/status/edit</code> (post a new status), <code>/status/edit/([A-Za-z0-9]+)</code> (edit an existing status, the last parameter being the id of the status) and <code>/status/delete/([A-Za-z0-9])</code> (delte a status, same thing as the previous one). Every plugin also declares a content-type which are infos about the type of content it manages, in <code>ContentType.php</code>. Finally, looking in the <code>Pages/</code> folder, you will find scripts to handle the routes. For instance, for <code>/status/edit</code>, you will find in <code>Pages/Edit.php</code> the associated routes, to get and post content. </p>
288
-		<footer><p class="date">Le 07/01/2015 à 16:20</p>
289
-		<p class="tags">Tags : <a href="//phyks.me/tags/Known.html">Known</a></p></footer>
290
-	</div>
291
-</article>
292
-<article>
293
-	<aside>
294
-		<p class="day">05</p>
295
-		<p class="month">Janvier</p>
296
-	</aside>
297
-	<div class="article">
298
-		<header><h1 class="article_title"><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></h1></header>
299
-		<!-- 
300
-    @author=Phyks
301
-    @date=05012015-1735
302
-    @title=Thoughts on blogging engine
303
-    @tags=Phyks
304
--->
305
-
306
-<p>For now, I am using my own custom made Python script to handle my static blog with a Git backend, <a href="https://github.com/Phyks/Blogit">Blogit</a>. It is becoming heavy and difficult to maintain, and I would better do a good refactor. However, many scripts of this kind exists around here, like <a href="http://jekyllrb.com/">Jekyll</a> in Ruby, or <a href="http://blog.getpelican.com/">Pelican</a> in Python. As I do not aim at developping a fully-featured alternative to these scripts, I am considering moving to one of these, and let others with better goals handle it. It is not always useful to reinvent the wheel and especially in this case, as I have very basic needs.</p>
307
-<p>I played a bit with Pelican and Jekyll. First, I played much more with Pelican than with Jekyll. That is because I know Python and feel more comfortable with Pelican. Also, it seems more robust, extensible and well designed than Jekyll. At least, that's the overall impression I have, that Pelican is a bit cold, but very powerful, whereas Jekyll is warmer, but more on the blingbling side also. Pelican supports ReStructuredText besides Markdown and HTML, and it was very straightforward to convert my articles to the Pelican file format (especially for metadata) and keep the same URLs. There is a bunch of plugins and themes for many things (git backend, specific parsers, search engine etc) but some of them are outdated. It's relatively easy to get something working quickly and I think this is a really good static blog engine, very efficient. For more info about it, you can check out <a href="http://a3nm.net/blog/pelican.html">this blog post</a> about a recent migration from <a href="https://gitorious.org/fugitive">fugitive</a>, shell scripts to statically build a blog on top of a git repo, to Pelican.</p>
308
-<p>Then, I was about to migrate to Pelican when I heard about <a href="https://withknown.com/">Known</a> at a <a href="http://www.meetup.com/Paris-Meetup-pour-la-decentralisation-dInternet/events/218943348/">Decentralization Meetup</a> at Mozilla Paris. I had already heard about the <a href="https://indiewebcamp.com/">IndieWebCamp</a> but never had time to look in depth at their wiki and the stuff they were building.</p>
309
-<p>I started to think again about blogging, microblogging and social networking, and I think their approach may fix some of the core problems I experience with Diaspora. For now, I am using my static blog to publish articles, and I am (finally not so much) using <a href="https://github.com/diaspora/diaspora/">Diaspora</a> as a social network.</p>
310
-<ol>
311
-<li>First, Diaspora is yet another thing to monitor. I like to have my RSS reader running in the background, I periodically check the news. I have my emails also. Diaspora means yet another thing to watch for, something not standard (it is not emails, it is not IRC&nbsp;/ XMPP and it is not RSS or equivalent feeds) and the community on Diaspora is quite small compared to the one on the other medium. Equivalently, I do not know enough people on Diaspora to want to have it running and check it regularly. </li>
312
-<li>Diaspora has a big flaw in its implementation, as <a href="http://blog.exppad.com/article/really-social-syndication">other already wrote</a> (article in French). It is oriented toward and promoting decentralization, and encourage each one to run its pod. But running its pod is not very interesting as the federation is not complete in Diaspora. For now, we have "silos", fully centralized, such as Twitter and Facebook&nbsp;; self-hostable "silos" such as <a href="http://elgg.org/">elgg</a> (centrally decentralized networks) and fully decentralized networks like Diaspora. But, as soon as you and your contacts are on different pods, you won't be able to see their own contact lists, to find new people to follow. Similarly, you won't be able to follow hashtags, as they are not federated. I'm alone on my pod, and if I follow <code>#firefoxos</code>, I will only follow <em>my</em> articles tagged with this hashtag. Not very interesting, eh&nbsp;?</li>
313
-</ol>
314
-<p>The core idea behind IndieWebCamp is not to build a social network but to own <em>your</em> data (see <a href="https://aaronparecki.com/articles/2015/01/04/1/owning-my-data-in-2014">this article</a> for example). So, why talking about Diaspora&nbsp;? Because they are thinking that you should be able to communicate with others in both a user-readable and machine-readable way. But, you might already have friends on Twitter&nbsp;/ Facebook&nbsp;/ Instagram etc. Rather than quitting them and moving to a new platform, the goal is to be able to still talk to them, in the meantime before their migration, but to have a dump of every content you post on <em>your</em> server. As it focuses on the protocols rather than the implementation, each user may have its own baked implementation, and many of them are not (yet&nbsp;?) open-sourced (such as <a href="https://aaronparecki.com/">aaronparecki's website</a>). For now, one of the more developped and supported one seems to be Known, which was presented during the Meetup. It lets you handle microblogging, blogging, photo sharing and many more out of the box, and fully implements the protocols to communicate with other instances and is extensible through plugins. To see it in action, you can have a look at <a href="http://werd.io/">the instance of the co-founder</a>.</p>
315
-<p>Then, rather than having multiple sites and services, each one with a partial dump of your content, everything is centralized at one place, and your Known instance gets a dump copy of every content you put online.</p>
316
-<p>The basic idea is to use the served HTML and put some extra content to parse it easily with a machine. This means that both the user and the machine see the same page and can handle the same content. This is done through the use of specific classes on elements to tag them according to their type, to say that this is a post, this is an image and this is a contact card. This way, it becomes really easy to extract content from your website, using XPath for instance. And they are working on implementing favorites, reply-to, reposts and so on.</p>
317
-<p>Thanks to <a href="https://indiewebcamp.com/Bridgy">Bridgy</a> you can have bridges with existing silos, and many apps let you get more bridges, such as <a href="https://ownyourgram.com/">OwnYourGram</a>. Using <a href="https://indiewebcamp.com/Webmention">webmentions</a>, you can post on <em>your</em> website to comment a post on someon's else. See <a href="http://werd.io/2014/being-a-human-on-the-internet-and-discovering-my-non-throttleable#comments">this post</a> for example. Comments are actually hosted on the instance of any user, and a copy is made on this specific instance. Comments can come from Facebook and Twitter also, and virtually any website implementing the open protocol or having a bridge.</p>
318
-<p>I thought again about my static blog. It is dead simple, and enough for my needs. But this is not always very practical as I need to have a computer with a text editor and git to commit and publish, which I do not have always with me. But having a dynamically generated blog is something really heavy and overkill for my need. Known seems to be a good compromise, it is written in PHP (and then easily hackable), it seems to be lightweight, and offers functionalities which are worth the overhead. Plus every route can be used as an URL as well, which means that I can continue to publish writing with my favorite text editor, and I am not at all forced to use the live html editor. This is a great point, and it works very well (article on this is coming). I was not interested in comments on my blog as I do not want to host other's comments on my personal website. But this way of using webmention incite others to have their own blog and publish on this, to reply, and I totally agree with this philosophy. This is no longer "a comment on someone's wall that you don't care about" but "a comment on your website which is sent to the other's". I think this change of commenting strategy might improve the quality of comments (but I may be wrong) by feeling more attached to your content. My demo Known instance is available <a href="http://known.phyks.me/">here</a>. It is currently to be considered as Work In Progress, and I am not sure of what it will become in the future. But there are chances I move to a full Known approach, instead of duplicating my articles on this blog and on Known. Bad news is I might have some URLs that will change in the process (old articles, photos, feeds, etc). To be continued… </p>
319
-		<footer><p class="date">Le 05/01/2015 à 17:35</p>
320
-		<p class="tags">Tags : <a href="//phyks.me/tags/Phyks.html">Phyks</a></p></footer>
321
-	</div>
322
-</article>
323
-<article>
324
-	<aside>
325
-		<p class="day">04</p>
326
-		<p class="month">Janvier</p>
327
-	</aside>
328
-	<div class="article">
329
-		<header><h1 class="article_title"><a href="//phyks.me/2015/01/vcsh.html">Versionner ses fichiers de configuration avec vcsh</a></h1></header>
330
-		<!-- 
331
-    @author=Phyks
332
-    @date=04012015-2310
333
-    @title=Versionner ses fichiers de configuration avec vcsh
334
-    @tags=Phyks
335
--->
336
-
337
-<p>Je viens de découvrir un petit outil fort pratique pour versionner ses fichiers de configuration avec Git&nbsp;: <a href="https://github.com/RichiH/vcsh#30-second-how-to">vcsh</a>. J'ai plusieurs ordinateurs que j'utilise régulièrement, et c'est toujours une véritable horreur de garder une configuration à jour entre les différents postes. Une solution standard est d'utiliser Git, mais il faut s'amuser à faire des liens symboliques dans tous les sens si on veut pas un <code>.git</code> à la racine de son répertoire personnel, etc.</p>
338
-<p><code>vcsh</code> sert justement à éviter ces problèmes, en vous masquant les différents dépôts utilisés. Il est ultra simple d'utilisation et remplit parfaitement son rôle.</p>
339
-<p>Imaginons qu'on veuille versionner notre configuration de ZSH. Sur un des postes, il suffit de lancer <code>vcsh init zsh</code> pour démarrer un dépôt <code>zsh</code>. On ajoute ensuite nos fichiers de configuration avec <code>vcsh zsh add …</code>. Par exemple&nbsp;:</p>
340
-<p><code>vcsh zsh add .zshrc .zprofile .zshenv</code></p>
341
-<p>On peut ensuite commiter nos fichiers de configuration avec <code>vcsh zsh commit</code>. Par exemple&nbsp;:</p>
342
-<p><code>vcsh zsh commit -m "Premier commit de ma config ZSH"</code></p>
343
-<p>Si on veut synchroniser ses fichiers de configuration entre plusieurs ordinateurs, il peut être utile d'ajouter un <em>remote</em> avec <code>vcsh zsh remote add origin &lt;remote&gt;</code> puis de pusher avec <code>vcsh zsh push -u origin master</code>.</p>
344
-<p>En gros, <code>vcsh zsh</code> remplace <code>git</code> habituellement utilisé, pour toutes les opérations de base. Vous pouvez bien sûr faire des branches, merger, pusher, puller, … sans problèmes.</p>
345
-<p>Par exemple, pour récupérer votre configuration sur un autre ordinateur, il vous suffit de <code>vcsh clone &lt;remote&gt;</code> et c'est reparti&nbsp;! =) </p>
346
-		<footer><p class="date">Le 04/01/2015 à 23:10</p>
347
-		<p class="tags">Tags : <a href="//phyks.me/tags/Phyks.html">Phyks</a></p></footer>
348
-	</div>
349
-</article>
350
-<article>
351
-	<aside>
352
-		<p class="day">02</p>
353
-		<p class="month">Janvier</p>
354
-	</aside>
355
-	<div class="article">
356
-		<header><h1 class="article_title"><a href="//phyks.me/2015/01/bmc.html">Gestion d'articles scientifiques avec BMC</a></h1></header>
357
-		<!-- 
358
-    @author=Phyks
359
-    @date=02012015-1805
360
-    @title=Gestion d'articles scientifiques avec BMC
361
-    @tags=Phyks
362
--->
363
-
364
-<p>Lorsqu'on fait de la recherche scientifique (ou de la veille), on est très vite amener à stocker de très nombreux articles en PDFs. On ne s'en sert pas forcément à tous les coups, mais il est essentiel de pouvoir les retrouver et s'y référer simplement. De même, de plus en plus d'ouvrages sont disponibles en formats numériques, et il est également utile de les stocker pour pouvoir les retrouver et les citer facilement. Bref, il faut un moyen simple de&nbsp;:</p>
365
-<ul>
366
-<li>Stocker des fichiers PDF et DJVU.</li>
367
-<li>Les retrouver facilement.</li>
368
-<li>Exporter des citations dans un format correct, pour pouvoir les citer au besoin (BibTeX etc.).</li>
369
-</ul>
370
-<p>Actuellement, je connais deux méthodes&nbsp;:</p>
371
-<ol>
372
-<li>Utiliser un logiciel tout-en-un de gestion bibliographique comme le leader du secteur, <a href="http://www.mendeley.com/">Mendeley</a>, propriétaire, qui permet d'importer ses PDFs sans y réfléchir. Il s'occupe de tout trier, de récupérer les informations dans les bases de données en ligne (auteurs, titre, revue, etc.), ce qui nécessiteraient une recherche dans le PDF voire de l'OCR autrement. On peut annoter ses documents, pour se rappeler qui est quoi, et il peut générer automatiquement les citations qui vont bien, dans le format voulu, quand on écrit un article ou un rapport. C'est top, mais c'est propriétaire et payant pour certaines fonctions avancées. Une grande partie du monde de la recherche l'utilise, mais c'est pas parfait quand même. Et c'est lourd et très (trop) complet, en cherchant à faire un réseau social autour de la recherche. Son concurrent open-source, <a href="http://zotero.org/">Zotero</a> est aussi lourd, si ce n'est plus, peu ergonomique, et pas très performant. Bref, ce n'est pas une solution idéale. </li>
373
-<li>De l'autre côté, de nombreux chercheurs ont juste un dossier <code>~/Papers</code> et mettent tous leurs PDFs en vrac dedans. Certains tiennent un index, avec plus ou moins de succès, ou renomment les fichiers (et il faut alors garder toujours le même masque si on ne veut pas s'y perdre). C'est léger, fonctionnel, mais pas pratique. Trop contraignant à la longue. Et lorsqu'on rédige un document, on ne peut pas avoir facilement les données nécessaires pour citer l'article et on passe alors des heures sur les sites de revues pour trouver lesdites citations.</li>
374
-</ol>
375
-<p>Du coup, j'ai écrit un petit script sans prétention en Python qui s'occupe de toutes les étapes chronophages et insupportables de la deuxième solution&nbsp;: <a href="https://github.com/Phyks/BMC">BMC</a>.</p>
376
-<p>Le principe est très simple&nbsp;: on lui donne un dossier où stocker les articles (typiquement <code>~/Papers</code>) et un masque de renommage pour renommer les fichiers PDFs. Quand on veut ajouter un fichier PDF à sa collection, on lui dit de le faire (<code>bmc import fichier.pdf</code> ou <code>bmc download URL</code>) et il s'occupe de tout&nbsp;:</p>
377
-<ul>
378
-<li>Il va récupérer le fichier PDF ou djvu, si besoin</li>
379
-<li>Il va chercher et extraire le code DOI (pour les articles) ou ISBN (pour les livres) dans le fichier</li>
380
-<li>Grâce à ce code, il va automatiquement récupérer les données bibliographiques associées, qu'il va stocker au format <code>bibtex</code>, pour être facilement réutilisé avec <code>LaTeX</code>.</li>
381
-<li>Finalement, il va stocker le fichier à importer dans le répertoire d'import et ajouter les données bibliographiques à un fichier d'index (<code>index.bib</code>).</li>
382
-</ul>
383
-<p>Comme ça, tout se fait tout seul sans qu'on y pense. Il peut utiliser d'éventuels proxy (y compris SOCKS) pour récupérer les articles (si vous travaillez chez vous mais que votre institution vous fournit un proxy pour télécharger des articles par exemple). Il peut aussi chercher les nouvelles versions disponibles pour les articles ajoutés (typiquement sur <a href="http://arxiv.org/">arxiv</a>, un dépôt d'articles en <a href="http://pablo.rauzy.name/openaccess/introduction.html#libre-acces">open-access</a>). Il peut aussi comparer l'état actuel de votre index et de votre répertoire de stockage, pour identifier d'éventuels problèmes (articles non ajoutés par le script ou articles mal supprimés). On peut aussi ajouter un tag sur chaque fichier, qui se retrouvera alors classé dans un sous-répertoire, pour organiser ses articles par projet.</p>
384
-<p>Lorsque vous voulez citer un article, il vous suffit de demander à BMC l'entrée Bibtex correspondante (<code>bmc export ARTICLE</code>).</p>
385
-<p>Comme il utilise des technos établies (citations Bibtex pour l'index + stockage en fichiers), il n'y a aucun risque de perdre ses données si le script n'est plus maintenu, ou n'est plus compatible. Tout sera toujours accessible, comme ce que vous auriez fait à la main. Et vous pouvez vous passer du script et aller vous-même chercher dans l'index l'entrée qui vous convient.</p>
386
-<p>Enfin, j'espère ajouter prochainement de nouvelles fonctionnalités, selon ce qui est le plus demandé&nbsp;: recherche dans la base de données (qui est d'ores et déjà possible en faisant une recherche dans le fichier d'index, recherche de doublons, recherche de version publiée pour les articles en open-access, …). N'hésitez pas à me faire des retours&nbsp;! </p>
387
-		<footer><p class="date">Le 02/01/2015 à 18:05</p>
388
-		<p class="tags">Tags : <a href="//phyks.me/tags/Phyks.html">Phyks</a></p></footer>
60
+<p>Recently, for a personal project, I looked for opendata for altitude in France. These are not so easy to find, although there are some really good opendata out there, with a very great accuracy. Indeed, <a href="http://www.openstreetmap.org/#map=5/51.500/-0.100">OpenStreetMaps</a> provides really accurate opendata for maps (street names and so on), but absolutely nothing concerning the altitude.</p>
61
+<p>I finally found two datasets available for France, one published by <a href="https://www.data.gouv.fr/fr/datasets/bd-alti-75m/">IGN</a> and the other one being the <a href="http://wiki.openstreetmap.org/wiki/SRTM">SRTM</a> dataset published by the NASA. The one from IGN provides altitude information for the whole French territory, at a resolution of 75m, which is quite good for numerically modeling the terrain. The one from NASA is more complete and provides altitude information for the whole globe surface between -60° and 60° latitude at a resolution of about 90m, obtained by averaging on 30m samples.</p>
62
+<h2>IGN BD ALTI opendata</h2>
63
+<p>First of all, let's have a look at the BD ALTI from IGN, which is not as widely used as the SRTM one (at least in a hobbyist context) and does not have much documentation around there.</p>
64
+<p>IGN provides an archive containing the data for the whole French territory. In the archive, there are several folders. The interesting one, in our case, is <code>1_DONNEES_LIVRAISON_*</code> which contains all the data files.</p>
65
+<p>Altitude data is available in two formats: GeoTiff (Tiff with geolocation metadata) and ASCII Esri grid. I personally used the ASCII Esri Grid files. For more info about this file format, you can refer to <a href="https://en.wikipedia.org/wiki/Esri_grid#ASCII">the Wikipedia page</a>.</p>
66
+<p>Each file starts with some header informations: number of rows and cols (1000), position of the lower-left corner in X and Y coordinates, size of an elementary cell and value used to indicate missing data. The file then contains a matrix representing the values of each cell, as described in the Wikipedia page.</p>
67
+<p>Position on the map is indicated in X and Y coordinates, and not using the standard latitude and longitude coordinates. This is a different projection system, called <a href="https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert">Lambert93</a>, and used for official maps of France. <a href="https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert">Wikipedia</a> contains the relevant information to translate from the standard WGS84 (satellite latitude and longitude coordinates) to the Lambert93 coordinates, and reciprocally but the best way seems to be to use the <a href="http://trac.osgeo.org/proj/">Proj.4 libray</a> which has a <a href="https://pypi.python.org/pypi/pyproj?">Python binding</a> to handle the conversion.</p>
68
+<p>To find a specific point, you should then iterate over the available data files and check if the position of the point is between <code>xllcorner, yllcorner</code> and <code>xllcorner + ncols * cellsize, yllcorner + nrows * cellsize</code>. Then, you just have to get the value of the matching cell in the matrix description in the file.</p>
69
+<p>An example script is available at <a href="https://github.com/Phyks/IGN_OpenData">https://github.com/Phyks/IGN_OpenData</a>. It takes a rectangle defined by two latitudes and longitudes in input, as well as the data folder to process, and will output the relevant data from the BD ALTI dataset, in XYZ file format, which is equivalent to a CSV file with columns X, Y and altitude (Z), separated by tabulations, and sorted. This is also an example use of the Proj.4 Python binding to handle basic coordinates system transforms.</p>
70
+<h2>SRTM opendata</h2>
71
+<p>The SRTM dataset exists in multiple versions and different samplings. Have a look at <a href="https://github.com/Phyks/IGN_OpenData">this wiki page</a> to have more information about it. I was interested in SRTMGL3 version 3, which is the third iteration of the dataset sampled at 3 arcseconds (which is about 90m). It is available at <a href="this address">http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/</a> (before clicking the main folder in this address, please note that this is very heavy and long to process as it contains all the files for the whole world). <a href="">rv</a> uses it and provides a basic import script to a PostgreSQL database, available <a href="https://gitlab.crans.org/leger/rv/blob/master/height/populate_height_table.cc">here</a>.</p>
72
+<p>All files are named with a convention to describe the tile they represent. For instance, the tile starting at 0° North and 6° East is called <code>N00E006.*</code>.</p>
73
+<p>There is a really nice <a href="https://gis.stackexchange.com/questions/43743/how-to-extract-elevation-from-hgt-file">StackOverflow post</a> to explain how to handle these files and the following will almost be a rewriting of this post.</p>
74
+<p>First of all, take the integer part of the position you want (latitude and longitude), and look for the corresponding file at the previous address. You will download a (zipped) hgt file containing the altitude data. This file is a big-endian binary file that you will have to parse.</p>
75
+<p>First, you have to find the pixels coordinates representing your geographic point. To this purpose, you have to take the floating part of the latitude and longitude of the point you want and convert them to arcseconds (e.g. for 50° 24' 58.888", you will have 24 * 60 + 58.888 = 1498.888). As the sampling is done at 3 arcseconds, the pixel coordinates are given by the closest integer to the latitude (resp. longitude) of your point, expressed in arcseconds, divided by 3. Latitude will give you the row index, whereas longitude will give you the col index.</p>
76
+<p>The first row in the file is the northernmost one, so if we are looking at row 500 from the lower edge, we actually have to look at row 1201 - 500 from the beginning of the files (1200 being 3600&nbsp;/ 3, the total number of rows in the data file).</p>
77
+<p>We then have to iterate on cols to find the correct one, using the same principle.</p>
78
+<p>An example script is available <a href="https://github.com/Phyks/IGN_OpenData/blob/master/srtm_alti.py">here</a> although it was not thoroughly tested. If you fix any problem with it, please report&nbsp;:) </p>
79
+		<footer><p class="date">Le 13/02/2015 à 17:35</p>
80
+		<p class="tags">Tags : <a href="//phyks.me/tags/GeoData.html">GeoData</a>, <a href="//phyks.me/tags/OpenData.html">OpenData</a></p></footer>
389 81
 	</div>
390 82
 </article>
391 83
             </div>

+ 3
- 3
blog/archives.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>
@@ -43,7 +43,7 @@
43 43
                 </div>
44 44
 
45 45
                 <div id="articles">
46
-<article><div class="article"><h1 class="article_title">Archives</h1><ul><li><a href="//phyks.me/2015">2015</a></li><ul><li><a href="//phyks.me/2015/01">Janvier</a></li></ul><li><a href="//phyks.me/2014">2014</a></li><ul><li><a href="//phyks.me/2014/11">Novembre</a></li><li><a href="//phyks.me/2014/10">Octobre</a></li><li><a href="//phyks.me/2014/08">Août</a></li><li><a href="//phyks.me/2014/07">Juillet</a></li><li><a href="//phyks.me/2014/04">Avril</a></li><li><a href="//phyks.me/2014/03">Mars</a></li><li><a href="//phyks.me/2014/02">Février</a></li></ul><li><a href="//phyks.me/2013">2013</a></li><ul><li><a href="//phyks.me/2013/12">Décembre</a></li><li><a href="//phyks.me/2013/11">Novembre</a></li></ul></ul></div></article>            </div>
46
+<article><div class="article"><h1 class="article_title">Archives</h1><ul><li><a href="//phyks.me/2015">2015</a></li><ul><li><a href="//phyks.me/2015/02">Février</a></li><li><a href="//phyks.me/2015/01">Janvier</a></li></ul><li><a href="//phyks.me/2014">2014</a></li><ul><li><a href="//phyks.me/2014/11">Novembre</a></li><li><a href="//phyks.me/2014/10">Octobre</a></li><li><a href="//phyks.me/2014/08">Août</a></li><li><a href="//phyks.me/2014/07">Juillet</a></li><li><a href="//phyks.me/2014/04">Avril</a></li><li><a href="//phyks.me/2014/03">Mars</a></li><li><a href="//phyks.me/2014/02">Février</a></li></ul><li><a href="//phyks.me/2013">2013</a></li><ul><li><a href="//phyks.me/2013/12">Décembre</a></li><li><a href="//phyks.me/2013/11">Novembre</a></li></ul></ul></div></article>            </div>
47 47
             <footer id="rss">
48 48
                 <p><a href="//phyks.me/rss.xml"><img src="//phyks.me/img/rss.png" alt="RSS"/></a></p>
49 49
             </footer>

+ 39
- 39
blog/index.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>
@@ -45,6 +45,43 @@
45 45
                 <div id="articles">
46 46
 <article>
47 47
 	<aside>
48
+		<p class="day">13</p>
49
+		<p class="month">Février</p>
50
+	</aside>
51
+	<div class="article">
52
+		<header><h1 class="article_title"><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></h1></header>
53
+		<!-- 
54
+    @author=Phyks
55
+    @date=13022015-1735
56
+    @title=Looking for altitude OpenData
57
+    @tags=GeoData, OpenData
58
+-->
59
+
60
+<p>Recently, for a personal project, I looked for opendata for altitude in France. These are not so easy to find, although there are some really good opendata out there, with a very great accuracy. Indeed, <a href="http://www.openstreetmap.org/#map=5/51.500/-0.100">OpenStreetMaps</a> provides really accurate opendata for maps (street names and so on), but absolutely nothing concerning the altitude.</p>
61
+<p>I finally found two datasets available for France, one published by <a href="https://www.data.gouv.fr/fr/datasets/bd-alti-75m/">IGN</a> and the other one being the <a href="http://wiki.openstreetmap.org/wiki/SRTM">SRTM</a> dataset published by the NASA. The one from IGN provides altitude information for the whole French territory, at a resolution of 75m, which is quite good for numerically modeling the terrain. The one from NASA is more complete and provides altitude information for the whole globe surface between -60° and 60° latitude at a resolution of about 90m, obtained by averaging on 30m samples.</p>
62
+<h2>IGN BD ALTI opendata</h2>
63
+<p>First of all, let's have a look at the BD ALTI from IGN, which is not as widely used as the SRTM one (at least in a hobbyist context) and does not have much documentation around there.</p>
64
+<p>IGN provides an archive containing the data for the whole French territory. In the archive, there are several folders. The interesting one, in our case, is <code>1_DONNEES_LIVRAISON_*</code> which contains all the data files.</p>
65
+<p>Altitude data is available in two formats: GeoTiff (Tiff with geolocation metadata) and ASCII Esri grid. I personally used the ASCII Esri Grid files. For more info about this file format, you can refer to <a href="https://en.wikipedia.org/wiki/Esri_grid#ASCII">the Wikipedia page</a>.</p>
66
+<p>Each file starts with some header informations: number of rows and cols (1000), position of the lower-left corner in X and Y coordinates, size of an elementary cell and value used to indicate missing data. The file then contains a matrix representing the values of each cell, as described in the Wikipedia page.</p>
67
+<p>Position on the map is indicated in X and Y coordinates, and not using the standard latitude and longitude coordinates. This is a different projection system, called <a href="https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert">Lambert93</a>, and used for official maps of France. <a href="https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert">Wikipedia</a> contains the relevant information to translate from the standard WGS84 (satellite latitude and longitude coordinates) to the Lambert93 coordinates, and reciprocally but the best way seems to be to use the <a href="http://trac.osgeo.org/proj/">Proj.4 libray</a> which has a <a href="https://pypi.python.org/pypi/pyproj?">Python binding</a> to handle the conversion.</p>
68
+<p>To find a specific point, you should then iterate over the available data files and check if the position of the point is between <code>xllcorner, yllcorner</code> and <code>xllcorner + ncols * cellsize, yllcorner + nrows * cellsize</code>. Then, you just have to get the value of the matching cell in the matrix description in the file.</p>
69
+<p>An example script is available at <a href="https://github.com/Phyks/IGN_OpenData">https://github.com/Phyks/IGN_OpenData</a>. It takes a rectangle defined by two latitudes and longitudes in input, as well as the data folder to process, and will output the relevant data from the BD ALTI dataset, in XYZ file format, which is equivalent to a CSV file with columns X, Y and altitude (Z), separated by tabulations, and sorted. This is also an example use of the Proj.4 Python binding to handle basic coordinates system transforms.</p>
70
+<h2>SRTM opendata</h2>
71
+<p>The SRTM dataset exists in multiple versions and different samplings. Have a look at <a href="https://github.com/Phyks/IGN_OpenData">this wiki page</a> to have more information about it. I was interested in SRTMGL3 version 3, which is the third iteration of the dataset sampled at 3 arcseconds (which is about 90m). It is available at <a href="this address">http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/</a> (before clicking the main folder in this address, please note that this is very heavy and long to process as it contains all the files for the whole world). <a href="">rv</a> uses it and provides a basic import script to a PostgreSQL database, available <a href="https://gitlab.crans.org/leger/rv/blob/master/height/populate_height_table.cc">here</a>.</p>
72
+<p>All files are named with a convention to describe the tile they represent. For instance, the tile starting at 0° North and 6° East is called <code>N00E006.*</code>.</p>
73
+<p>There is a really nice <a href="https://gis.stackexchange.com/questions/43743/how-to-extract-elevation-from-hgt-file">StackOverflow post</a> to explain how to handle these files and the following will almost be a rewriting of this post.</p>
74
+<p>First of all, take the integer part of the position you want (latitude and longitude), and look for the corresponding file at the previous address. You will download a (zipped) hgt file containing the altitude data. This file is a big-endian binary file that you will have to parse.</p>
75
+<p>First, you have to find the pixels coordinates representing your geographic point. To this purpose, you have to take the floating part of the latitude and longitude of the point you want and convert them to arcseconds (e.g. for 50° 24' 58.888", you will have 24 * 60 + 58.888 = 1498.888). As the sampling is done at 3 arcseconds, the pixel coordinates are given by the closest integer to the latitude (resp. longitude) of your point, expressed in arcseconds, divided by 3. Latitude will give you the row index, whereas longitude will give you the col index.</p>
76
+<p>The first row in the file is the northernmost one, so if we are looking at row 500 from the lower edge, we actually have to look at row 1201 - 500 from the beginning of the files (1200 being 3600&nbsp;/ 3, the total number of rows in the data file).</p>
77
+<p>We then have to iterate on cols to find the correct one, using the same principle.</p>
78
+<p>An example script is available <a href="https://github.com/Phyks/IGN_OpenData/blob/master/srtm_alti.py">here</a> although it was not thoroughly tested. If you fix any problem with it, please report&nbsp;:) </p>
79
+		<footer><p class="date">Le 13/02/2015 à 17:35</p>
80
+		<p class="tags">Tags : <a href="//phyks.me/tags/GeoData.html">GeoData</a>, <a href="//phyks.me/tags/OpenData.html">OpenData</a></p></footer>
81
+	</div>
82
+</article>
83
+<article>
84
+	<aside>
48 85
 		<p class="day">12</p>
49 86
 		<p class="month">Janvier</p>
50 87
 	</aside>
@@ -1072,43 +1109,6 @@ Un important et un petit ajout à votre projet.</p>
1072 1109
 		<p class="tags">Tags : <a href="//phyks.me/tags/Web.html">Web</a>, <a href="//phyks.me/tags/Dev.html">Dev</a></p></footer>
1073 1110
 	</div>
1074 1111
 </article>
1075
-<article>
1076
-	<aside>
1077
-		<p class="day">15</p>
1078
-		<p class="month">Juillet</p>
1079
-	</aside>
1080
-	<div class="article">
1081
-		<header><h1 class="article_title"><a href="//phyks.me/2014/07/specific_vim_config_git.html">Specific Vim config per Git repository</a></h1></header>
1082
-		<!--
1083
-	@author=Phyks
1084
-	@date=15072014-2220
1085
-	@title=Specific Vim config per Git repository
1086
-	@tags=Linux, Vim
1087
--->
1088
-<p>I was looking for a way to add custom vim options on a per-repo basis. The standard way I saw for now, was adding some comments to change the Vim config on a per-file basis. There were some alternatives which were working for any project folder (and not only git repos) but they were only working if you start Vim from the root of the project, or they were exploring the tree from local folder up to root (and needed a plugin). None of them were satisfactory.</p>
1089
-
1090
-<p>When I edit a file and need specific Vim configuration, it is usually inside a git repo. So, it is easy to know what is the root folder, and I just wanted to search for a <span class="monospace">Vimrc</span> file in this folder. No complicated tree searching, working from anywhere inside the repo, no per-file specific configuration.</p>
1091
-
1092
-<p>First of all, the magic command I used to find the git root folder is <span class="monospace">git rev-parse --show-top-level</span>.</p>
1093
-
1094
-<p>Then, all I had to do is wrap it correctly in my <span class="monospace">.vimrc</span>:</p>
1095
-<code>
1096
-<pre>" Git specific configuration
1097
-let git_path = system("git rev-parse --show-toplevel 2>/dev/null")
1098
-let git_vimrc = substitute(git_path, '\n', '', '') . "/.vimrc"
1099
-if !empty(glob(git_vimrc))
1100
-    sandbox exec ":source " . git_vimrc
1101
-endif
1102
-</pre>
1103
-</code>
1104
-<p>Note: I use sandbox to prevent arbitrary functions from being executed.</p>
1105
-
1106
-<p>This small code, added at the end of your <span class="monospace">.vimrc</span> will just look for a <span class="monospace">.vimrc</span> at the root the git repository and source it if possible. That's exactly what I wanted :)</p>
1107
-
1108
-		<footer><p class="date">Le 15/07/2014 à 22:20</p>
1109
-		<p class="tags">Tags : <a href="//phyks.me/tags/Linux.html">Linux</a>, <a href="//phyks.me/tags/Vim.html">Vim</a></p></footer>
1110
-	</div>
1111
-</article>
1112 1112
 <p class="archives"><a href="//phyks.me/archives.html">Archives</a></p>            </div>
1113 1113
             <footer id="rss">
1114 1114
                 <p><a href="//phyks.me/rss.xml"><img src="//phyks.me/img/rss.png" alt="RSS"/></a></p>

+ 141
- 61
blog/rss.xml View File

@@ -7,12 +7,60 @@
7 7
 		<language>fr</language>
8 8
 		<copyright>CC BY</copyright>
9 9
 		<webMaster>webmaster@phyks.me (Phyks)</webMaster>
10
-		<lastBuildDate>Mon, 12 Jan 2015 20:04:37 -0000</lastBuildDate>
10
+		<lastBuildDate>Fri, 13 Feb 2015 14:21:54 -0000</lastBuildDate>
11
+		<item>
12
+			<title>Looking for altitude OpenData</title>
13
+			<link>http://phyks.me/2015/02/opendata_altimetry.html</link>
14
+			<guid isPermaLink="true">http://phyks.me/2015/02/opendata_altimetry.html</guid>
15
+			<description>
16
+
17
+
18
+
19
+Recently, for a personal project, I looked for opendata for altitude in France. These are not so easy to find, although there are some really good opendata out there, with a very great accurac…</description>
20
+			<content:encoded><![CDATA[<div class="article">
21
+<header></header>
22
+<!-- 
23
+    @author=Phyks
24
+    @date=13022015-1735
25
+    @title=Looking for altitude OpenData
26
+    @tags=GeoData, OpenData
27
+-->
28
+<p>Recently, for a personal project, I looked for opendata for altitude in France. These are not so easy to find, although there are some really good opendata out there, with a very great accuracy. Indeed, <a href="http://www.openstreetmap.org/#map=5/51.500/-0.100">OpenStreetMaps</a> provides really accurate opendata for maps (street names and so on), but absolutely nothing concerning the altitude.</p>
29
+<p>I finally found two datasets available for France, one published by <a href="https://www.data.gouv.fr/fr/datasets/bd-alti-75m/">IGN</a> and the other one being the <a href="http://wiki.openstreetmap.org/wiki/SRTM">SRTM</a> dataset published by the NASA. The one from IGN provides altitude information for the whole French territory, at a resolution of 75m, which is quite good for numerically modeling the terrain. The one from NASA is more complete and provides altitude information for the whole globe surface between -60° and 60° latitude at a resolution of about 90m, obtained by averaging on 30m samples.</p>
30
+<h2>IGN BD ALTI opendata</h2>
31
+<p>First of all, let's have a look at the BD ALTI from IGN, which is not as widely used as the SRTM one (at least in a hobbyist context) and does not have much documentation around there.</p>
32
+<p>IGN provides an archive containing the data for the whole French territory. In the archive, there are several folders. The interesting one, in our case, is <code>1_DONNEES_LIVRAISON_*</code> which contains all the data files.</p>
33
+<p>Altitude data is available in two formats: GeoTiff (Tiff with geolocation metadata) and ASCII Esri grid. I personally used the ASCII Esri Grid files. For more info about this file format, you can refer to <a href="https://en.wikipedia.org/wiki/Esri_grid#ASCII">the Wikipedia page</a>.</p>
34
+<p>Each file starts with some header informations: number of rows and cols (1000), position of the lower-left corner in X and Y coordinates, size of an elementary cell and value used to indicate missing data. The file then contains a matrix representing the values of each cell, as described in the Wikipedia page.</p>
35
+<p>Position on the map is indicated in X and Y coordinates, and not using the standard latitude and longitude coordinates. This is a different projection system, called <a href="https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert">Lambert93</a>, and used for official maps of France. <a href="https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert">Wikipedia</a> contains the relevant information to translate from the standard WGS84 (satellite latitude and longitude coordinates) to the Lambert93 coordinates, and reciprocally but the best way seems to be to use the <a href="http://trac.osgeo.org/proj/">Proj.4 libray</a> which has a <a href="https://pypi.python.org/pypi/pyproj?">Python binding</a> to handle the conversion.</p>
36
+<p>To find a specific point, you should then iterate over the available data files and check if the position of the point is between <code>xllcorner, yllcorner</code> and <code>xllcorner + ncols * cellsize, yllcorner + nrows * cellsize</code>. Then, you just have to get the value of the matching cell in the matrix description in the file.</p>
37
+<p>An example script is available at <a href="https://github.com/Phyks/IGN_OpenData">https://github.com/Phyks/IGN_OpenData</a>. It takes a rectangle defined by two latitudes and longitudes in input, as well as the data folder to process, and will output the relevant data from the BD ALTI dataset, in XYZ file format, which is equivalent to a CSV file with columns X, Y and altitude (Z), separated by tabulations, and sorted. This is also an example use of the Proj.4 Python binding to handle basic coordinates system transforms.</p>
38
+<h2>SRTM opendata</h2>
39
+<p>The SRTM dataset exists in multiple versions and different samplings. Have a look at <a href="https://github.com/Phyks/IGN_OpenData">this wiki page</a> to have more information about it. I was interested in SRTMGL3 version 3, which is the third iteration of the dataset sampled at 3 arcseconds (which is about 90m). It is available at <a href="this address">http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/</a> (before clicking the main folder in this address, please note that this is very heavy and long to process as it contains all the files for the whole world). <a href="">rv</a> uses it and provides a basic import script to a PostgreSQL database, available <a href="https://gitlab.crans.org/leger/rv/blob/master/height/populate_height_table.cc">here</a>.</p>
40
+<p>All files are named with a convention to describe the tile they represent. For instance, the tile starting at 0° North and 6° East is called <code>N00E006.*</code>.</p>
41
+<p>There is a really nice <a href="https://gis.stackexchange.com/questions/43743/how-to-extract-elevation-from-hgt-file">StackOverflow post</a> to explain how to handle these files and the following will almost be a rewriting of this post.</p>
42
+<p>First of all, take the integer part of the position you want (latitude and longitude), and look for the corresponding file at the previous address. You will download a (zipped) hgt file containing the altitude data. This file is a big-endian binary file that you will have to parse.</p>
43
+<p>First, you have to find the pixels coordinates representing your geographic point. To this purpose, you have to take the floating part of the latitude and longitude of the point you want and convert them to arcseconds (e.g. for 50° 24' 58.888", you will have 24 * 60 + 58.888 = 1498.888). As the sampling is done at 3 arcseconds, the pixel coordinates are given by the closest integer to the latitude (resp. longitude) of your point, expressed in arcseconds, divided by 3. Latitude will give you the row index, whereas longitude will give you the col index.</p>
44
+<p>The first row in the file is the northernmost one, so if we are looking at row 500 from the lower edge, we actually have to look at row 1201 - 500 from the beginning of the files (1200 being 3600 / 3, the total number of rows in the data file).</p>
45
+<p>We then have to iterate on cols to find the correct one, using the same principle.</p>
46
+<p>An example script is available <a href="https://github.com/Phyks/IGN_OpenData/blob/master/srtm_alti.py">here</a> although it was not thoroughly tested. If you fix any problem with it, please report :) </p>
47
+<footer>
48
+<p class="tags">Tags : <a href="http://phyks.me/tags/GeoData.html">GeoData</a>, <a href="http://phyks.me/tags/OpenData.html">OpenData</a></p></footer>
49
+</div>]]></content:encoded>
50
+			<pubDate>Fri, 13 Feb 2015 15:35:00 -0000</pubDate>
51
+			<category>GeoData</category>
52
+			<category>OpenData</category>
53
+			<author>webmaster@phyks.me (Phyks)</author>
54
+		</item>
11 55
 		<item>
12 56
 			<title>Passage à Known</title>
13 57
 			<link>http://phyks.me/2015/01/moving_known.html</link>
14 58
 			<guid isPermaLink="true">http://phyks.me/2015/01/moving_known.html</guid>
15
-			<description>Cela fait quelques semaines que je teste Known sur mon instance. Je publie systématiquement mes articles aux deux endroits, sur mon blog et sur Known, depuis quelques temps, et je pense migrer définitivement car je suis pleinement satisfait par Known et ne voit pas vraiment l'intérêt de maintenir deux espaces différents avec le même contenu (sans compter que ce blog a certains bugs, comme le décompte des articles dans le panneau de gauche……</description>
59
+			<description>
60
+
61
+
62
+
63
+Cela fait quelques semaines que je teste Known sur mon instance. Je publie systématiquement mes articles aux deux endroits, sur mon blog et sur Known, depuis quelques temps, et je pense migrer définitivement car je suis pleinement satisfait par Known et ne voit pas vraiment l'intérêt de maintenir deux espaces différents avec le même contenu (sans compter que ce blog a certains bugs, comme le décompte des articles dans le panneau de gauche……</description>
16 64
 			<content:encoded><![CDATA[<div class="article">
17 65
 <header></header>
18 66
 <!-- 
@@ -36,7 +84,11 @@
36 84
 			<title>Self-hosting Firefox sync 1.5</title>
37 85
 			<link>http://phyks.me/2015/01/firefox_sync_15.html</link>
38 86
 			<guid isPermaLink="true">http://phyks.me/2015/01/firefox_sync_15.html</guid>
39
-			<description>I used to self-host Firefox Sync but since the new Firefox Accounts + Firefox Sync (appeared in Firefox 29), it has became more difficult to self-host it, and I didn't take time to handle i…</description>
87
+			<description>
88
+
89
+
90
+
91
+I used to self-host Firefox Sync but since the new Firefox Accounts + Firefox Sync (appeared in Firefox 29), it has became more difficult to self-host it, and I didn't take time to handle i…</description>
40 92
 			<content:encoded><![CDATA[<div class="article">
41 93
 <header></header>
42 94
 <!-- 
@@ -147,7 +199,11 @@ grunt server:dist
147 199
 			<title>Personal review of the Lenovo Thinkpad T440</title>
148 200
 			<link>http://phyks.me/2015/01/lenovo_t440.html</link>
149 201
 			<guid isPermaLink="true">http://phyks.me/2015/01/lenovo_t440.html</guid>
150
-			<description>I recently changed my laptop and bought a Lenovo T440. I used to have a Clevo W150ERQ (actually a LDLC Saturne, but LDLC is just rebranding Clevo's laptops…</description>
202
+			<description>
203
+
204
+
205
+
206
+I recently changed my laptop and bought a Lenovo T440. I used to have a Clevo W150ERQ (actually a LDLC Saturne, but LDLC is just rebranding Clevo's laptops…</description>
151 207
 			<content:encoded><![CDATA[<div class="article">
152 208
 <header></header>
153 209
 <!-- 
@@ -211,7 +267,11 @@ grunt server:dist
211 267
 			<title>Publishing through the Known API</title>
212 268
 			<link>http://phyks.me/2015/01/known_api.html</link>
213 269
 			<guid isPermaLink="true">http://phyks.me/2015/01/known_api.html</guid>
214
-			<description>As stated in my last article, I'm considering moving my blog to Known. But I'm not a huge fan of WSIWYG editor…</description>
270
+			<description>
271
+
272
+
273
+
274
+As stated in my last article, I'm considering moving my blog to Known. But I'm not a huge fan of WSIWYG editor…</description>
215 275
 			<content:encoded><![CDATA[<div class="article">
216 276
 <header></header>
217 277
 <!-- 
@@ -256,7 +316,11 @@ grunt server:dist
256 316
 			<title>Thoughts on blogging engine</title>
257 317
 			<link>http://phyks.me/2015/01/known.html</link>
258 318
 			<guid isPermaLink="true">http://phyks.me/2015/01/known.html</guid>
259
-			<description>For now, I am using my own custom made Python script to handle my static blog with a Git backend, Blogi…</description>
319
+			<description>
320
+
321
+
322
+
323
+For now, I am using my own custom made Python script to handle my static blog with a Git backend, Blogi…</description>
260 324
 			<content:encoded><![CDATA[<div class="article">
261 325
 <header></header>
262 326
 <!-- 
@@ -289,7 +353,11 @@ grunt server:dist
289 353
 			<title>Versionner ses fichiers de configuration avec vcsh</title>
290 354
 			<link>http://phyks.me/2015/01/vcsh.html</link>
291 355
 			<guid isPermaLink="true">http://phyks.me/2015/01/vcsh.html</guid>
292
-			<description>Je viens de découvrir un petit outil fort pratique pour versionner ses fichiers de configuration avec Git : vcs…</description>
356
+			<description>
357
+
358
+
359
+
360
+Je viens de découvrir un petit outil fort pratique pour versionner ses fichiers de configuration avec Git : vcs…</description>
293 361
 			<content:encoded><![CDATA[<div class="article">
294 362
 <header></header>
295 363
 <!-- 
@@ -318,7 +386,11 @@ grunt server:dist
318 386
 			<title>Gestion d'articles scientifiques avec BMC</title>
319 387
 			<link>http://phyks.me/2015/01/bmc.html</link>
320 388
 			<guid isPermaLink="true">http://phyks.me/2015/01/bmc.html</guid>
321
-			<description>Lorsqu'on fait de la recherche scientifique (ou de la veille), on est très vite amener à stocker de très nombreux articles en PDF…</description>
389
+			<description>
390
+
391
+
392
+
393
+Lorsqu'on fait de la recherche scientifique (ou de la veille), on est très vite amener à stocker de très nombreux articles en PDF…</description>
322 394
 			<content:encoded><![CDATA[<div class="article">
323 395
 <header></header>
324 396
 <!-- 
@@ -361,7 +433,11 @@ grunt server:dist
361 433
 			<title>Getting ipv6 to work with a Kimsufi server</title>
362 434
 			<link>http://phyks.me/2014/11/ipv6_kimsufi.html</link>
363 435
 			<guid isPermaLink="true">http://phyks.me/2014/11/ipv6_kimsufi.html</guid>
364
-			<description>Starting from yesterday, my server (phyks.me) should be available using ipv6. This was not the case before due to laziness and a lack of configuratio…</description>
436
+			<description>
437
+
438
+
439
+
440
+Starting from yesterday, my server (phyks.me) should be available using ipv6. This was not the case before due to laziness and a lack of configuratio…</description>
365 441
 			<content:encoded><![CDATA[<div class="article">
366 442
 <header></header>
367 443
 <!-- 
@@ -394,7 +470,11 @@ grunt server:dist
394 470
 			<title>Proof-of-concept: BloomySearch, a (JavaScript) client-side search engine for static websites</title>
395 471
 			<link>http://phyks.me/2014/11/bloomysearch.html</link>
396 472
 			<guid isPermaLink="true">http://phyks.me/2014/11/bloomysearch.html</guid>
397
-			<description>Overview
473
+			<description>
474
+
475
+
476
+
477
+Overview
398 478
 Many websites and blogs are statically generated and the webserver only serves static file…</description>
399 479
 			<content:encoded><![CDATA[<div class="article">
400 480
 <header></header>
@@ -449,7 +529,11 @@ Many websites and blogs are statically generated and the webserver only serves s
449 529
 			<title>Balancer le son de ses hauts-parleurs sur le réseau</title>
450 530
 			<link>http://phyks.me/2014/10/pulseaudio_remote.html</link>
451 531
 			<guid isPermaLink="true">http://phyks.me/2014/10/pulseaudio_remote.html</guid>
452
-			<description>J'ai un PC fixe et un portable, et je cherchais un moyen de balancer le son de mon portable sur les hauts-parleurs de bonne qualité branchés sur mon PC fixe, quand je suis sur le même résea…</description>
532
+			<description>
533
+
534
+
535
+
536
+J'ai un PC fixe et un portable, et je cherchais un moyen de balancer le son de mon portable sur les hauts-parleurs de bonne qualité branchés sur mon PC fixe, quand je suis sur le même résea…</description>
453 537
 			<content:encoded><![CDATA[<div class="article">
454 538
 <header></header>
455 539
 <!-- 
@@ -484,7 +568,11 @@ Many websites and blogs are statically generated and the webserver only serves s
484 568
 			<title>Utiliser son PC sous Arch pour connecter un Raspberry Pi à Internet</title>
485 569
 			<link>http://phyks.me/2014/10/dhcp_server.html</link>
486 570
 			<guid isPermaLink="true">http://phyks.me/2014/10/dhcp_server.html</guid>
487
-			<description>J'ai un Raspberry Pi et mon portable sous Arch Linux, et je me promène pas mal avec les deux. Mais je n'ai pas toujours de routeur à disposition pour brancher les deux sur le même réseau et travailler facilemen…</description>
571
+			<description>
572
+
573
+
574
+
575
+J'ai un Raspberry Pi et mon portable sous Arch Linux, et je me promène pas mal avec les deux. Mais je n'ai pas toujours de routeur à disposition pour brancher les deux sur le même réseau et travailler facilemen…</description>
488 576
 			<content:encoded><![CDATA[<div class="article">
489 577
 <header></header>
490 578
 <!-- 
@@ -551,7 +639,11 @@ iptables -A POSTROUTING -t nat -j MASQUERADE
551 639
 			<title>Sortez vos emails, c'est pas sale !</title>
552 640
 			<link>http://phyks.me/2014/08/sortez_vos_emails.html</link>
553 641
 			<guid isPermaLink="true">http://phyks.me/2014/08/sortez_vos_emails.html</guid>
554
-			<description>TLDR in English : If you care about your scripts, if you love them and want them to be used, to live, leave a simple way to contact you (…</description>
642
+			<description>
643
+
644
+
645
+
646
+TLDR in English : If you care about your scripts, if you love them and want them to be used, to live, leave a simple way to contact you (…</description>
555 647
 			<content:encoded><![CDATA[<div class="article">
556 648
 <header></header>
557 649
 <!-- 
@@ -599,7 +691,11 @@ iptables -A POSTROUTING -t nat -j MASQUERADE
599 691
 			<title>Synchroniser ses ordinateurs 1/2</title>
600 692
 			<link>http://phyks.me/2014/08/synchronisation_backups_1.html</link>
601 693
 			<guid isPermaLink="true">http://phyks.me/2014/08/synchronisation_backups_1.html</guid>
602
-			<description>Étude des solutions disponibles
694
+			<description>
695
+
696
+
697
+
698
+Étude des solutions disponibles
603 699
 J'utilise quotidiennement au moins 2 ordinateurs : mon ordinateur portable et mon fix…</description>
604 700
 			<content:encoded><![CDATA[<div class="article">
605 701
 <header></header>
@@ -694,7 +790,11 @@ J'utilise quotidiennement au moins 2 ordinateurs : mon ordinateur portable et m
694 790
 			<title>Les énigmes du réseau Free Mobile</title>
695 791
 			<link>http://phyks.me/2014/08/free_mobile_fluctuant.html</link>
696 792
 			<guid isPermaLink="true">http://phyks.me/2014/08/free_mobile_fluctuant.html</guid>
697
-			<description>C'est très étrange… Là où je suis, la connexion SSH est toujours utilisable (avec un lag important rendant très insupportable toute édition de fichiers, mais Weechat over SSH est utilisable), mais le débit sur le port 80 est très fluctuan…</description>
793
+			<description>
794
+
795
+
796
+
797
+C'est très étrange… Là où je suis, la connexion SSH est toujours utilisable (avec un lag important rendant très insupportable toute édition de fichiers, mais Weechat over SSH est utilisable), mais le débit sur le port 80 est très fluctuan…</description>
698 798
 			<content:encoded><![CDATA[<div class="article">
699 799
 <header></header>
700 800
 <!--
@@ -720,7 +820,11 @@ J'utilise quotidiennement au moins 2 ordinateurs : mon ordinateur portable et m
720 820
 			<title>Recevoir ses emails par SMS avec Free Mobile</title>
721 821
 			<link>http://phyks.me/2014/07/notification_sms_free.html</link>
722 822
 			<guid isPermaLink="true">http://phyks.me/2014/07/notification_sms_free.html</guid>
723
-			<description>Edit : Cela fait bientôt une semaine que l'API Free me renvoie un 402, en boucle… je ne peux plus envoyer de SMS depuis l'AP…</description>
823
+			<description>
824
+
825
+
826
+
827
+Edit : Cela fait bientôt une semaine que l'API Free me renvoie un 402, en boucle… je ne peux plus envoyer de SMS depuis l'AP…</description>
724 828
 			<content:encoded><![CDATA[<div class="article">
725 829
 <header></header>
726 830
 <!-- 
@@ -752,7 +856,11 @@ J'utilise quotidiennement au moins 2 ordinateurs : mon ordinateur portable et m
752 856
 			<title>Diaspora*, c'est quand même pas pour tout le monde</title>
753 857
 			<link>http://phyks.me/2014/07/diaspora_pas_pour_tout_monde.html</link>
754 858
 			<guid isPermaLink="true">http://phyks.me/2014/07/diaspora_pas_pour_tout_monde.html</guid>
755
-			<description>Ça faisait quelques mois que je disais que j'allais m'héberger une instance de Diaspora* (un pod comme ça s'appelle…</description>
859
+			<description>
860
+
861
+
862
+
863
+Ça faisait quelques mois que je disais que j'allais m'héberger une instance de Diaspora* (un pod comme ça s'appelle…</description>
756 864
 			<content:encoded><![CDATA[<div class="article">
757 865
 <header></header>
758 866
 <!--
@@ -809,7 +917,11 @@ J'utilise quotidiennement au moins 2 ordinateurs : mon ordinateur portable et m
809 917
 			<title>Lister des corrections en ligne</title>
810 918
 			<link>http://phyks.me/2014/07/inline_diff.html</link>
811 919
 			<guid isPermaLink="true">http://phyks.me/2014/07/inline_diff.html</guid>
812
-			<description>Il m'arrive souvent de corriger des documents textes et de devoir noter facilement les fautes d'orthograph…</description>
920
+			<description>
921
+
922
+
923
+
924
+Il m'arrive souvent de corriger des documents textes et de devoir noter facilement les fautes d'orthograph…</description>
813 925
 			<content:encoded><![CDATA[<div class="article">
814 926
 <header></header>
815 927
 <!--
@@ -887,11 +999,7 @@ Si on utilise <span class="monospace">technique(+s)</span>, c'est la première q
887 999
         <blockquote>Dans ce texte, les sont mots inversés.</blockquote>
888 1000
         Moyennant une implémentation un peu plus large de l'algorithme, on pourrait utiliser la méthode précédente comme ceci, pour corriger cette phrase:
889 1001
         <pre>les (-sont) mots (+sont)</pre>
890
-        car rien n'interdit à un mot d'être entièrement supprimé ou ajouté.
891
-</li></ul>
892
-<footer>
893
-<p class="tags">Tags : <a href="http://phyks.me/tags/Dev.html">Dev</a></p></footer>
894
-</div>]]></content:encoded>
1002
+        car rien n'interdit à un mot d'être entièrement supprimé ou ajouté.</li></ul></div>]]></content:encoded>
895 1003
 			<pubDate>Thu, 24 Jul 2014 19:35:00 -0000</pubDate>
896 1004
 			<category>Dev</category>
897 1005
 			<author>webmaster@phyks.me (Phyks)</author>
@@ -900,7 +1008,11 @@ Si on utilise <span class="monospace">technique(+s)</span>, c'est la première q
900 1008
 			<title>Pourquoi la GPL n'est pas (si) libre</title>
901 1009
 			<link>http://phyks.me/2014/07/pourquoi_gpl_pas_libre.html</link>
902 1010
 			<guid isPermaLink="true">http://phyks.me/2014/07/pourquoi_gpl_pas_libre.html</guid>
903
-			<description>Cet article est une traduction (dont je ne garantis pas la qualité :) de cet article (en anglais). Je n'ai pas réussi à contacter l'auteur, et si celui-ci passe par là et souhaite le retrait de la traduction, je la retirera…</description>
1011
+			<description>
1012
+
1013
+
1014
+
1015
+Cet article est une traduction (dont je ne garantis pas la qualité :) de cet article (en anglais…</description>
904 1016
 			<content:encoded><![CDATA[<div class="article">
905 1017
 <header></header>
906 1018
 <!--
@@ -954,7 +1066,11 @@ Un important et un petit ajout à votre projet.</p>
954 1066
 			<title>Documenter son code PHP avec doxygen</title>
955 1067
 			<link>http://phyks.me/2014/07/doxygen_php.html</link>
956 1068
 			<guid isPermaLink="true">http://phyks.me/2014/07/doxygen_php.html</guid>
957
-			<description>Je cherchais hier un moyen de générer une belle doc PHP, à partir de mes fichiers sources. Je connaissais quelques outils de la sorte (OcamlDoc, Sphinx pour Python, JavaDoc et…</description>
1069
+			<description>
1070
+
1071
+
1072
+
1073
+Je cherchais hier un moyen de générer une belle doc PHP, à partir de mes fichiers sources. Je connaissais quelques outils de la sorte (OcamlDoc, Sphinx pour Python, JavaDoc et…</description>
958 1074
 			<content:encoded><![CDATA[<div class="article">
959 1075
 <header></header>
960 1076
 <!--
@@ -984,41 +1100,5 @@ Un important et un petit ajout à votre projet.</p>
984 1100
 			<category>Dev</category>
985 1101
 			<author>webmaster@phyks.me (Phyks)</author>
986 1102
 		</item>
987
-		<item>
988
-			<title>Specific Vim config per Git repository</title>
989
-			<link>http://phyks.me/2014/07/specific_vim_config_git.html</link>
990
-			<guid isPermaLink="true">http://phyks.me/2014/07/specific_vim_config_git.html</guid>
991
-			<description>I was looking for a way to add custom vim options on a per-repo basis. The standard way I saw for now, was adding some comments to change the Vim config on a per-file basi…</description>
992
-			<content:encoded><![CDATA[<div class="article">
993
-<header></header>
994
-<!--
995
-	@author=Phyks
996
-	@date=15072014-2220
997
-	@title=Specific Vim config per Git repository
998
-	@tags=Linux, Vim
999
--->
1000
-<p>I was looking for a way to add custom vim options on a per-repo basis. The standard way I saw for now, was adding some comments to change the Vim config on a per-file basis. There were some alternatives which were working for any project folder (and not only git repos) but they were only working if you start Vim from the root of the project, or they were exploring the tree from local folder up to root (and needed a plugin). None of them were satisfactory.</p>
1001
-<p>When I edit a file and need specific Vim configuration, it is usually inside a git repo. So, it is easy to know what is the root folder, and I just wanted to search for a <span class="monospace">Vimrc</span> file in this folder. No complicated tree searching, working from anywhere inside the repo, no per-file specific configuration.</p>
1002
-<p>First of all, the magic command I used to find the git root folder is <span class="monospace">git rev-parse --show-top-level</span>.</p>
1003
-<p>Then, all I had to do is wrap it correctly in my <span class="monospace">.vimrc</span>:</p>
1004
-<code>
1005
-<pre>" Git specific configuration
1006
-let git_path = system("git rev-parse --show-toplevel 2&gt;/dev/null")
1007
-let git_vimrc = substitute(git_path, '\n', '', '') . "/.vimrc"
1008
-if !empty(glob(git_vimrc))
1009
-    sandbox exec ":source " . git_vimrc
1010
-endif
1011
-</pre>
1012
-</code>
1013
-<p>Note: I use sandbox to prevent arbitrary functions from being executed.</p>
1014
-<p>This small code, added at the end of your <span class="monospace">.vimrc</span> will just look for a <span class="monospace">.vimrc</span> at the root the git repository and source it if possible. That's exactly what I wanted :)</p>
1015
-<footer>
1016
-<p class="tags">Tags : <a href="http://phyks.me/tags/Linux.html">Linux</a>, <a href="http://phyks.me/tags/Vim.html">Vim</a></p></footer>
1017
-</div>]]></content:encoded>
1018
-			<pubDate>Tue, 15 Jul 2014 19:20:00 -0000</pubDate>
1019
-			<category>Linux</category>
1020
-			<category>Vim</category>
1021
-			<author>webmaster@phyks.me (Phyks)</author>
1022
-		</item>
1023 1103
 	</channel>
1024 1104
 </rss>

+ 2
- 2
blog/tags/Arch.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/Autohébergement.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/DIY.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/Dev.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 89
- 0
blog/tags/GeoData OpenData.html View File

@@ -0,0 +1,89 @@
1
+<!DOCTYPE html>
2
+<html lang="fr">
3
+    <head>
4
+        <meta charset="utf-8">
5
+        <title>Phyks' blog - tags/GeoData OpenData</title>
6
+		<link rel="stylesheet" href="//phyks.me/design.css"/>
7
+        <link type="text/plain" rel="author" href="//phyks.me/humans.txt"/>
8
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
+        <link rel="alternate" type="application/rss+xml" title="RSS" href="//phyks.me/rss.xml" />
10
+    </head>
11
+    <body>
12
+        <div id="wrapper">
13
+            <!-- Sidebar -->
14
+                <aside id="sidebar-wrapper">
15
+                    <header><h1><a href="//phyks.me">~Phyks</a></h1></header>
16
+
17
+                    <h2>Catégories</h2>
18
+                        <nav id="sidebar-tags">
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData OpenData.html">/GeoData OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20
+                        </nav>
21
+
22
+                    <h2>Derniers articles</h2>
23
+                        <ul id="sidebar-articles">
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25
+                        </ul>
26
+
27
+                    <h2>Liens</h2>
28
+                        <ul id="sidebar-links">
29
+                            <li><a href="//phyks.me/contact.html" title="Contact">Me contacter</a></li>
30
+                            <li class="monospace"><a href="//links.phyks.me" title="Mon Shaarli">find ~phyks -type l</a></li>
31
+                            <li><a href="https://github.com/phyks/" rel="me" title="Github">Mon Github</a></li>
32
+                            <li><a href="//phyks.me/divers.html" title="Divers">Divers</a></li>
33
+                        </ul>
34
+                </aside>
35
+
36
+            <!-- Page content -->
37
+                <header id="header">
38
+                    <h1><a href="//phyks.me">~Phyks</a></h1>
39
+                </header>
40
+
41
+                <div id="note_responsive">
42
+                    <p><em>Note</em> : Cliquez sur la bande bleue à gauche pour faire apparaître le menu.</p>
43
+                </div>
44
+
45
+                <div id="articles">
46
+<article>
47
+	<aside>
48
+		<p class="day">13</p>
49
+		<p class="month">Février</p>
50
+	</aside>
51
+	<div class="article">
52
+		<header><h1 class="article_title"><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></h1></header>
53
+		<!-- 
54
+    @author=Phyks
55
+    @date=13022015-1735
56
+    @title=Looking for altitude OpenData
57
+    @tags=GeoData OpenData
58
+-->
59
+
60
+<p>Recently, for a personal project, I looked for opendata for altitude in France. These are not so easy to find, although there are some really good opendata out there, with a very great accuracy. Indeed, <a href="http://www.openstreetmap.org/#map=5/51.500/-0.100">OpenStreetMaps</a> provides really accurate opendata for maps (street names and so on), but absolutely nothing concerning the altitude.</p>
61
+<p>I finally found two datasets available for France, one published by <a href="https://www.data.gouv.fr/fr/datasets/bd-alti-75m/">IGN</a> and the other one being the <a href="http://wiki.openstreetmap.org/wiki/SRTM">SRTM</a> dataset published by the NASA. The one from IGN provides altitude information for the whole French territory, at a resolution of 75m, which is quite good for numerically modeling the terrain. The one from NASA is more complete and provides altitude information for the whole globe surface between -60° and 60° latitude at a resolution of about 90m, obtained by averaging on 30m samples.</p>
62
+<h2>IGN BD ALTI opendata</h2>
63
+<p>First of all, let's have a look at the BD ALTI from IGN, which is not as widely used as the SRTM one (at least in a hobbyist context) and does not have much documentation around there.</p>
64
+<p>IGN provides an archive containing the data for the whole French territory. In the archive, there are several folders. The interesting one, in our case, is <code>1_DONNEES_LIVRAISON_*</code> which contains all the data files.</p>
65
+<p>Altitude data is available in two formats: GeoTiff (Tiff with geolocation metadata) and ASCII Esri grid. I personally used the ASCII Esri Grid files. For more info about this file format, you can refer to <a href="https://en.wikipedia.org/wiki/Esri_grid#ASCII">the Wikipedia page</a>.</p>
66
+<p>Each file starts with some header informations: number of rows and cols (1000), position of the lower-left corner in X and Y coordinates, size of an elementary cell and value used to indicate missing data. The file then contains a matrix representing the values of each cell, as described in the Wikipedia page.</p>
67
+<p>Position on the map is indicated in X and Y coordinates, and not using the standard latitude and longitude coordinates. This is a different projection system, called <a href="https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert">Lambert93</a>, and used for official maps of France. <a href="https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert">Wikipedia</a> contains the relevant information to translate from the standard WGS84 (satellite latitude and longitude coordinates) to the Lambert93 coordinates, and reciprocally but the best way seems to be to use the <a href="http://trac.osgeo.org/proj/">Proj.4 libray</a> which has a <a href="https://pypi.python.org/pypi/pyproj?">Python binding</a> to handle the conversion.</p>
68
+<p>To find a specific point, you should then iterate over the available data files and check if the position of the point is between <code>xllcorner, yllcorner</code> and <code>xllcorner + ncols * cellsize, yllcorner + nrows * cellsize</code>. Then, you just have to get the value of the matching cell in the matrix description in the file.</p>
69
+<p>An example script is available at <a href="https://github.com/Phyks/IGN_OpenData">https://github.com/Phyks/IGN_OpenData</a>. It takes a rectangle defined by two latitudes and longitudes in input, as well as the data folder to process, and will output the relevant data from the BD ALTI dataset, in XYZ file format, which is equivalent to a CSV file with columns X, Y and altitude (Z), separated by tabulations, and sorted. This is also an example use of the Proj.4 Python binding to handle basic coordinates system transforms.</p>
70
+<h2>SRTM opendata</h2>
71
+<p>The SRTM dataset exists in multiple versions and different samplings. Have a look at <a href="https://github.com/Phyks/IGN_OpenData">this wiki page</a> to have more information about it. I was interested in SRTMGL3 version 3, which is the third iteration of the dataset sampled at 3 arcseconds (which is about 90m). It is available at <a href="this address">http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/</a> (before clicking the main folder in this address, please note that this is very heavy and long to process as it contains all the files for the whole world). <a href="">rv</a> uses it and provides a basic import script to a PostgreSQL database, available <a href="https://gitlab.crans.org/leger/rv/blob/master/height/populate_height_table.cc">here</a>.</p>
72
+<p>All files are named with a convention to describe the tile they represent. For instance, the tile starting at 0° North and 6° East is called <code>N00E006.*</code>.</p>
73
+<p>There is a really nice <a href="https://gis.stackexchange.com/questions/43743/how-to-extract-elevation-from-hgt-file">StackOverflow post</a> to explain how to handle these files and the following will almost be a rewriting of this post.</p>
74
+<p>First of all, take the integer part of the position you want (latitude and longitude), and look for the corresponding file at the previous address. You will download a (zipped) hgt file containing the altitude data. This file is a big-endian binary file that you will have to parse.</p>
75
+<p>First, you have to find the pixels coordinates representing your geographic point. To this purpose, you have to take the floating part of the latitude and longitude of the point you want and convert them to arcseconds (e.g. for 50° 24' 58.888", you will have 24 * 60 + 58.888 = 1498.888). As the sampling is done at 3 arcseconds, the pixel coordinates are given by the closest integer to the latitude (resp. longitude) of your point, expressed in arcseconds, divided by 3. Latitude will give you the row index, whereas longitude will give you the col index.</p>
76
+<p>The first row in the file is the northernmost one, so if we are looking at row 500 from the lower edge, we actually have to look at row 1201 - 500 from the beginning of the files (1200 being 3600&nbsp;/ 3, the total number of rows in the data file).</p>
77
+<p>We then have to iterate on cols to find the correct one, using the same principle.</p>
78
+<p>An example script is available <a href="https://github.com/Phyks/IGN_OpenData/blob/master/srtm_alti.py">here</a> although it was not thoroughly tested. If you fix any problem with it, please report&nbsp;:) </p>
79
+		<footer><p class="date">Le 13/02/2015 à 17:35</p>
80
+		<p class="tags">Tags : <a href="//phyks.me/tags/GeoData OpenData.html">GeoData OpenData</a></p></footer>
81
+	</div>
82
+</article>
83
+            </div>
84
+            <footer id="rss">
85
+                <p><a href="//phyks.me/rss.xml"><img src="//phyks.me/img/rss.png" alt="RSS"/></a></p>
86
+            </footer>
87
+        </div>
88
+    </body>
89
+</html>

+ 89
- 0
blog/tags/GeoData.html View File

@@ -0,0 +1,89 @@
1
+<!DOCTYPE html>
2
+<html lang="fr">
3
+    <head>
4
+        <meta charset="utf-8">
5
+        <title>Phyks' blog - tags/GeoData</title>
6
+		<link rel="stylesheet" href="//phyks.me/design.css"/>
7
+        <link type="text/plain" rel="author" href="//phyks.me/humans.txt"/>
8
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
+        <link rel="alternate" type="application/rss+xml" title="RSS" href="//phyks.me/rss.xml" />
10
+    </head>
11
+    <body>
12
+        <div id="wrapper">
13
+            <!-- Sidebar -->
14
+                <aside id="sidebar-wrapper">
15
+                    <header><h1><a href="//phyks.me">~Phyks</a></h1></header>
16
+
17
+                    <h2>Catégories</h2>
18
+                        <nav id="sidebar-tags">
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20
+                        </nav>
21
+
22
+                    <h2>Derniers articles</h2>
23
+                        <ul id="sidebar-articles">
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25
+                        </ul>
26
+
27
+                    <h2>Liens</h2>
28
+                        <ul id="sidebar-links">
29
+                            <li><a href="//phyks.me/contact.html" title="Contact">Me contacter</a></li>
30
+                            <li class="monospace"><a href="//links.phyks.me" title="Mon Shaarli">find ~phyks -type l</a></li>
31
+                            <li><a href="https://github.com/phyks/" rel="me" title="Github">Mon Github</a></li>
32
+                            <li><a href="//phyks.me/divers.html" title="Divers">Divers</a></li>
33
+                        </ul>
34
+                </aside>
35
+
36
+            <!-- Page content -->
37
+                <header id="header">
38
+                    <h1><a href="//phyks.me">~Phyks</a></h1>
39
+                </header>
40
+
41
+                <div id="note_responsive">
42
+                    <p><em>Note</em> : Cliquez sur la bande bleue à gauche pour faire apparaître le menu.</p>
43
+                </div>
44
+
45
+                <div id="articles">
46
+<article>
47
+	<aside>
48
+		<p class="day">13</p>
49
+		<p class="month">Février</p>
50
+	</aside>
51
+	<div class="article">
52
+		<header><h1 class="article_title"><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></h1></header>
53
+		<!-- 
54
+    @author=Phyks
55
+    @date=13022015-1735
56
+    @title=Looking for altitude OpenData
57
+    @tags=GeoData, OpenData
58
+-->
59
+
60
+<p>Recently, for a personal project, I looked for opendata for altitude in France. These are not so easy to find, although there are some really good opendata out there, with a very great accuracy. Indeed, <a href="http://www.openstreetmap.org/#map=5/51.500/-0.100">OpenStreetMaps</a> provides really accurate opendata for maps (street names and so on), but absolutely nothing concerning the altitude.</p>
61
+<p>I finally found two datasets available for France, one published by <a href="https://www.data.gouv.fr/fr/datasets/bd-alti-75m/">IGN</a> and the other one being the <a href="http://wiki.openstreetmap.org/wiki/SRTM">SRTM</a> dataset published by the NASA. The one from IGN provides altitude information for the whole French territory, at a resolution of 75m, which is quite good for numerically modeling the terrain. The one from NASA is more complete and provides altitude information for the whole globe surface between -60° and 60° latitude at a resolution of about 90m, obtained by averaging on 30m samples.</p>
62
+<h2>IGN BD ALTI opendata</h2>
63
+<p>First of all, let's have a look at the BD ALTI from IGN, which is not as widely used as the SRTM one (at least in a hobbyist context) and does not have much documentation around there.</p>
64
+<p>IGN provides an archive containing the data for the whole French territory. In the archive, there are several folders. The interesting one, in our case, is <code>1_DONNEES_LIVRAISON_*</code> which contains all the data files.</p>
65
+<p>Altitude data is available in two formats: GeoTiff (Tiff with geolocation metadata) and ASCII Esri grid. I personally used the ASCII Esri Grid files. For more info about this file format, you can refer to <a href="https://en.wikipedia.org/wiki/Esri_grid#ASCII">the Wikipedia page</a>.</p>
66
+<p>Each file starts with some header informations: number of rows and cols (1000), position of the lower-left corner in X and Y coordinates, size of an elementary cell and value used to indicate missing data. The file then contains a matrix representing the values of each cell, as described in the Wikipedia page.</p>
67
+<p>Position on the map is indicated in X and Y coordinates, and not using the standard latitude and longitude coordinates. This is a different projection system, called <a href="https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert">Lambert93</a>, and used for official maps of France. <a href="https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert">Wikipedia</a> contains the relevant information to translate from the standard WGS84 (satellite latitude and longitude coordinates) to the Lambert93 coordinates, and reciprocally but the best way seems to be to use the <a href="http://trac.osgeo.org/proj/">Proj.4 libray</a> which has a <a href="https://pypi.python.org/pypi/pyproj?">Python binding</a> to handle the conversion.</p>
68
+<p>To find a specific point, you should then iterate over the available data files and check if the position of the point is between <code>xllcorner, yllcorner</code> and <code>xllcorner + ncols * cellsize, yllcorner + nrows * cellsize</code>. Then, you just have to get the value of the matching cell in the matrix description in the file.</p>
69
+<p>An example script is available at <a href="https://github.com/Phyks/IGN_OpenData">https://github.com/Phyks/IGN_OpenData</a>. It takes a rectangle defined by two latitudes and longitudes in input, as well as the data folder to process, and will output the relevant data from the BD ALTI dataset, in XYZ file format, which is equivalent to a CSV file with columns X, Y and altitude (Z), separated by tabulations, and sorted. This is also an example use of the Proj.4 Python binding to handle basic coordinates system transforms.</p>
70
+<h2>SRTM opendata</h2>
71
+<p>The SRTM dataset exists in multiple versions and different samplings. Have a look at <a href="https://github.com/Phyks/IGN_OpenData">this wiki page</a> to have more information about it. I was interested in SRTMGL3 version 3, which is the third iteration of the dataset sampled at 3 arcseconds (which is about 90m). It is available at <a href="this address">http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/</a> (before clicking the main folder in this address, please note that this is very heavy and long to process as it contains all the files for the whole world). <a href="">rv</a> uses it and provides a basic import script to a PostgreSQL database, available <a href="https://gitlab.crans.org/leger/rv/blob/master/height/populate_height_table.cc">here</a>.</p>
72
+<p>All files are named with a convention to describe the tile they represent. For instance, the tile starting at 0° North and 6° East is called <code>N00E006.*</code>.</p>
73
+<p>There is a really nice <a href="https://gis.stackexchange.com/questions/43743/how-to-extract-elevation-from-hgt-file">StackOverflow post</a> to explain how to handle these files and the following will almost be a rewriting of this post.</p>
74
+<p>First of all, take the integer part of the position you want (latitude and longitude), and look for the corresponding file at the previous address. You will download a (zipped) hgt file containing the altitude data. This file is a big-endian binary file that you will have to parse.</p>
75
+<p>First, you have to find the pixels coordinates representing your geographic point. To this purpose, you have to take the floating part of the latitude and longitude of the point you want and convert them to arcseconds (e.g. for 50° 24' 58.888", you will have 24 * 60 + 58.888 = 1498.888). As the sampling is done at 3 arcseconds, the pixel coordinates are given by the closest integer to the latitude (resp. longitude) of your point, expressed in arcseconds, divided by 3. Latitude will give you the row index, whereas longitude will give you the col index.</p>
76
+<p>The first row in the file is the northernmost one, so if we are looking at row 500 from the lower edge, we actually have to look at row 1201 - 500 from the beginning of the files (1200 being 3600&nbsp;/ 3, the total number of rows in the data file).</p>
77
+<p>We then have to iterate on cols to find the correct one, using the same principle.</p>
78
+<p>An example script is available <a href="https://github.com/Phyks/IGN_OpenData/blob/master/srtm_alti.py">here</a> although it was not thoroughly tested. If you fix any problem with it, please report&nbsp;:) </p>
79
+		<footer><p class="date">Le 13/02/2015 à 17:35</p>
80
+		<p class="tags">Tags : <a href="//phyks.me/tags/GeoData.html">GeoData</a>, <a href="//phyks.me/tags/OpenData.html">OpenData</a></p></footer>
81
+	</div>
82
+</article>
83
+            </div>
84
+            <footer id="rss">
85
+                <p><a href="//phyks.me/rss.xml"><img src="//phyks.me/img/rss.png" alt="RSS"/></a></p>
86
+            </footer>
87
+        </div>
88
+    </body>
89
+</html>

+ 2
- 2
blog/tags/Known.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/Libre.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/Linux.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 89
- 0
blog/tags/OpenData.html View File

@@ -0,0 +1,89 @@
1
+<!DOCTYPE html>
2
+<html lang="fr">
3
+    <head>
4
+        <meta charset="utf-8">
5
+        <title>Phyks' blog - tags/OpenData</title>
6
+		<link rel="stylesheet" href="//phyks.me/design.css"/>
7
+        <link type="text/plain" rel="author" href="//phyks.me/humans.txt"/>
8
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
+        <link rel="alternate" type="application/rss+xml" title="RSS" href="//phyks.me/rss.xml" />
10
+    </head>
11
+    <body>
12
+        <div id="wrapper">
13
+            <!-- Sidebar -->
14
+                <aside id="sidebar-wrapper">
15
+                    <header><h1><a href="//phyks.me">~Phyks</a></h1></header>
16
+
17
+                    <h2>Catégories</h2>
18
+                        <nav id="sidebar-tags">
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20
+                        </nav>
21
+
22
+                    <h2>Derniers articles</h2>
23
+                        <ul id="sidebar-articles">
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25
+                        </ul>
26
+
27
+                    <h2>Liens</h2>
28
+                        <ul id="sidebar-links">
29
+                            <li><a href="//phyks.me/contact.html" title="Contact">Me contacter</a></li>
30
+                            <li class="monospace"><a href="//links.phyks.me" title="Mon Shaarli">find ~phyks -type l</a></li>
31
+                            <li><a href="https://github.com/phyks/" rel="me" title="Github">Mon Github</a></li>
32
+                            <li><a href="//phyks.me/divers.html" title="Divers">Divers</a></li>
33
+                        </ul>
34
+                </aside>
35
+
36
+            <!-- Page content -->
37
+                <header id="header">
38
+                    <h1><a href="//phyks.me">~Phyks</a></h1>
39
+                </header>
40
+
41
+                <div id="note_responsive">
42
+                    <p><em>Note</em> : Cliquez sur la bande bleue à gauche pour faire apparaître le menu.</p>
43
+                </div>
44
+
45
+                <div id="articles">
46
+<article>
47
+	<aside>
48
+		<p class="day">13</p>
49
+		<p class="month">Février</p>
50
+	</aside>
51
+	<div class="article">
52
+		<header><h1 class="article_title"><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></h1></header>
53
+		<!-- 
54
+    @author=Phyks
55
+    @date=13022015-1735
56
+    @title=Looking for altitude OpenData
57
+    @tags=GeoData, OpenData
58
+-->
59
+
60
+<p>Recently, for a personal project, I looked for opendata for altitude in France. These are not so easy to find, although there are some really good opendata out there, with a very great accuracy. Indeed, <a href="http://www.openstreetmap.org/#map=5/51.500/-0.100">OpenStreetMaps</a> provides really accurate opendata for maps (street names and so on), but absolutely nothing concerning the altitude.</p>
61
+<p>I finally found two datasets available for France, one published by <a href="https://www.data.gouv.fr/fr/datasets/bd-alti-75m/">IGN</a> and the other one being the <a href="http://wiki.openstreetmap.org/wiki/SRTM">SRTM</a> dataset published by the NASA. The one from IGN provides altitude information for the whole French territory, at a resolution of 75m, which is quite good for numerically modeling the terrain. The one from NASA is more complete and provides altitude information for the whole globe surface between -60° and 60° latitude at a resolution of about 90m, obtained by averaging on 30m samples.</p>
62
+<h2>IGN BD ALTI opendata</h2>
63
+<p>First of all, let's have a look at the BD ALTI from IGN, which is not as widely used as the SRTM one (at least in a hobbyist context) and does not have much documentation around there.</p>
64
+<p>IGN provides an archive containing the data for the whole French territory. In the archive, there are several folders. The interesting one, in our case, is <code>1_DONNEES_LIVRAISON_*</code> which contains all the data files.</p>
65
+<p>Altitude data is available in two formats: GeoTiff (Tiff with geolocation metadata) and ASCII Esri grid. I personally used the ASCII Esri Grid files. For more info about this file format, you can refer to <a href="https://en.wikipedia.org/wiki/Esri_grid#ASCII">the Wikipedia page</a>.</p>
66
+<p>Each file starts with some header informations: number of rows and cols (1000), position of the lower-left corner in X and Y coordinates, size of an elementary cell and value used to indicate missing data. The file then contains a matrix representing the values of each cell, as described in the Wikipedia page.</p>
67
+<p>Position on the map is indicated in X and Y coordinates, and not using the standard latitude and longitude coordinates. This is a different projection system, called <a href="https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert">Lambert93</a>, and used for official maps of France. <a href="https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert">Wikipedia</a> contains the relevant information to translate from the standard WGS84 (satellite latitude and longitude coordinates) to the Lambert93 coordinates, and reciprocally but the best way seems to be to use the <a href="http://trac.osgeo.org/proj/">Proj.4 libray</a> which has a <a href="https://pypi.python.org/pypi/pyproj?">Python binding</a> to handle the conversion.</p>
68
+<p>To find a specific point, you should then iterate over the available data files and check if the position of the point is between <code>xllcorner, yllcorner</code> and <code>xllcorner + ncols * cellsize, yllcorner + nrows * cellsize</code>. Then, you just have to get the value of the matching cell in the matrix description in the file.</p>
69
+<p>An example script is available at <a href="https://github.com/Phyks/IGN_OpenData">https://github.com/Phyks/IGN_OpenData</a>. It takes a rectangle defined by two latitudes and longitudes in input, as well as the data folder to process, and will output the relevant data from the BD ALTI dataset, in XYZ file format, which is equivalent to a CSV file with columns X, Y and altitude (Z), separated by tabulations, and sorted. This is also an example use of the Proj.4 Python binding to handle basic coordinates system transforms.</p>
70
+<h2>SRTM opendata</h2>
71
+<p>The SRTM dataset exists in multiple versions and different samplings. Have a look at <a href="https://github.com/Phyks/IGN_OpenData">this wiki page</a> to have more information about it. I was interested in SRTMGL3 version 3, which is the third iteration of the dataset sampled at 3 arcseconds (which is about 90m). It is available at <a href="this address">http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/</a> (before clicking the main folder in this address, please note that this is very heavy and long to process as it contains all the files for the whole world). <a href="">rv</a> uses it and provides a basic import script to a PostgreSQL database, available <a href="https://gitlab.crans.org/leger/rv/blob/master/height/populate_height_table.cc">here</a>.</p>
72
+<p>All files are named with a convention to describe the tile they represent. For instance, the tile starting at 0° North and 6° East is called <code>N00E006.*</code>.</p>
73
+<p>There is a really nice <a href="https://gis.stackexchange.com/questions/43743/how-to-extract-elevation-from-hgt-file">StackOverflow post</a> to explain how to handle these files and the following will almost be a rewriting of this post.</p>
74
+<p>First of all, take the integer part of the position you want (latitude and longitude), and look for the corresponding file at the previous address. You will download a (zipped) hgt file containing the altitude data. This file is a big-endian binary file that you will have to parse.</p>
75
+<p>First, you have to find the pixels coordinates representing your geographic point. To this purpose, you have to take the floating part of the latitude and longitude of the point you want and convert them to arcseconds (e.g. for 50° 24' 58.888", you will have 24 * 60 + 58.888 = 1498.888). As the sampling is done at 3 arcseconds, the pixel coordinates are given by the closest integer to the latitude (resp. longitude) of your point, expressed in arcseconds, divided by 3. Latitude will give you the row index, whereas longitude will give you the col index.</p>
76
+<p>The first row in the file is the northernmost one, so if we are looking at row 500 from the lower edge, we actually have to look at row 1201 - 500 from the beginning of the files (1200 being 3600&nbsp;/ 3, the total number of rows in the data file).</p>
77
+<p>We then have to iterate on cols to find the correct one, using the same principle.</p>
78
+<p>An example script is available <a href="https://github.com/Phyks/IGN_OpenData/blob/master/srtm_alti.py">here</a> although it was not thoroughly tested. If you fix any problem with it, please report&nbsp;:) </p>
79
+		<footer><p class="date">Le 13/02/2015 à 17:35</p>
80
+		<p class="tags">Tags : <a href="//phyks.me/tags/GeoData.html">GeoData</a>, <a href="//phyks.me/tags/OpenData.html">OpenData</a></p></footer>
81
+	</div>
82
+</article>
83
+            </div>
84
+            <footer id="rss">
85
+                <p><a href="//phyks.me/rss.xml"><img src="//phyks.me/img/rss.png" alt="RSS"/></a></p>
86
+            </footer>
87
+        </div>
88
+    </body>
89
+</html>

+ 2
- 2
blog/tags/Phyks.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/Smartphone.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/Vim.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/Web.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/Weechat.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 2
- 2
blog/tags/Électronique.html View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 37
- 0
gen/2015/02/opendata_altimetry.gen View File

@@ -0,0 +1,37 @@
1
+<article>
2
+	<aside>
3
+		<p class="day">13</p>
4
+		<p class="month">Février</p>
5
+	</aside>
6
+	<div class="article">
7
+		<header><h1 class="article_title"><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></h1></header>
8
+		<!-- 
9
+    @author=Phyks
10
+    @date=13022015-1735
11
+    @title=Looking for altitude OpenData
12
+    @tags=GeoData, OpenData
13
+-->
14
+
15
+<p>Recently, for a personal project, I looked for opendata for altitude in France. These are not so easy to find, although there are some really good opendata out there, with a very great accuracy. Indeed, <a href="http://www.openstreetmap.org/#map=5/51.500/-0.100">OpenStreetMaps</a> provides really accurate opendata for maps (street names and so on), but absolutely nothing concerning the altitude.</p>
16
+<p>I finally found two datasets available for France, one published by <a href="https://www.data.gouv.fr/fr/datasets/bd-alti-75m/">IGN</a> and the other one being the <a href="http://wiki.openstreetmap.org/wiki/SRTM">SRTM</a> dataset published by the NASA. The one from IGN provides altitude information for the whole French territory, at a resolution of 75m, which is quite good for numerically modeling the terrain. The one from NASA is more complete and provides altitude information for the whole globe surface between -60° and 60° latitude at a resolution of about 90m, obtained by averaging on 30m samples.</p>
17
+<h2>IGN BD ALTI opendata</h2>
18
+<p>First of all, let's have a look at the BD ALTI from IGN, which is not as widely used as the SRTM one (at least in a hobbyist context) and does not have much documentation around there.</p>
19
+<p>IGN provides an archive containing the data for the whole French territory. In the archive, there are several folders. The interesting one, in our case, is <code>1_DONNEES_LIVRAISON_*</code> which contains all the data files.</p>
20
+<p>Altitude data is available in two formats: GeoTiff (Tiff with geolocation metadata) and ASCII Esri grid. I personally used the ASCII Esri Grid files. For more info about this file format, you can refer to <a href="https://en.wikipedia.org/wiki/Esri_grid#ASCII">the Wikipedia page</a>.</p>
21
+<p>Each file starts with some header informations: number of rows and cols (1000), position of the lower-left corner in X and Y coordinates, size of an elementary cell and value used to indicate missing data. The file then contains a matrix representing the values of each cell, as described in the Wikipedia page.</p>
22
+<p>Position on the map is indicated in X and Y coordinates, and not using the standard latitude and longitude coordinates. This is a different projection system, called <a href="https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert">Lambert93</a>, and used for official maps of France. <a href="https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert">Wikipedia</a> contains the relevant information to translate from the standard WGS84 (satellite latitude and longitude coordinates) to the Lambert93 coordinates, and reciprocally but the best way seems to be to use the <a href="http://trac.osgeo.org/proj/">Proj.4 libray</a> which has a <a href="https://pypi.python.org/pypi/pyproj?">Python binding</a> to handle the conversion.</p>
23
+<p>To find a specific point, you should then iterate over the available data files and check if the position of the point is between <code>xllcorner, yllcorner</code> and <code>xllcorner + ncols * cellsize, yllcorner + nrows * cellsize</code>. Then, you just have to get the value of the matching cell in the matrix description in the file.</p>
24
+<p>An example script is available at <a href="https://github.com/Phyks/IGN_OpenData">https://github.com/Phyks/IGN_OpenData</a>. It takes a rectangle defined by two latitudes and longitudes in input, as well as the data folder to process, and will output the relevant data from the BD ALTI dataset, in XYZ file format, which is equivalent to a CSV file with columns X, Y and altitude (Z), separated by tabulations, and sorted. This is also an example use of the Proj.4 Python binding to handle basic coordinates system transforms.</p>
25
+<h2>SRTM opendata</h2>
26
+<p>The SRTM dataset exists in multiple versions and different samplings. Have a look at <a href="https://github.com/Phyks/IGN_OpenData">this wiki page</a> to have more information about it. I was interested in SRTMGL3 version 3, which is the third iteration of the dataset sampled at 3 arcseconds (which is about 90m). It is available at <a href="this address">http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/</a> (before clicking the main folder in this address, please note that this is very heavy and long to process as it contains all the files for the whole world). <a href="">rv</a> uses it and provides a basic import script to a PostgreSQL database, available <a href="https://gitlab.crans.org/leger/rv/blob/master/height/populate_height_table.cc">here</a>.</p>
27
+<p>All files are named with a convention to describe the tile they represent. For instance, the tile starting at 0° North and 6° East is called <code>N00E006.*</code>.</p>
28
+<p>There is a really nice <a href="https://gis.stackexchange.com/questions/43743/how-to-extract-elevation-from-hgt-file">StackOverflow post</a> to explain how to handle these files and the following will almost be a rewriting of this post.</p>
29
+<p>First of all, take the integer part of the position you want (latitude and longitude), and look for the corresponding file at the previous address. You will download a (zipped) hgt file containing the altitude data. This file is a big-endian binary file that you will have to parse.</p>
30
+<p>First, you have to find the pixels coordinates representing your geographic point. To this purpose, you have to take the floating part of the latitude and longitude of the point you want and convert them to arcseconds (e.g. for 50° 24' 58.888", you will have 24 * 60 + 58.888 = 1498.888). As the sampling is done at 3 arcseconds, the pixel coordinates are given by the closest integer to the latitude (resp. longitude) of your point, expressed in arcseconds, divided by 3. Latitude will give you the row index, whereas longitude will give you the col index.</p>
31
+<p>The first row in the file is the northernmost one, so if we are looking at row 500 from the lower edge, we actually have to look at row 1201 - 500 from the beginning of the files (1200 being 3600&nbsp;/ 3, the total number of rows in the data file).</p>
32
+<p>We then have to iterate on cols to find the correct one, using the same principle.</p>
33
+<p>An example script is available <a href="https://github.com/Phyks/IGN_OpenData/blob/master/srtm_alti.py">here</a> although it was not thoroughly tested. If you fix any problem with it, please report&nbsp;:) </p>
34
+		<footer><p class="date">Le 13/02/2015 à 17:35</p>
35
+		<p class="tags">Tags : <a href="//phyks.me/tags/GeoData.html">GeoData</a>, <a href="//phyks.me/tags/OpenData.html">OpenData</a></p></footer>
36
+	</div>
37
+</article>

+ 2
- 2
gen/header.gen View File

@@ -16,12 +16,12 @@
16 16
 
17 17
                     <h2>Catégories</h2>
18 18
                         <nav id="sidebar-tags">
19
-                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
19
+                            <div class="tag"><a href="//phyks.me/tags/Arch.html">/Arch (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Autohébergement.html">/Autohébergement (48)</a> </div><div class="tag"><a href="//phyks.me/tags/Dev.html">/Dev (128)</a> </div><div class="tag"><a href="//phyks.me/tags/DIY.html">/DIY (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Électronique.html">/Électronique (32)</a> </div><div class="tag"><a href="//phyks.me/tags/GeoData.html">/GeoData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Known.html">/Known (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Libre.html">/Libre (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Linux.html">/Linux (96)</a> </div><div class="tag"><a href="//phyks.me/tags/OpenData.html">/OpenData (1)</a> </div><div class="tag"><a href="//phyks.me/tags/Phyks.html">/Phyks (3)</a> </div><div class="tag"><a href="//phyks.me/tags/Smartphone.html">/Smartphone (32)</a> </div><div class="tag"><a href="//phyks.me/tags/Vim.html">/Vim (16)</a> </div><div class="tag"><a href="//phyks.me/tags/Web.html">/Web (112)</a> </div><div class="tag"><a href="//phyks.me/tags/Weechat.html">/Weechat (32)</a> </div>
20 20
                         </nav>
21 21
 
22 22
                     <h2>Derniers articles</h2>
23 23
                         <ul id="sidebar-articles">
24
-                            <li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/2015/01/known.html">Thoughts on blogging engine</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
24
+                            <li><a href="//phyks.me/2015/02/opendata_altimetry.html">Looking for altitude OpenData</a></li><li><a href="//phyks.me/2015/01/moving_known.html">Passage à Known</a></li><li><a href="//phyks.me/2015/01/firefox_sync_15.html">Self-hosting Firefox sync 1.5</a></li><li><a href="//phyks.me/2015/01/lenovo_t440.html">Personal review of the Lenovo Thinkpad T440</a></li><li><a href="//phyks.me/2015/01/known_api.html">Publishing through the Known API</a></li><li><a href="//phyks.me/archives.html">Archives</a></li>
25 25
                         </ul>
26 26
 
27 27
                     <h2>Liens</h2>

+ 1
- 0
gen/tags/GeoData OpenData.tmp View File

@@ -0,0 +1 @@
1
+2015/02/opendata_altimetry.md

+ 1
- 0
gen/tags/GeoData.tmp View File

@@ -0,0 +1 @@
1
+2015/02/opendata_altimetry.md

+ 1
- 0
gen/tags/OpenData.tmp View File

@@ -0,0 +1 @@
1
+2015/02/opendata_altimetry.md

+ 46
- 0
raw/2015/02/opendata_altimetry.md View File

@@ -0,0 +1,46 @@
1
+<!--
2
+	@author=Phyks
3
+	@date=13022015-1735
4
+	@title=Looking for altitude OpenData
5
+	@tags=GeoData, OpenData
6
+-->
7
+
8
+Recently, for a personal project, I looked for opendata for altitude in France. These are not so easy to find, although there are some really good opendata out there, with a very great accuracy. Indeed, [OpenStreetMaps](http://www.openstreetmap.org/#map=5/51.500/-0.100) provides really accurate opendata for maps (street names and so on), but absolutely nothing concerning the altitude.
9
+
10
+I finally found two datasets available for France, one published by [IGN](https://www.data.gouv.fr/fr/datasets/bd-alti-75m/) and the other one being the [SRTM](http://wiki.openstreetmap.org/wiki/SRTM) dataset published by the NASA. The one from IGN provides altitude information for the whole French territory, at a resolution of 75m, which is quite good for numerically modeling the terrain. The one from NASA is more complete and provides altitude information for the whole globe surface between -60° and 60° latitude at a resolution of about 90m, obtained by averaging on 30m samples.
11
+
12
+
13
+## IGN BD ALTI opendata
14
+
15
+First of all, let's have a look at the BD ALTI from IGN, which is not as widely used as the SRTM one (at least in a hobbyist context) and does not have much documentation around there.
16
+
17
+IGN provides an archive containing the data for the whole French territory. In the archive, there are several folders. The interesting one, in our case, is `1_DONNEES_LIVRAISON_*` which contains all the data files.
18
+
19
+Altitude data is available in two formats: GeoTiff (Tiff with geolocation metadata) and ASCII Esri grid. I personally used the ASCII Esri Grid files. For more info about this file format, you can refer to [the Wikipedia page](https://en.wikipedia.org/wiki/Esri_grid#ASCII).
20
+
21
+Each file starts with some header informations: number of rows and cols (1000), position of the lower-left corner in X and Y coordinates, size of an elementary cell and value used to indicate missing data. The file then contains a matrix representing the values of each cell, as described in the Wikipedia page.
22
+
23
+Position on the map is indicated in X and Y coordinates, and not using the standard latitude and longitude coordinates. This is a different projection system, called [Lambert93](https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert), and used for official maps of France. [Wikipedia](https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert) contains the relevant information to translate from the standard WGS84 (satellite latitude and longitude coordinates) to the Lambert93 coordinates, and reciprocally but the best way seems to be to use the [Proj.4 libray](http://trac.osgeo.org/proj/) which has a [Python binding](https://pypi.python.org/pypi/pyproj?) to handle the conversion.
24
+
25
+To find a specific point, you should then iterate over the available data files and check if the position of the point is between `xllcorner, yllcorner` and `xllcorner + ncols * cellsize, yllcorner + nrows * cellsize`. Then, you just have to get the value of the matching cell in the matrix description in the file.
26
+
27
+An example script is available at [https://github.com/Phyks/IGN_OpenData](https://github.com/Phyks/IGN_OpenData). It takes a rectangle defined by two latitudes and longitudes in input, as well as the data folder to process, and will output the relevant data from the BD ALTI dataset, in XYZ file format, which is equivalent to a CSV file with columns X, Y and altitude (Z), separated by tabulations, and sorted. This is also an example use of the Proj.4 Python binding to handle basic coordinates system transforms.
28
+
29
+
30
+## SRTM opendata
31
+
32
+The SRTM dataset exists in multiple versions and different samplings. Have a look at [this wiki page](https://github.com/Phyks/IGN_OpenData) to have more information about it. I was interested in SRTMGL3 version 3, which is the third iteration of the dataset sampled at 3 arcseconds (which is about 90m). It is available at [http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/](this address) (before clicking the main folder in this address, please note that this is very heavy and long to process as it contains all the files for the whole world). [rv]() uses it and provides a basic import script to a PostgreSQL database, available [here](https://gitlab.crans.org/leger/rv/blob/master/height/populate_height_table.cc).
33
+
34
+All files are named with a convention to describe the tile they represent. For instance, the tile starting at 0° North and 6° East is called `N00E006.*`.
35
+
36
+There is a really nice [StackOverflow post](https://gis.stackexchange.com/questions/43743/how-to-extract-elevation-from-hgt-file) to explain how to handle these files and the following will almost be a rewriting of this post.
37
+
38
+First of all, take the integer part of the position you want (latitude and longitude), and look for the corresponding file at the previous address. You will download a (zipped) hgt file containing the altitude data. This file is a big-endian binary file that you will have to parse.
39
+
40
+First, you have to find the pixels coordinates representing your geographic point. To this purpose, you have to take the floating part of the latitude and longitude of the point you want and convert them to arcseconds (e.g. for 50° 24' 58.888", you will have 24 * 60 + 58.888 = 1498.888). As the sampling is done at 3 arcseconds, the pixel coordinates are given by the closest integer to the latitude (resp. longitude) of your point, expressed in arcseconds, divided by 3. Latitude will give you the row index, whereas longitude will give you the col index.
41
+
42
+The first row in the file is the northernmost one, so if we are looking at row 500 from the lower edge, we actually have to look at row 1201 - 500 from the beginning of the files (1200 being 3600 / 3, the total number of rows in the data file).
43
+
44
+We then have to iterate on cols to find the correct one, using the same principle.
45
+
46
+An example script is available [here](https://github.com/Phyks/IGN_OpenData/blob/master/srtm_alti.py) although it was not thoroughly tested. If you fix any problem with it, please report :)