Class: Google::Apis::VectortileV1::SecondDerivativeElevationGrid

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/vectortile_v1/classes.rb,
generated/google/apis/vectortile_v1/representations.rb,
generated/google/apis/vectortile_v1/representations.rb

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ SecondDerivativeElevationGrid

Returns a new instance of SecondDerivativeElevationGrid.



618
619
620
# File 'generated/google/apis/vectortile_v1/classes.rb', line 618

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#altitude_multiplierFloat

A multiplier applied to the elements in the encoded data to extract the actual altitudes in meters. Corresponds to the JSON property altitudeMultiplier

Returns:

  • (Float)


583
584
585
# File 'generated/google/apis/vectortile_v1/classes.rb', line 583

def altitude_multiplier
  @altitude_multiplier
end

#column_countFixnum

The number of columns included in the encoded elevation data (i.e. the horizontal resolution of the grid). Corresponds to the JSON property columnCount

Returns:

  • (Fixnum)


589
590
591
# File 'generated/google/apis/vectortile_v1/classes.rb', line 589

def column_count
  @column_count
end

#encoded_dataString

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 | -- ----------------------------------------------------------------------| Corresponds to the JSON property encodedData NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)


610
611
612
# File 'generated/google/apis/vectortile_v1/classes.rb', line 610

def encoded_data
  @encoded_data
end

#row_countFixnum

The number of rows included in the encoded elevation data (i.e. the vertical resolution of the grid). Corresponds to the JSON property rowCount

Returns:

  • (Fixnum)


616
617
618
# File 'generated/google/apis/vectortile_v1/classes.rb', line 616

def row_count
  @row_count
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



623
624
625
626
627
628
# File 'generated/google/apis/vectortile_v1/classes.rb', line 623

def update!(**args)
  @altitude_multiplier = args[:altitude_multiplier] if args.key?(:altitude_multiplier)
  @column_count = args[:column_count] if args.key?(:column_count)
  @encoded_data = args[:encoded_data] if args.key?(:encoded_data)
  @row_count = args[:row_count] if args.key?(:row_count)
end