Visual studio feeds

All Visual Studio blogs in one place


Enter your email address:

Delivered by FeedBurner

Increase your website traffic with



Anti-spam: How many eyes has a typical person?

Follow us on FB


Geo Location & Spatial Searches with RavenDB–Part III-Importing

AddThis Social Bookmark Button
The following are sample from the data sources that MaxMind provides for us: The question is, how do we load them into RavenDB? Just to give you some numbers, there are 1.87 million blocks and over 350,000 locations. Those are big numbers, but still small enough that we can work with the entire thing in memory. I wrote a quick & ugly parsing routines for them: public static IEnumerable> ReadBlocks(string dir) { using (var file = File.OpenRead(Path.Combine(dir, "GeoLiteCity-Blocks.csv"))) using (var reader = new StreamReader(file)) {
reader.ReadLine(); // copy right reader.ReadLine(); // header string line; while ((line = reader.ReadLine()) != null) { var entries = line.Split(',').Select(x => x.Trim('"')).ToArray(); yield return Tuple.Create( int.Parse(entries[2]), ...(Read whole news on source site)

Home : Blog List : Ayende @ Rahien : Geo Location & Spatial Searches with RavenDB–Part III-Importing