Class ElevationClient

java.lang.Object
com.azure.maps.elevation.ElevationClient

public final class ElevationClient extends Object
ElevationClient instances are created via the ElevationClientBuilder, as shown below. Creating a sync client using a AzureKeyCredential:
 // Authenticates using subscription key
 AzureKeyCredential keyCredential = new AzureKeyCredential(System.getenv("SUBSCRIPTION_KEY"));

 // Creates a client
 ElevationClient client = new ElevationClientBuilder() 
     .credential(keyCredential)
     .elevationClientId(System.getenv("MAPS_CLIENT_ID"))
     .buildClient();
 
  • Method Details

    • getDataForPoints

      public ElevationResult getDataForPoints(List<com.azure.core.models.GeoPosition> points)
      Get Data For Points
       client.getDataForPoints(Arrays.asList(
           new GeoPosition(-121.66853362143818, 46.84646479863713), 
           new GeoPosition(-121.68853362143818, 46.856464798637127)));
       
      **Applies to**: S1 pricing tier.

      The Get Data for Points API provides elevation data for one or more points. A point is defined in lat,long coordinate format.

      Due to the URL character length limit of 2048, it's not possible to pass more than 100 coordinates as a pipeline delimited string in a URL GET request. If you intend to pass more than 100 coordinates as a pipeline delimited string, use the [POST Data For Points](https://docs.microsoft.com/rest/api/maps/elevation/postdataforpoints).

      The result will be in the same sequence of points listed in the request.

      Parameters:
      points - The string representation of a list of points. A point is defined in lon/lat WGS84 coordinate reference system format. If multiple points are requested, each of the points in a list should be separated by the pipe ('|') character. The maximum number of points that can be requested in a single request is 2,000. The resolution of the elevation data will be the highest for a single point and will decrease if multiple points are spread further apart.
      Returns:
      the response from a successful Get Data for Bounding Box API.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.elevation.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getDataForPointsWithResponse

      public com.azure.core.http.rest.Response<ElevationResult> getDataForPointsWithResponse(List<com.azure.core.models.GeoPosition> points, com.azure.core.util.Context context)
      Get Data For Points
       client.getDataForPoints(Arrays.asList(
           new GeoPosition(-121.66853362143818, 46.84646479863713), 
           new GeoPosition(-121.68853362143818, 46.856464798637127)));
       
      **Applies to**: S1 pricing tier.

      The Get Data for Points API provides elevation data for one or more points. A point is defined in lat,long coordinate format.

      Due to the URL character length limit of 2048, it's not possible to pass more than 100 coordinates as a pipeline delimited string in a URL GET request. If you intend to pass more than 100 coordinates as a pipeline delimited string, use the [POST Data For Points](https://docs.microsoft.com/rest/api/maps/elevation/postdataforpoints).

      The result will be in the same sequence of points listed in the request.

      Parameters:
      points - The string representation of a list of points. A point is defined in lon/lat WGS84 coordinate reference system format. If multiple points are requested, each of the points in a list should be separated by the pipe ('|') character. The maximum number of points that can be requested in a single request is 2,000. The resolution of the elevation data will be the highest for a single point and will decrease if multiple points are spread further apart.
      context - The context to associate with this operation.
      Returns:
      the response from a successful Get Data for Bounding Box API.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.elevation.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getDataForPolyline

      public ElevationResult getDataForPolyline(List<com.azure.core.models.GeoPosition> lines, Integer samples)
      Get Data For Polyline
       client.getDataForPolyline(Arrays.asList(
           new GeoPosition(-121.66853362143818, 46.84646479863713), 
           new GeoPosition(-121.65853362143818, 46.85646479863713)), 5);
       
      **Applies to**: S1 pricing tier.

      The Get Data for Polyline API provides elevation data along a polyline.

      A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe ('|') character. In addition to passing in endpoints, customers can specify the number of sample points that will be used to divide polyline into equally spaced segments.

      Elevation data at both start and endpoints, as well as equally spaced points along the polyline will be returned. The results will be listed in the direction from the first endpoint towards the last endpoint. A line between two endpoints is a straight Cartesian line, the shortest line between those two points in the coordinate reference system. Note that the point is chosen based on Euclidean distance and may markedly differ from the geodesic path along the curved surface of the reference ellipsoid.

      Parameters:
      lines - The string representation of a polyline path. A polyline is defined by endpoint coordinates, with each endpoint separated by a pipe ('|') character. The polyline should be defined in the following format: `[longitude_point1, latitude_point1 | longitude_point2, latitude_point2, ..., longitude_pointN, latitude_pointN]`.

      The longitude and latitude values refer to the World Geodetic System (WGS84) coordinate reference system. The resolution of the data used to compute the elevation depends on the distance between the endpoints.

      samples - The samples parameter specifies the number of equally spaced points at which elevation values should be provided along a polyline path. The number of samples should range from 2 to 2,000. Default value is 10.
      Returns:
      the response from a successful Get Data for Bounding Box API.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.elevation.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getDataForPolylineWithResponse

      public com.azure.core.http.rest.Response<ElevationResult> getDataForPolylineWithResponse(List<com.azure.core.models.GeoPosition> lines, Integer samples, com.azure.core.util.Context context)
      Get Data For Polyline
       client.getDataForPolyline(Arrays.asList(
           new GeoPosition(-121.66853362143818, 46.84646479863713), 
           new GeoPosition(-121.65853362143818, 46.85646479863713)), 5);
       
      **Applies to**: S1 pricing tier.

      The Get Data for Polyline API provides elevation data along a polyline.

      A polyline is defined by passing in between 2 and N endpoint coordinates separated by a pipe ('|') character. In addition to passing in endpoints, customers can specify the number of sample points that will be used to divide polyline into equally spaced segments.

      Elevation data at both start and endpoints, as well as equally spaced points along the polyline will be returned. The results will be listed in the direction from the first endpoint towards the last endpoint. A line between two endpoints is a straight Cartesian line, the shortest line between those two points in the coordinate reference system. Note that the point is chosen based on Euclidean distance and may markedly differ from the geodesic path along the curved surface of the reference ellipsoid.

      Parameters:
      lines - The string representation of a polyline path. A polyline is defined by endpoint coordinates, with each endpoint separated by a pipe ('|') character. The polyline should be defined in the following format: `[longitude_point1, latitude_point1 | longitude_point2, latitude_point2, ..., longitude_pointN, latitude_pointN]`.

      The longitude and latitude values refer to the World Geodetic System (WGS84) coordinate reference system. The resolution of the data used to compute the elevation depends on the distance between the endpoints.

      samples - The samples parameter specifies the number of equally spaced points at which elevation values should be provided along a polyline path. The number of samples should range from 2 to 2,000. Default value is 10.
      context - The context to associate with this operation.
      Returns:
      the response from a successful Get Data for Bounding Box API.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.elevation.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getDataForBoundingBox

      public ElevationResult getDataForBoundingBox(com.azure.core.models.GeoBoundingBox bounds, Integer rows, Integer columns)
      Get Data For Bounding Box
       client.getDataForBoundingBox(new GeoBoundingBox(-121.668533621438, 46.8464647986371, 
           -121.658533621438, 46.8564647986371), 3, 3);
       
      **Applies to**: S1 pricing tier.

      The Get Data for Bounding Box API provides elevation data at equally spaced locations within a bounding box. A bounding box is defined by the coordinates for two corners (southwest, northeast) and then subsequently divided into rows and columns.

      Elevations are returned for the vertices of the grid created by the rows and columns. Up to 2,000 elevations can be returned in a single request. The returned elevation values are ordered, starting at the southwest corner, and then proceeding west to east along the row. At the end of the row, it moves north to the next row, and repeats the process until it reaches the far northeast corner.

      Parameters:
      bounds - The string that represents the rectangular area of a bounding box. The bounds parameter is defined by the 4 bounding box coordinates, with WGS84 longitude and latitude of the southwest corner followed by WGS84 longitude and latitude of the northeast corner. The string is presented in the following format: `[SouthwestCorner_Longitude, SouthwestCorner_Latitude, NortheastCorner_Longitude, NortheastCorner_Latitude]`.
      rows - Specifies the number of rows to use to divide the bounding box area into a grid. The number of vertices (rows x columns) in the grid should be less than 2,000.
      columns - Specifies the number of columns to use to divide the bounding box area into a grid. The number of vertices (rows x columns) in the grid should be less than 2,000.
      Returns:
      the response from a successful Get Data for Bounding Box API.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.elevation.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getDataForBoundingBoxWithResponse

      public com.azure.core.http.rest.Response<ElevationResult> getDataForBoundingBoxWithResponse(com.azure.core.models.GeoBoundingBox bounds, Integer rows, Integer columns, com.azure.core.util.Context context)
      Get Data For Bounding Box
       client.getDataForBoundingBox(new GeoBoundingBox(-121.668533621438, 46.8464647986371, 
           -121.658533621438, 46.8564647986371), 3, 3);
       
      **Applies to**: S1 pricing tier.

      The Get Data for Bounding Box API provides elevation data at equally spaced locations within a bounding box. A bounding box is defined by the coordinates for two corners (southwest, northeast) and then subsequently divided into rows and columns.

      Elevations are returned for the vertices of the grid created by the rows and columns. Up to 2,000 elevations can be returned in a single request. The returned elevation values are ordered, starting at the southwest corner, and then proceeding west to east along the row. At the end of the row, it moves north to the next row, and repeats the process until it reaches the far northeast corner.

      Parameters:
      bounds - The string that represents the rectangular area of a bounding box. The bounds parameter is defined by the 4 bounding box coordinates, with WGS84 longitude and latitude of the southwest corner followed by WGS84 longitude and latitude of the northeast corner. The string is presented in the following format: `[SouthwestCorner_Longitude, SouthwestCorner_Latitude, NortheastCorner_Longitude, NortheastCorner_Latitude]`.
      rows - Specifies the number of rows to use to divide the bounding box area into a grid. The number of vertices (rows x columns) in the grid should be less than 2,000.
      columns - Specifies the number of columns to use to divide the bounding box area into a grid. The number of vertices (rows x columns) in the grid should be less than 2,000.
      context - The context to associate with this operation.
      Returns:
      the response from a successful Get Data for Bounding Box API.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.maps.elevation.implementation.models.ErrorResponseException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.