:type geolocation: object_.Geolocation

        :rtype: dict
2413
def serialize(cls, geolocation):
        

        obj = {}

        cls.add_if_not_none(obj, cls._FIELD_LATITUDE, geolocation.latitude)
        cls.add_if_not_none(obj, cls._FIELD_LONGITUDE, geolocation.longitude)
        cls.add_if_not_none(obj, cls._FIELD_ALTITUDE, geolocation.altitude)
        cls.add_if_not_none(obj, cls._FIELD_RADIUS, geolocation.radius)

        return obj
1061770
def geo_search(self, **kwargs):
        

        if 'types' in kwargs:
            kwargs['types'] = ','.join(kwargs['types'])

        bound = kwargs.pop('bound', False)
        if bound:
            kwargs['bound[point1]'] = bound[0]
            kwargs['bound[point2]'] = bound[1]

        return self._geo_search(**kwargs)
971442
def get_location(self, obj):
        
        if not obj.city and not obj.country:
            return None
        elif obj.city and obj.country:
            return '%s, %s' % (obj.city, obj.country)
        elif obj.city or obj.country:
            return obj.city or obj.country
1352051
@JsonIgnore
    public GeoLocationRequest getGeoLocation() {
        val request = new GeoLocationRequest();
        request.setAccuracy(get("geoAccuracy"));
        request.setTimestamp(get("geoTimestamp"));
        request.setLongitude(get("geoLongitude"));
        request.setLatitude(get("geoLatitude"));
        return request;
    }
974851
def infer_location(
            self,
            location_query,
            max_distance,
            google_key,
            foursquare_client_id,
            foursquare_client_secret,
            limit
        ):
        

        self.location_from = infer_location(
            self.points[0],
            location_query,
            max_distance,
            google_key,
            foursquare_client_id,
            foursquare_client_secret,
            limit
        )
        self.location_to = infer_location(
            self.points[-1],
            location_query,
            max_distance,
            google_key,
            foursquare_client_id,
            foursquare_client_secret,
            limit
        )

        return self
779559
def locator(self, value):
        
        self._locator = value
        self._latitude, self._longitude = utils.from_grid_locator(value)
1012611
def geopos(self, key, member, *members, **kwargs):
        
        fut = self.execute(b'GEOPOS', key, member, *members, **kwargs)
        return wait_convert(fut, make_geopos)
1067920
def locations(params={})
      args = [ :query, :lat, :lon, :count ]
      params.each do |k,v|
        if !args.include?(k)
          raise ArgumentError.new 'Search term not allowed: ' + k.to_s
        end
      end

      if !params.include?(:query)
        raise ArgumentError.new '"query" term with location name is required'
      end

      results = get('locations', params)
      if results.key?("location_suggestions")
        results["location_suggestions"].map { |l| Location.new(self, l) }
      else
        nil
      end
    end
53639
def _get_stored_location(self):
        
        location_storage = storage_class(request=self.request, response=None)
        return location_storage.get()
1070921
private GeoPoint getLocation() {

        //sample data
        //{"timestamp": 1483742439, "iss_position": {"latitude": "-50.8416", "longitude": "-41.2701"}, "message": "success"}

        NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
        boolean isConnected = activeNetwork != null && activeNetwork.isConnectedOrConnecting();

        GeoPoint pt = null;
        if (isConnected) {
            try {
                JSONObject jsonObject = json.makeHttpRequest(url_select);
                JSONObject iss_position = (JSONObject) jsonObject.get("iss_position");
                double lat = iss_position.getDouble("latitude");
                double lon = iss_position.getDouble("longitude");
                //valid the data
                if (lat <= 90d && lat >= -90d && lon >= -180d && lon <= 180d) {
                    pt = new GeoPoint(lat, lon);
                } else
                    Log.e(TAG, "invalid lat,lon received");
            } catch (Throwable e) {
                Log.e(TAG, "error fetching json", e);
            }
        }
        return pt;
    }
34934
def coordinates(self, x, y, **kwargs):
        ''''''
        kwargs['returntype'] = 'geographies'
        fields = {
            'x': x,
            'y': y
        }

        return self._fetch('coordinates', fields, **kwargs)
266121
function allNodesAtLocation(location) {
        var nodes = [];
        exports.root.each(function each(n) {
            if (n.type === DOMNode.TYPE_ELEMENT && n.isAtLocation(location)) {
                nodes.push(n);
            }
        });
        return nodes;
    }
55149
def get_location(self):
        
        lat = None
        lon = None
        # note: always picks from first triple
        for _, _, o in self._graph.triples((None, GEO_NS.lat, None)):
            lat = float(o)
            break
        for _, _, o in self._graph.triples((None, GEO_NS.long, None)):
            lon = float(o)
            break

        return lat, lon
