public final class Viewport extends GeneratedMessageV3 implements ViewportOrBuilder
A latitude-longitude viewport, represented as two diagonally opposite low
and high
points. A viewport is considered a closed region, i.e. it includes
its boundary. The latitude bounds must range between -90 to 90 degrees
inclusive, and the longitude bounds must range between -180 to 180 degrees
inclusive. Various cases include:
If low
= high
, the viewport consists of that single point.
If low.longitude
> high.longitude
, the longitude range is inverted
(the viewport crosses the 180 degree longitude line).
If low.longitude
= -180 degrees and high.longitude
= 180 degrees,
the viewport includes all longitudes.
If low.longitude
= 180 degrees and high.longitude
= -180 degrees,
the longitude range is empty.
If low.latitude
> high.latitude
, the latitude range is empty.
Both low
and high
must be populated, and the represented box cannot be
empty (as specified by the definitions above). An empty viewport will result
in an error.
For example, this viewport fully encloses New York City:
{
"low": {
"latitude": 40.477398,
"longitude": -74.259087
},
"high": {
"latitude": 40.91618,
"longitude": -73.70018
}
}
Protobuf type google.geo.type.Viewport
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
Static Fields
HIGH_FIELD_NUMBER
public static final int HIGH_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
LOW_FIELD_NUMBER
public static final int LOW_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
Static Methods
getDefaultInstance()
public static Viewport getDefaultInstance()
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
newBuilder()
public static Viewport.Builder newBuilder()
newBuilder(Viewport prototype)
public static Viewport.Builder newBuilder(Viewport prototype)
Parameter |
Name |
Description |
prototype |
Viewport
|
public static Viewport parseDelimitedFrom(InputStream input)
public static Viewport parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(byte[] data)
public static Viewport parseFrom(byte[] data)
Parameter |
Name |
Description |
data |
byte[]
|
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Viewport parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteString data)
public static Viewport parseFrom(ByteString data)
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Viewport parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Viewport parseFrom(CodedInputStream input)
public static Viewport parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static Viewport parseFrom(InputStream input)
public static Viewport parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteBuffer data)
public static Viewport parseFrom(ByteBuffer data)
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Viewport parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
parser()
public static Parser<Viewport> parser()
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter |
Name |
Description |
obj |
Object
|
Overrides
getDefaultInstanceForType()
public Viewport getDefaultInstanceForType()
getHigh()
Required. The high point of the viewport.
.google.type.LatLng high = 2;
Returns |
Type |
Description |
LatLng |
The high.
|
getHighOrBuilder()
public LatLngOrBuilder getHighOrBuilder()
Required. The high point of the viewport.
.google.type.LatLng high = 2;
getLow()
Required. The low point of the viewport.
.google.type.LatLng low = 1;
Returns |
Type |
Description |
LatLng |
The low.
|
getLowOrBuilder()
public LatLngOrBuilder getLowOrBuilder()
Required. The low point of the viewport.
.google.type.LatLng low = 1;
getParserForType()
public Parser<Viewport> getParserForType()
Overrides
getSerializedSize()
public int getSerializedSize()
Returns |
Type |
Description |
int |
|
Overrides
hasHigh()
Required. The high point of the viewport.
.google.type.LatLng high = 2;
Returns |
Type |
Description |
boolean |
Whether the high field is set.
|
hasLow()
Required. The low point of the viewport.
.google.type.LatLng low = 1;
Returns |
Type |
Description |
boolean |
Whether the low field is set.
|
hashCode()
Returns |
Type |
Description |
int |
|
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
newBuilderForType()
public Viewport.Builder newBuilderForType()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Viewport.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Returns |
Type |
Description |
Object |
|
Overrides
toBuilder()
public Viewport.Builder toBuilder()
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Overrides