Requests the latitude and longitude of an {@code address}.

@param context The {@link GeoApiContext} to make requests through.
@param address The address to geocode.
@return Returns the request, ready to run.
168705
public static GeocodingApiRequest geocode(GeoApiContext context, String address) {
    GeocodingApiRequest request = new GeocodingApiRequest(context);
    request.address(address);
    return request;
  }
378214
def find_location(address)
      result = geocode(address)
      if result['status'] == 'OK'
        return result['results'][0]['geometry']['location']
      else
        latlon_regexp = /(-?([1-8]?[0-9]\.{1}\d{1,6}|90\.{1}0{1,6})),(-?((([1]?[0-7][0-9]|[1-9]?[0-9])\.{1}\d{1,6})|[1]?[1-8][0]\.{1}0{1,6}))/
        if address =~ latlon_regexp
          location = $&.split(',').map {|e| e.to_f}
          return { "lat" => location[0], "lng" => location[1] }
        else
          return nil
        end
      end
    end
1353123
public boolean isMatch(String address)
  {
    try {
      return isMatch(InetAddress.getByName(address));
    } catch (Exception e) {
      log.log(Level.FINER, e.toString(), e);

      return false;
    }
  }
774564
protected function performGeolocation(AddressInterface $address)
    {
        $configuration = $this->geolocator->getGeolocatorConfiguration();
        $uri = str_replace('[[IP]]', rawurlencode((string) $address), $configuration['url']);
        $httpClient = $this->app->make(HttpClient::class);
        $httpClient->setUri($uri);
        $result = new GeolocationResult();
        try {
            $response = $httpClient->send();
        } catch (Exception $x) {
            $result->setError(GeolocationResult::ERR_NETWORK, t('Request to geoPlugin failed: %s', $x->getMessage()), $x);
        }
        if ($result->hasError() === false) {
            if (!$response->isSuccess()) {
                $result->setError(GeolocationResult::ERR_NETWORK, t('Request to geoPlugin failed with return code %s', sprintf('%s (%s)', $response->getStatusCode(), $response->getReasonPhrase())));
            } else {
                $responseBody = $response->getBody();
                $data = @json_decode($responseBody, true);
                if (
                    !is_array($data)
                    || empty($data['geoplugin_status'])
                ) {
                    $result->setError(GeolocationResult::ERR_LIBRARYSPECIFIC, t('Malformed data received from geoPlugin (%s)', $responseBody));
                } else {
                    switch ($data['geoplugin_status']) {
                        case static::GEOPLUGIN_STATUS_NOTFOUND:
                            break;
                        case static::GEOPLUGIN_STATUS_OK:
                        case static::GEOPLUGIN_STATUS_ONLYCOUNTRY:
                            $this->dataToGeolocationResult($data, $configuration, $result);
                            break;
                        default:
                            $result->setError(GeolocationResult::ERR_LIBRARYSPECIFIC, t('Unknown geoPlugin status code: %s', $data['geoplugin_status']));
                            break;
                    }
                }
            }
        }

        return $result;
    }
108171
public function geocodeAddress($address)
	{
		$url = 'http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=' . urlencode($address);
		$response = $this->http->get($url);

		if ($response->code < 200 || $response->code >= 300)
		{
			throw new RuntimeException('Error code ' . $response->code . ' received geocoding address: ' . $response->body . '.');
		}

		$data = json_decode($response->body, true);

		if (!$data)
		{
			throw new RuntimeException('Invalid json received geocoding address: ' . $response->body . '.');
		}

		if ($data['status'] != 'OK')
		{
			return null;
		}

		return $data['results'][0];
	}
999803
public void setAddress(final String address) {
		if (this.address == null && address != null && address.contains("@")) {
			this.address = address;
		}
	}
