Geoparsing Historic Texts: Gutenkarte and the GeoParser

Schuyler Erle

MetaCarta

Christopher Schmidt

MetaCarta

Gutenkarte

Map View

Place View

Browse View

Technology Behind Gutenkarte

PostGIS in Gutenkarte

location from (
   SELECT oid, etext_id, id as place_id, 
     setsrid(location, 4326) as location, name, 
     round(8 + ln(frequency * confidence)) as size 
   FROM place 
   WHERE etext_id = %etext% 
   ORDER BY frequency * confidence ASC) 
 AS the_geom USING UNIQUE oid USING SRID=4326

MapServer

GeoParser

GeoParser in Gutenkarte

GeoParser in your own Apps

GeoParser Usage

GeoParser Usage -- Javascript

'Locations': [
{
 'Name': 'Lausanne',
 'Type': 'PPLA',
 'Population': 118015,
 'Hierarchy': 'Switzerland/Vaud/Lausanne',
 'ViewBox': [6.166667, 46.033333, 7.166667, 47.033333],
 'Centroid': [6.666667, 46.533333],
 'References': [{
   'Georef': 'Lausanne',
   'Relevance': 1.000000,
   'Confidence': 0.182457,
   'ExtractStart': 0,
   'ExtractEnd': 40,
   'Extract': 'I took the train from Geneva to Lausanne',
   'Subranges': [
     {'Start': 32, 'End': 40}
     ]
   }]
}]

GeoParser Usage -- loc query

GeoParser Usage -- loc, js

 'Name': 'Geneve',
 'Type': 'PPLA',
 'Population': 181492,
 'Hierarchy': 'Switzerland/Geneva/Geneve',
 'ViewBox': [5.566667, 45.600000, 6.766667, 46.800000],
 'Centroid': [6.166667, 46.200000]   

GeoParser Usage -- Javascript Callback

GeoParser Usage -- Callback Example

GeoParser Usage -- Python Example

import sys, urllib
data = eval(
  urllib.urlopen(
   "http://labs.metacarta.com/GeoParser/" + 
   "?output=js&loc=%s" % urllib.quote(sys.argv[1])
  ).read()
)
for i in data['Locations'][:3]
   print i['Name'], 
         "%s,%s" % (i['Centroid'][0], i['Centroid'][1]), 
         i['Hierarchy']

Output for "Chicago":
Chicago -87.68,41.84 United States/Illinois/Cook/Chicago
Chicago -91.616667,14.083333 Guatemala/Suchitepéquez/Chicago
Chicago -99.24639,46.84222 United States/North Dakota/Stutsman/Chicago

For more...

Questions, Comments?