Exemplo n.º 1
0
 def test_georef(self):
     geocode = simplejson.loads("""{
    "results" : [
       {
          "address_components" : [
             {
                "long_name" : "Mountain View",
                "short_name" : "Mountain View",
                "types" : [ "locality", "political" ]
             },
             {
                "long_name" : "San Jose",
                "short_name" : "San Jose",
                "types" : [ "administrative_area_level_3", "political" ]
             },
             {
                "long_name" : "Santa Clara",
                "short_name" : "Santa Clara",
                "types" : [ "administrative_area_level_2", "political" ]
             },
             {
                "long_name" : "California",
                "short_name" : "CA",
                "types" : [ "administrative_area_level_1", "political" ]
             },
             {
                "long_name" : "United States",
                "short_name" : "US",
                "types" : [ "country", "political" ]
             }
          ],
          "formatted_address" : "Mountain View, CA, USA",
          "geometry" : {
             "bounds" : {
                "northeast" : {
                   "lat" : 37.4698870,
                   "lng" : -122.0446720
                },
                "southwest" : {
                   "lat" : 37.35654100000001,
                   "lng" : -122.1178620
                }
             },
             "location" : {
                "lat" : 37.38605170,
                "lng" : -122.08385110
             },
             "location_type" : "APPROXIMATE",
             "viewport" : {
                "northeast" : {
                   "lat" : 37.42150620,
                   "lng" : -122.01982140
                },
                "southwest" : {
                   "lat" : 37.35058040,
                   "lng" : -122.14788080
                }
             }
          },
          "types" : [ "locality", "political" ]
       }
    ],
    "status" : "OK"
 }""")
     logging.info(geomancer.georef_feature(geocode))
Exemplo n.º 2
0
 def test_georeference_feature(self):
     geocode = get_example_geocode()
     georef = geomancer.georef_feature(geocode)
     logging.info('Georeference: %s'%(georef))