Exemplo n.º 1
0
 def do_geocoding(self, properties):
     lat = properties.get(self.geo_fields['lat'], '')
     lon = properties.get(self.geo_fields['lon'], '')
     address = properties.get(self.geo_fields['address'], '')
     if lat.strip() == '' and lon.strip() == '' and address:
         coordinates = geocoding.geocode(self.portal_map, address)
         if coordinates != None:
             lat, lon = coordinates
             properties[self.geo_fields['lat']] = lat
             properties[self.geo_fields['lon']] = lon
     return properties
Exemplo n.º 2
0
 def do_geocoding(self, properties):
     lat = properties.get(self.geo_fields['lat'], '')
     lon = properties.get(self.geo_fields['lon'], '')
     address = properties.get(self.geo_fields['address'], '')
     if lat.strip() == '' and lon.strip() == '' and address:
         coordinates = geocoding.geocode(self.portal_map, address)
         if coordinates != None:
             lat, lon = coordinates
             properties[self.geo_fields['lat']] = lat
             properties[self.geo_fields['lon']] = lon
     return properties
Exemplo n.º 3
0
def do_geocoding(geo_fields, properties):
    time.sleep(1)
    lat = properties.get(geo_fields['lat'], '')
    lon = properties.get(geo_fields['lon'], '')
    address = properties.get(geo_fields['address'], '')

    if lat.strip() == '' and lon.strip() == '' and address:
        coordinates = geocoding.geocode(None, address)
        print "Got coordinated", coordinates, address
        if coordinates != None:
            lat, lon = coordinates
            properties[geo_fields['lat']] = lat
            properties[geo_fields['lon']] = lon

    return properties
Exemplo n.º 4
0
def do_geocoding(geo_fields, properties):
    time.sleep(1)
    lat = properties.get(geo_fields['lat'], '')
    lon = properties.get(geo_fields['lon'], '')
    address = properties.get(geo_fields['address'], '')

    if lat.strip() == '' and lon.strip() == '' and address:
        coordinates = geocoding.geocode(None, address)
        print "Got coordinated", coordinates, address
        if coordinates != None:
            lat, lon = coordinates
            properties[geo_fields['lat']] = lat
            properties[geo_fields['lon']] = lon

    return properties