708488
def latitude_field_name(self):
        
        if self._lat_field_name is None:
            self._lat_field_name = self.name + '_lat'
        return self._lat_field_name
856097
def get(location, **kwargs):
    
    provider = kwargs.get('provider', 'bing').lower().strip()
    method = kwargs.get('method', 'geocode').lower().strip()
    if isinstance(location, (list, dict)) and method == 'geocode':
        raise ValueError("Location should be a string")

    if provider not in options:
        raise ValueError("Invalid provider")

    else:
        if method not in options[provider]:
            raise ValueError("Invalid method")
    return options[provider][method](location, **kwargs)
1091766
def _initializeLocationCache(self):
        
        # cache of locations
        self._locationMap = {}
        locationMap = self._locationMap
        triples = self._rdfGraph.triples
        Ref = rdflib.URIRef

        associations = []
        for subj, _, _ in triples((None, RDF.type, Ref(ASSOCIATION))):
            associations.append(subj.toPython())

        locationIds = []
        for association in associations:
            for _, _, obj in triples((Ref(association),
                                      Ref(HAS_SUBJECT), None)):
                locationIds.append(obj.toPython())

        locations = []
        for _id in locationIds:
            location = {}
            location["_id"] = _id
            for subj, predicate, obj in triples((Ref(location["_id"]),
                                                 None, None)):
                if not predicate.toPython() in location:
                    location[predicate.toPython()] = []
                bisect.insort(location[predicate.toPython()], obj.toPython())
                if FALDO_LOCATION in location:
                    locations.append(location)

        for location in locations:
            for _id in location[FALDO_LOCATION]:
                # lookup faldo region, ensure positions are sorted
                faldoLocation = {}
                faldoLocation["_id"] = _id
                for subj, predicate, obj in triples((Ref(faldoLocation["_id"]),
                                                    None, None)):
                    if not predicate.toPython() in faldoLocation:
                        faldoLocation[predicate.toPython()] = []
                    bisect.insort(faldoLocation[predicate.toPython()],
                                  obj.toPython())

                faldoBegins = []

                for _id in faldoLocation[FALDO_BEGIN]:
                    faldoBegin = {}
                    faldoBegin["_id"] = _id
                    for subj, predicate, obj in triples(
                                                (Ref(faldoBegin["_id"]),
                                                    None, None)):
                        faldoBegin[predicate.toPython()] = obj.toPython()
                    faldoBegins.append(faldoBegin)

                faldoReferences = []
                for _id in faldoLocation[FALDO_BEGIN]:
                    faldoReference = {}
                    faldoReference["_id"] = faldoBegin[FALDO_REFERENCE]
                    for subj, predicate, obj in triples(
                                                (Ref(faldoReference["_id"]),
                                                    None, None)):
                        faldoReference[predicate.toPython()] = obj.toPython()
                    faldoReferences.append(faldoReference)

                faldoEnds = []
                for _id in faldoLocation[FALDO_END]:
                    faldoEnd = {}
                    faldoEnd["_id"] = _id
                    for subj, predicate, obj in triples((Ref(faldoEnd["_id"]),
                                                        None, None)):
                        faldoEnd[predicate.toPython()] = obj.toPython()
                    faldoEnds.append(faldoEnd)

                for idx, faldoReference in enumerate(faldoReferences):
                    if MEMBER_OF in faldoReference:
                        build = faldoReference[MEMBER_OF].split('/')[-1]
                        chromosome = faldoReference[LABEL].split(' ')[0]
                        begin = faldoBegins[idx][FALDO_POSITION]
                        end = faldoEnds[idx][FALDO_POSITION]
                        if build not in locationMap:
                            locationMap[build] = {}
                        if chromosome not in locationMap[build]:
                            locationMap[build][chromosome] = {}
                        if begin not in locationMap[build][chromosome]:
                            locationMap[build][chromosome][begin] = {}
                        if end not in locationMap[build][chromosome][begin]:
                            locationMap[build][chromosome][begin][end] = {}
                        locationMap[build][chromosome][begin][end] = \
                            location["_id"]
                        locationMap[location["_id"]] = {
                            "build": build,
                            "chromosome": chromosome,
                            "begin": begin,
                            "end": end,
                        }
819021
def get_location(opts=None, provider=None):
    '''
    
    '''
    if opts is None:
        opts = {}
    ret = opts.get('location')
    if ret is None and provider is not None:
        ret = provider.get('location')
    if ret is None:
        ret = get_region_from_metadata()
    if ret is None:
        ret = DEFAULT_LOCATION
    return ret