robsmart.co.uk

Emerging technology, Open Source and the Internet
  • rss
  • Home
  • About
  • Press

Searching data by geographic area

Rob Smart | March 4, 2008

On a project I’m working on at the moment (Meedan) we need to be able search for content by geographic area as well as by topic …. e.g. give me all the blog articles from the Middle east that relate to the Iraq war.

Luckily we already have a means to geo-locate all this content (handy eh ? ) so we’ve assigned latitude and longitude values to each article/ blog post /conversation participant.

All thats needed then is a means to search by Geographic area.

We’re using PostgreSQL a pretty heavy weight database baring a much closer resemblance to Db2 rather than MySQL. It has some pretty neat geographic search features courtesy of the PostGIS extension. This allows you to perform searches inside lat/lon boundaries of varying complexity as well as many other neat geo functions. These boundaries are defined in a markup called Well Known Text (WKT), for our purpose we search by polygons that are made up of lat/lon points that mark out the geographic search areas, both PostGIS and DB2 spatial extender uses this format.

So that’s all the big pieces in place, the only missing piece is a set of lat/lon points that define the areas we wish to search. I may have been blind or searching for the wrong terms but i couldnt find a set of this data anywhere on the Internet (please point me to a source if you know one). As we only needed the rough continent outlines I decided it would be a fairly trivial effort to make a tool to create the sets of lat/lon points in the correct WKT format for our searches.

map tool

Basically you click around the area you want to define and the hit ‘generate polygon’ this will give a nice WKT formatted polygon ready to use in an SQL query. If you want to delete a point just click on it a second time.

At the moment you just create an area generate the polgon and do the next one.

Next up I may add some storage so that people can share these datasets with each other or come back and change them at a later date.

For now here is the mapping tool.

Categories
,
Tags
area, boundary, geolocation, googlemaps, mapping, meedan, plot, postgis
Comments rss
Comments rss
Trackback
Trackback

« Troika Binary art IBM Hursley ETS Rocket Day »

Leave a Reply

Click here to cancel reply.

Tags

3d aberdeen anime api arabic art avatar c# drawing environment ets ets hursley ibm press flickr google hursley ibm ibm hursley ets rockets filming photography image processing jeddah lsl machinima openid opensim pervasive photography press saudi scripting secondlife security simile sony home streaming timeline transliteration twister video virtualworlds virtualworlds secondlife ibm linden wacom wacom concept art deviantart graphics wave power weather web 2.0 webmaster

  • Andy Piper
  • Dale Lane
  • Darren Shaw
  • Eightbar
  • Feeding Edge
  • Gareth Jones
  • Hannah Parker
  • Ian Hughes
  • Ian Smith
  • Irving Wladawsky-Berger
  • James Taylor
  • John Tolva
  • Kelly Drahzal
  • Martin Gale
  • Michael Rowe
  • Michael Rowe
  • Mo Hax
  • Nick O’Leary
  • Penny Glazzard – Zzing marketing
  • Pranab Sharma
  • Rita J. King
  • Roo Reynolds
  • Rosemary Gardening

  • Photography

Twitter feed

  • Met Police uses 'quick' mobile data extraction system against suspects http://t.co/gOTOE593 18 hours ago
  • RT @Heather_DJ: Chan 4 News tonight: IBM Hursley colleagues demoing a mind-reading headset to control a model car - a few short steps t ... 2012/05/09
  • And another Github gist, a simple pure php MQTTClient for doing publishes only, should work on any php hosted service https://t.co/RJbjA2fK 2012/05/05
  • Putting old php code of mine on Github in case anyone finds it useful, Arabic to English transliteration +vice versa https://t.co/4b0UehWR 2012/05/05
  • @andypiper vote cast, looking at those other profiles Dan is sure to win. Putting things like "i like to make money" won't really gain votes 2012/05/04
  • @dalelane Happy Birthday! 2012/05/04
  • @ray_chelr congrats on getting the job :) 2012/05/03
  • RT @IanSkerrett: IBM Worklight Studio looks pretty compelling http://t.co/g58TayQc 2012/05/02
  • RT @scottjenson: Financial Times ditching iOS apps for web app "web overtook iOS w/in 3 months" http://t.co/sPLqWcfl /via @richardsona 2012/05/02
  • @StuartMcIntyre Not really enough material in my call recording -> Connections upload for a conference talk, i might stretch to a blog post 2012/05/02

Recent Comments

  • Jarvan on Transliteration again … now complete
  • Kristin on Transliteration again … now complete
  • » Favorite links of 2007 Ascent Stage on Your Flickr timeline with Simile
  • pat on Transliteration again … now complete
  • Jack on Home VOIP system using FreeSwitch and a Linksys 3102 voice gateway (UK Guide)
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox