Retrieves the elevation of a single location.

@param context The {@link GeoApiContext} to make requests through.
@param location The location to retrieve the elevation for.
@return The elevation as a {@link PendingResult}.
9253
public static PendingResult<ElevationResult> getByPoint(GeoApiContext context, LatLng location) {
    return context.get(API_CONFIG, SingularResponse.class, "locations", location.toString());
  }
890237
public static <T> GenericResponseBuilder<T> temporaryRedirect(URI location) {
    return GenericResponses.<T>status(Response.Status.TEMPORARY_REDIRECT).location(location);
  }
303373
public static LocationType getLocationType(URI location) {
        String scheme = location.getScheme();
        if (EMODB_SCHEME.equals(scheme)) {
            // If the host matches the locator pattern then assume host discovery, otherwise it's a
            // direct URL to an EmoDB server
            if (LOCATOR_PATTERN.matcher(location.getHost()).matches()) {
                return LocationType.EMO_HOST_DISCOVERY;
            } else {
                return LocationType.EMO_URL;
            }
        } else if (STASH_SCHEME.equals(scheme)) {
            return LocationType.STASH;
        }

        throw new IllegalArgumentException("Invalid location: " + location);
    }
71888
public static StashLocation getStashLocation(URI location) {
        checkArgument(getLocationType(location) == LocationType.STASH, "Not a stash location");

        String host, path;
        boolean useLatestDirectory;

        Matcher matcher = getLocatorMatcher(location);
        if (matcher.matches()) {
            // Stash is only available for the default group.  Make sure that's the case here
            String group = Objects.firstNonNull(matcher.group("group"), DEFAULT_GROUP);
            checkArgument(DEFAULT_GROUP.equals(group), "Stash not available for group: %s", group);

            // Stash it not available for local
            String universe = matcher.group("universe");
            checkArgument(universe != null, "Stash not available for local");

            Region region = getRegion(Objects.firstNonNull(matcher.group("region"), DEFAULT_REGION));

            host = getS3BucketForRegion(region);
            path = getS3PathForUniverse(universe);
            useLatestDirectory = true;
        } else {
            // The location refers to the actual S3 bucket and path
            host = location.getHost();
            path = location.getPath();
            // Stash paths don't have a leading slash
            if (path != null && path.startsWith("/")) {
                path = path.substring(1);
            }
            useLatestDirectory = false;
        }

        return new StashLocation(host, path, useLatestDirectory);
    }
105494
public void putGeoLocation(final GeoLocationRequest location) {
        putGeoAccuracy(location.getAccuracy());
        putGeoLatitude(location.getLatitude());
        putGeoLongitude(location.getLongitude());
        putGeoTimestamp(location.getTimestamp());
    }
15555
public Location getLocationAtEntry() {
        InstructionHandle handle = getEntry().getFirstInstruction();
        assert handle != null;
        return new Location(handle, getEntry());
    }
23285
public static GeocodingApiRequest reverseGeocode(GeoApiContext context, LatLng location) {
    GeocodingApiRequest request = new GeocodingApiRequest(context);
    request.latlng(location);
    return request;
  }
927867
private Context getContext(ExecutionContext executionContext) {
        // Get context id.
        HttpServletRequest request = executionContext.getActionBeanContext().getRequest();
        String parameter = request.getParameter(ID_PARAMETER);
        
        // Return context.
        if (parameter != null) {
            int id = Integer.parseInt(parameter, 16);
            return contexts.get(id);
        }
        
        return null;
    }
712332
public static Location createLocation(final GeoCodingResult coords) throws FrameworkException {

		final PropertyMap props = new PropertyMap();
		double latitude         = coords.getLatitude();
		double longitude        = coords.getLongitude();
		String type             = Location.class.getSimpleName();

		props.put(AbstractNode.type,  type);
		props.put(StructrApp.key(Location.class, "latitude"),  latitude);
		props.put(StructrApp.key(Location.class, "longitude"), longitude);

		return StructrApp.getInstance().create(Location.class, props);
	}
559396
public GeocodeApiResponse.Location getLocation() {
        final GeocodeApiResponse.Result firstResult = firstResult(apiResponse);
        if(firstResult == null) {
            return null;
        }
        final GeocodeApiResponse.Geometry geometry = firstResult.getGeometry();
        if (geometry == null) {
            return null;
        }
        return geometry.getLocation();
    }
667261
public com.google.api.ads.adwords.axis.v201809.cm.GeoPoint getGeoPoint() {
        return geoPoint;
    }
508789
@Override
  public int compareTo(final PointLocation pointLocation)
  {
    int comparison;
    comparison = (int) Math.signum(altitude - pointLocation.altitude);
    if (comparison == 0)
    {
      comparison = latitude.compareTo(pointLocation.latitude);
    }
    if (comparison == 0)
    {
      comparison = longitude.compareTo(pointLocation.longitude);
    }
    return comparison;
  }
834786
public JvmOperation getJvmOperation(IMethod method, XtendTypeDeclaration context)
			throws JavaModelException {
		if (!method.isConstructor() && !method.isLambdaMethod() && !method.isMainMethod()) {
			final JvmType type = this.typeReferences.findDeclaredType(
					method.getDeclaringType().getFullyQualifiedName(),
					context);
			return getJvmOperation(method, type);
		}
		return null;
	}
122365
public static InetAddress inetAddressFromLocation(String location) {
        try {
            return InetAddress.getByName(location);
        } catch (UnknownHostException e) {
            throw new DeepIOException(e);
        }
    }
276228
public synchronized EvaluatorContext getContext(final String contextId) {
    for (final EvaluatorContext context : this.contextStack) {
      if (context.getId().equals(contextId)) {
        return context;
      }
    }
    throw new RuntimeException("Unknown evaluator context " + contextId);
  }
598758
public static AbstractResource getRawResourceFrom(final String location) throws IOException {
        if (StringUtils.isBlank(location)) {
            throw new IllegalArgumentException("Provided location does not exist and is empty");
        }
        if (location.toLowerCase().startsWith(HTTP_URL_PREFIX)) {
            return new UrlResource(location);
        }
        if (location.toLowerCase().startsWith(CLASSPATH_URL_PREFIX)) {
            return new ClassPathResource(location.substring(CLASSPATH_URL_PREFIX.length()));
        }
        return new FileSystemResource(StringUtils.remove(location, FILE_URL_PREFIX));
    }
1324893
def get_cached(location, **kwargs):
    
    result = cache.get(location)

    # Result is not cached or wrong
    if not result or not result.ok:
        result = geocoder.get(location, **kwargs)
        if result.ok:
            cache.set(location, result)

    return result