title: How to properly triangulate GSM cell towers to get a location?
body: <p>First of all, I am trying to do all this disaster in c# (.net 4) so if you come up with some code to help me that would be appreciated but really anything would help at this point.</p>
  
  <p>I have a situation where I have a device that can only get GSM Cell information (incidentally via the <code>AT+KCELL</code> command) so I have a collection of values about cell towers (each has LAC, MCC, MNC, Cell ID, Signal Strength and the first Timing Advance).  I think, therefore, I am in a good place to be able to come up with some sort of longitude and latitude coordinate (albeit inaccurate, but, well meh).  This is where I am reaching out for help because now my little brain is confused...</p>
  
  <p>I can see various services that provide cell code resolution (Google, Open Cell ID, etc) and they take LAC,MCC etc as arguments and return a coordinate.  I figure that what they return would, therefore, be the coordinate of the given tower I pass in.  So in my case I could send off all the LACs etc that I have and get back a collection of longitude and latitudes.  Brilliant, but that is not where my device is.  Now I think I need to do some kind of triangulation and this is where my lack of knowledge is hurting me.  </p>
  
  <p>So am I right so far?  Assuming I am, how do I perform this calculation (is there something out there that will tell me what to do with all these numbers or, even better, some open source library I can reference and feed all this stuff into to get something sensible)?</p>
  
  <p>I'm assuming that I would need to use the timing advance to work out some approximate distance from a cell tower (maybe using the signal strength somehow) but what do I have to do?  As you can tell - I am way out of my depth here!</p>
  
  <p>For example, this is something I might get back from the aforementioned AT command:</p>
  
  <pre><code>5,74,33,32f210,157e,8101,50,0,79,3,32f210,157e,80f7,37,64,5,32f210,157e,810b,37,55,32,32f210,157e,9d3,27,41,33,32f210,157e,edf8,15
  </code></pre>
  
  <p>breaking it up and parsing it I would get (I hope I parse this right - there is a chance there is a bug in my parsing routine of course but it looks reasonable):</p>
  
  <pre><code>Number of cells: 5
  </code></pre>
  
  <p><strong>Cell 1</strong></p>
  
  <pre><code>LAC: 5502
  MNC: 1
  MCC: 232
  Cell ID: 33025
  Signal: 80
  ARFCN: 74
  BSIC: 33
  Timing advance: 0
  Longitude: 14.2565389
  Latitude: 48.2248439
  </code></pre>
  
  <p><strong>Cell 2</strong></p>
  
  <pre><code>LAC: 5502
  MNC: 1
  MCC: 232
  Cell ID: 33015
  Signal: 55
  ARFCN: 79
  BSIC: 3
  Longitude: 14.2637736
  Latitude: 48.2331576
  </code></pre>
  
  <p><strong>Cell 3</strong></p>
  
  <pre><code>LAC: 5502
  MNC: 1
  MCC: 232
  Cell ID: 33035
  Signal: 55
  ARFCN: 64
  BSIC: 5
  Longitude: 14.2488966
  Latitude: 48.232513
  </code></pre>
  
  <p><strong>Cell 4</strong></p>
  
  <pre><code>LAC: 5502
  MNC: 1
  MCC: 232
  Cell ID: 2515
  Signal: 39
  ARFCN: 55
  BSIC: 32
  Longitude: 14.2488163
  Latitude: 48.2277972
  </code></pre>
  
  <p><strong>Cell 5</strong></p>
  
  <pre><code>LAC: 5502
  MNC: 1
  MCC: 232
  Cell ID: 60920
  Signal: 21
  ARFCN: 41
  BSIC: 33
  Longitude: 14.2647612
  Latitude: 48.2299558
  </code></pre>
  
  <p>So with all that information how do I find, in the most accurate way, where I actually am?</p>