Geokoder

Thoughts, news, and things that I've learned around location-based web and mobile applications. This blog will serve as my platform to share pieces of information that I found worth sharing, things that I found good to know working on location-based services. This is the very beginning of my blog and who know, it might just turn into my own reference of location-based code and math.

OpenStreetMap Geocoder

This post is about a small project I worked on in 2009 and I am merely posting it here so that it doesn’t get forgotten. So this is more of a housekeeping post but interesting nevertheless. I created a reverse geocoding service based on the Open Street Map (OSM) data. At the time, there was no such web service available and I took it upon myself to correct that. There was, however, Cloudmade that provided mapping services based on OSM data. So I created a web service that, given latitude/longitude pairs, returned a street address or name of the areas if the latitude/longitude was within such areas. Here is a screencast that I took before taking down the site (more to that further …

MongoDB Plugin for Quantum GIS

I recently had the need to plot geographic data stored in MongoDB on a map. The data are points (latitude and longitude) for a project at WHERE, Inc. I was using Quantum GIS and the “Delimited Text” plugin that lets you load CSV files (back in the day of ArcView this was called adding an “Event Theme”). So the process was to export the data from MongoDB into a CSV file, editing that file so that latitude and longitude are separate columns, and then loading this edited file into Quantum GIS. This was fine once, maybe twice, but after that I was looking for a more automated solution. The result of this motivation is my MongoDB plugin for Quantum GIS. …

Java JSON Libraries Comparison

I work for the great company Where, Inc. where I keep the WHERE Ads platform humming. It is a Java backend, Spring framework, Jetty, etc. We use a lot of JSON in API calls and especially for logging. Every request, click, ad impression gets logged and with several millions of requests per hour that makes for a lot of allocated JSON objects. Recently I profiled our application and saw that the JSON library allocated tons of objects and lead to high garbage collector activity. So I started to look for alternative libraries and ran a test to compare memory allocation. Speed is less important in this application as most JSON objects contain less than a dozen attributes. I tested four …

Degrees, Miles, Meters

Every now and then you will need to lookup some numbers. E.g., you might be writing code that searches places within a distance but you have to specify the distance in degrees or you need to calculate a minimum bounding rectangle. So you might need to know how many degrees are 1000 meters. You can, of course, do the math as described in the Distances post but if you just need to get some pointers, here are some commonly used values. Here some numbers that might be handy to have them within reach.

Distances

When you develop any type of application that deals with geographic data, you will most likely have to calculate distances between two points. Such calculations are fairly simple but nevertheless, I think it is worthwhile for me to list your options, especially if you are new to working with geographic data.