Semantic Tile API . terraintiles

Instance Methods

close()

Close httplib2 connections.

get(name, altitudePrecisionCentimeters=None, clientInfo_apiClient=None, clientInfo_applicationId=None, clientInfo_applicationVersion=None, clientInfo_deviceModel=None, clientInfo_operatingSystem=None, clientInfo_platform=None, clientInfo_userId=None, maxElevationResolutionCells=None, minElevationResolutionCells=None, terrainFormats=None, x__xgafv=None)

Gets a terrain tile by its tile resource name.

Method Details

close()
Close httplib2 connections.
get(name, altitudePrecisionCentimeters=None, clientInfo_apiClient=None, clientInfo_applicationId=None, clientInfo_applicationVersion=None, clientInfo_deviceModel=None, clientInfo_operatingSystem=None, clientInfo_platform=None, clientInfo_userId=None, maxElevationResolutionCells=None, minElevationResolutionCells=None, terrainFormats=None, x__xgafv=None)
Gets a terrain tile by its tile resource name.

Args:
  name: string, Required. Resource name of the tile. The tile resource name is prefixed by its collection ID `terraintiles/` followed by the resource ID, which encodes the tile's global x and y coordinates and zoom level as `@,,z`. For example, `terraintiles/@1,2,3z`. (required)
  altitudePrecisionCentimeters: integer, The precision of terrain altitudes in centimeters. Possible values: between 1 (cm level precision) and 1,000,000 (10-kilometer level precision).
  clientInfo_apiClient: string, API client name and version. For example, the SDK calling the API. The exact format is up to the client.
  clientInfo_applicationId: string, Application ID, such as the package name on Android and the bundle identifier on iOS platforms.
  clientInfo_applicationVersion: string, Application version number, such as "1.2.3". The exact format is application-dependent.
  clientInfo_deviceModel: string, Device model as reported by the device. The exact format is platform-dependent.
  clientInfo_operatingSystem: string, Operating system name and version as reported by the OS. For example, "Mac OS X 10.10.4". The exact format is platform-dependent.
  clientInfo_platform: string, Platform where the application is running.
    Allowed values
      PLATFORM_UNSPECIFIED - Unspecified or unknown OS.
      EDITOR - Development environment.
      MAC_OS - macOS.
      WINDOWS - Windows.
      LINUX - Linux
      ANDROID - Android
      IOS - iOS
      WEB_GL - WebGL.
  clientInfo_userId: string, Required. A client-generated user ID. The ID should be generated and persisted during the first user session or whenever a pre-existing ID is not found. The exact format is up to the client. This must be non-empty in a GetFeatureTileRequest (whether via the header or GetFeatureTileRequest.client_info).
  maxElevationResolutionCells: integer, The maximum allowed resolution for the returned elevation heightmap. Possible values: between 1 and 1024 (and not less than min_elevation_resolution_cells). Over-sized heightmaps will be non-uniformly down-sampled such that each edge is no longer than this value. Non-uniformity is chosen to maximise the amount of preserved data. For example: Original resolution: 100px (width) * 30px (height) max_elevation_resolution: 30 New resolution: 30px (width) * 30px (height)
  minElevationResolutionCells: integer,  api-linter: core::0131::request-unknown-fields=disabled aip.dev/not-precedent: Maintaining existing request parameter pattern. The minimum allowed resolution for the returned elevation heightmap. Possible values: between 0 and 1024 (and not more than max_elevation_resolution_cells). Zero is supported for backward compatibility. Under-sized heightmaps will be non-uniformly up-sampled such that each edge is no shorter than this value. Non-uniformity is chosen to maximise the amount of preserved data. For example: Original resolution: 30px (width) * 10px (height) min_elevation_resolution: 30 New resolution: 30px (width) * 30px (height)
  terrainFormats: string, Terrain formats that the client understands. (repeated)
    Allowed values
      TERRAIN_FORMAT_UNKNOWN - An unknown or unspecified terrain format.
      FIRST_DERIVATIVE - Terrain elevation data encoded as a FirstDerivativeElevationGrid. .
      SECOND_DERIVATIVE - Terrain elevation data encoded as a SecondDerivativeElevationGrid.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A tile containing information about the terrain located in the region it covers.
  "coordinates": { # Global tile coordinates. Global tile coordinates reference a specific tile on the map at a specific zoom level. The origin of this coordinate system is always at the northwest corner of the map, with x values increasing from west to east and y values increasing from north to south. Tiles are indexed using x, y coordinates from that origin. The zoom level containing the entire world in a tile is 0, and it increases as you zoom in. Zoom level n + 1 will contain 4 times as many tiles as zoom level n. The zoom level controls the level of detail of the data that is returned. In particular, this affects the set of feature types returned, their density, and geometry simplification. The exact tile contents may change over time, but care will be taken to keep supporting the most important use cases. For example, zoom level 15 shows roads for orientation and planning in the local neighborhood and zoom level 17 shows buildings to give users on foot a sense of situational awareness. # The global tile coordinates that uniquely identify this tile.
    "x": 42, # Required. The x coordinate.
    "y": 42, # Required. The y coordinate.
    "zoom": 42, # Required. The Google Maps API zoom level.
  },
  "firstDerivative": { # A packed representation of a 2D grid of uniformly spaced points containing elevation data. Each point within the grid represents the altitude in meters above average sea level at that location within the tile. Elevations provided are (generally) relative to the EGM96 geoid, however some areas will be relative to NAVD88. EGM96 and NAVD88 are off by no more than 2 meters. The grid is oriented north-west to south-east, as illustrated: rows[0].a[0] rows[0].a[m] +-----------------+ | | | N | | ^ | | | | | W <-----> E | | | | | v | | S | | | +-----------------+ rows[n].a[0] rows[n].a[m] Rather than storing the altitudes directly, we store the diffs between them as integers at some requested level of precision to take advantage of integer packing. The actual altitude values a[] can be reconstructed using the scale and each row's first_altitude and altitude_diff fields. More details in go/elevation-encoding-options-for-enduro under "Recommended implementation". # Terrain elevation data encoded as a FirstDerivativeElevationGrid. cs/symbol:FirstDerivativeElevationGrid.
    "altitudeMultiplier": 3.14, # A multiplier applied to the altitude fields below to extract the actual altitudes in meters from the elevation grid.
    "rows": [ # Rows of points containing altitude data making up the elevation grid. Each row is the same length. Rows are ordered from north to south. E.g: rows[0] is the north-most row, and rows[n] is the south-most row.
      { # A row of altitude points in the elevation grid, ordered from west to east.
        "altitudeDiffs": [ # The difference between each successive pair of altitudes, from west to east. The first, westmost point, is just the altitude rather than a diff. The units are specified by the altitude_multiplier parameter above; the value in meters is given by altitude_multiplier * altitude_diffs[n]. The altitude row (in metres above sea level) can be reconstructed with: a[0] = altitude_diffs[0] * altitude_multiplier when n > 0, a[n] = a[n-1] + altitude_diffs[n-1] * altitude_multiplier.
          42,
        ],
      },
    ],
  },
  "name": "A String", # Resource name of the tile. The tile resource name is prefixed by its collection ID `terrain/` followed by the resource ID, which encodes the tile's global x and y coordinates and zoom level as `@,,z`. For example, `terrain/@1,2,3z`.
  "secondDerivative": { # A packed representation of a 2D grid of uniformly spaced points containing elevation data. Each point within the grid represents the altitude in meters above average sea level at that location within the tile. Elevations provided are (generally) relative to the EGM96 geoid, however some areas will be relative to NAVD88. EGM96 and NAVD88 are off by no more than 2 meters. The grid is oriented north-west to south-east, as illustrated: rows[0].a[0] rows[0].a[m] +-----------------+ | | | N | | ^ | | | | | W <-----> E | | | | | v | | S | | | +-----------------+ rows[n].a[0] rows[n].a[m] Rather than storing the altitudes directly, we store the diffs of the diffs between them as integers at some requested level of precision to take advantage of integer packing. Note that the data is packed in such a way that is fast to decode in Unity and that further optimizes wire size. # Terrain elevation data encoded as a SecondDerivativeElevationGrid. cs/symbol:SecondDerivativeElevationGrid. See go/byte-encoded-terrain for more details.
    "altitudeMultiplier": 3.14, # A multiplier applied to the elements in the encoded data to extract the actual altitudes in meters.
    "columnCount": 42, # The number of columns included in the encoded elevation data (i.e. the horizontal resolution of the grid).
    "encodedData": "A String", # A stream of elements each representing a point on the tile running across each row from left to right, top to bottom. There will be precisely horizontal_resolution * vertical_resolution elements in the stream. The elements are not the heights, rather the second order derivative of the values one would expect in a stream of height data. Each element is a varint with the following encoding: ------------------------------------------------------------------------| | Head Nibble | ------------------------------------------------------------------------| | Bit 0 | Bit 1 | Bits 2-3 | | Terminator| Sign (1=neg) | Least significant 2 bits of absolute error | ------------------------------------------------------------------------| | Tail Nibble #1 | ------------------------------------------------------------------------| | Bit 0 | Bit 1-3 | | Terminator| Least significant 3 bits of absolute error | ------------------------------------------------------------------------| | ... | Tail Nibble #n | ------------------------------------------------------------------------| | Bit 0 | Bit 1-3 | | Terminator| Least significant 3 bits of absolute error | ------------------------------------------------------------------------|
    "rowCount": 42, # The number of rows included in the encoded elevation data (i.e. the vertical resolution of the grid).
  },
}