title: Converting geographic coordinates from GEOSTAT to lat and lng
body: <p>I've found an interesting <a href="https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/population-distribution-demography/geostat" rel="nofollow noreferrer">datasource of European Population</a> which I think could help me in achieving such a map:</p>
  
  <p><a href="https://i.stack.imgur.com/xZ0WE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xZ0WE.png" alt="enter image description here"></a></p>
  
  <p>The source document <code>GEOSTAT_grid_POP_1K_2011_V2_0_1.csv</code> looks like this:</p>
  
  <p><code>| TOT_P | GRD_ID        | CNTR_CODE | METHD_CL | YEAR | DATA_SRC | TOT_P_CON_DT | 
  |-------|---------------|-----------|----------|------|----------|--------------| 
  | 8     | 1kmN2689E4337 | DE        | A        | 2011 | DE       | other        | 
  | 7     | 1kmN2689E4341 | DE        | A        | 2011 | DE       | other        |</code></p>
  
  <p>Geographic coordinates look to be coded in the <code>GRD_ID</code> column this document indicates <a href="https://ec.europa.eu/eurostat/cros/sites/crosportal/files/Appendix1_WP1C_production-procedures-bottom-up.pdf" rel="nofollow noreferrer">Appendix1_WP1C_production-procedures-bottom-up.pdf</a>:</p>
  
  <blockquote>
    <p>Grid cell identification codes are based on grid cell’s lower left-hand corner coordinates truncated by grid
    cell size (e.g. 1kmN4534E5066 is result from coordinates Y=4534672, X=5066332 and the cell size 1000) </p>
  </blockquote>
  
  <p>I thought I could get lat and long by parsing the strings. For example in Python:</p>
  
  <pre><code>import re
  string = "1kmN2691E4341"
  lat = float(re.sub('.*N([0-9]+)[EW].*', '\\1', string))/100
  lng = float(re.sub('.*[EW]([0-9]+)', '\\1', string))/100
  
  print lat, ",", lng
  </code></pre>
  
  <blockquote>
    <p>Output 26.91 , 43.41</p>
  </blockquote>
  
  <p>but it makes no sense, it does not correspond to a location in Europe !</p>
  
  <p>It may be that it refers to a geographic coordinate system I'm not aware of.</p>