95771
public static function latLngFromAddress ($address, $country = null)
	{
		/** @var Settings $settings */
		$settings = SimpleMap::getInstance()->getSettings();
		$token = static::getToken($settings->geoToken, $settings->geoService);

		switch ($settings->geoService)
		{
			case GeoEnum::Here:
				return static::_latLngFromAddress_Here(
					$token,
					$address, $country
				);
			case GeoEnum::GoogleMaps:
				return static::_latLngFromAddress_Google(
					$token,
					$address, $country
				);
			case GeoEnum::Mapbox:
				return static::_latLngFromAddress_Mapbox(
					$token,
					$address, $country
				);
			case GeoEnum::Nominatim:
				return static::_latLngFromAddress_Nominatim(
					$address, $country
				);
			default:
				throw new Exception(
					'Unknown geo-coding service: ' . $settings->geoService
				);
		}
	}
29289
def address_to_coords(self, address):
        """"""

        base_coords = self.BASE_COORDS[self.region]
        get_cord = self.COORD_SERVERS[self.region]
        url_options = {
            "q": address,
            "lang": "eng",
            "origin": "livemap",
            "lat": base_coords["lat"],
            "lon": base_coords["lon"]
        }

        response = requests.get(self.WAZE_URL + get_cord, params=url_options, headers=self.HEADERS)
        for response_json in response.json():
            if response_json.get('city'):
                lat = response_json['location']['lat']
                lon = response_json['location']['lon']
                bounds = response_json['bounds']  # sometimes the coords don't match up
                if bounds is not None:
                    bounds['top'], bounds['bottom'] = max(bounds['top'], bounds['bottom']), min(bounds['top'], bounds['bottom'])
                    bounds['left'], bounds['right'] = min(bounds['left'], bounds['right']), max(bounds['left'], bounds['right'])
                else:
                    bounds = {}
                return {"lat": lat, "lon": lon, "bounds": bounds}
        raise WRCError("Cannot get coords for %s" % address)
900796
public static GeoLocationRequest getHttpServletRequestGeoLocationFromRequestContext(final RequestContext context) {
        val servletRequest = getHttpServletRequestFromExternalWebflowContext(context);
        return getHttpServletRequestGeoLocation(servletRequest);
    }
126197
final void searchMap(String address) {
    launchIntent(new Intent(Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + Uri.encode(address))));
  }
1319300
public FieldErrorBuilder address(final Optional<CellPosition> address) {
        address.ifPresent(a -> address(a));
        return this;
    }
366259
public SingleServerConfig setAddress(String address) {
        if (address != null) {
            this.address = URIBuilder.create(address);
        }
        return this;
    }
151980
public static PendingResult<ElevationResult[]> getByPoints(
      GeoApiContext context, EncodedPolyline encodedPolyline) {
    return context.get(
        API_CONFIG, MultiResponse.class, "locations", "enc:" + encodedPolyline.getEncodedPath());
  }
1299928
@VisibleForTesting
  static String makeTargetStringForDirectAddress(SocketAddress address) {
    try {
      return new URI(DIRECT_ADDRESS_SCHEME, "", "/" + address, null).toString();
    } catch (URISyntaxException e) {
      // It should not happen.
      throw new RuntimeException(e);
    }
  }
1220992
public static InetAddress ntoa(final int address)
	{
		try
		{
			final byte[] addr = new byte[4];

			addr[0] = (byte) ((address >>> 24) & 0xFF);
			addr[1] = (byte) ((address >>> 16) & 0xFF);
			addr[2] = (byte) ((address >>> 8) & 0xFF);
			addr[3] = (byte) (address & 0xFF);

			return InetAddress.getByAddress(addr);
		}
		catch (UnknownHostException e)
		{
			// will never be thrown
			throw new Error(e);
		}
	}
260861
public InetAddress address(boolean resolve) {
    if (resolve) {
      address = resolveAddress();
      return address;
    }

    if (address == null) {
      synchronized (this) {
        if (address == null) {
          address = resolveAddress();
        }
      }
    }
    return address;
  }
806946
@Override
  public String requestDepositAddress(Currency currency, String... arguments) throws IOException {

    final BitsoDepositAddress response = getBitsoBitcoinDepositAddress();
    return response.getDepositAddress();
  }