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 andhigh.longitude
= 180 degrees, the viewport includes all longitudes. - If
low.longitude
= 180 degrees andhigh.longitude
= -180 degrees, the longitude range is empty. - If
low.latitude
>high.latitude
, the latitude range is empty. Bothlow
andhigh
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
Inheritance
Object > AbstractMessageLite<MessageType,BuilderType> > AbstractMessage > GeneratedMessageV3 > ViewportImplements
ViewportOrBuilderStatic Fields
HIGH_FIELD_NUMBER
public static final int HIGH_FIELD_NUMBER
Type | Description |
int |
LOW_FIELD_NUMBER
public static final int LOW_FIELD_NUMBER
Type | Description |
int |
Static Methods
getDefaultInstance()
public static Viewport getDefaultInstance()
Type | Description |
Viewport |
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Type | Description |
Descriptor |
newBuilder()
public static Viewport.Builder newBuilder()
Type | Description |
Viewport.Builder |
newBuilder(Viewport prototype)
public static Viewport.Builder newBuilder(Viewport prototype)
Name | Description |
prototype | Viewport |
Type | Description |
Viewport.Builder |
parseDelimitedFrom(InputStream input)
public static Viewport parseDelimitedFrom(InputStream input)
Name | Description |
input | InputStream |
Type | Description |
Viewport |
Type | Description |
IOException |
parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public static Viewport parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Name | Description |
input | InputStream |
extensionRegistry | ExtensionRegistryLite |
Type | Description |
Viewport |
Type | Description |
IOException |
parseFrom(byte[] data)
public static Viewport parseFrom(byte[] data)
Name | Description |
data | byte[] |
Type | Description |
Viewport |
Type | Description |
InvalidProtocolBufferException |
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Viewport parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Name | Description |
data | byte[] |
extensionRegistry | ExtensionRegistryLite |
Type | Description |
Viewport |
Type | Description |
InvalidProtocolBufferException |
parseFrom(ByteString data)
public static Viewport parseFrom(ByteString data)
Name | Description |
data | ByteString |
Type | Description |
Viewport |
Type | Description |
InvalidProtocolBufferException |
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Viewport parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Name | Description |
data | ByteString |
extensionRegistry | ExtensionRegistryLite |
Type | Description |
Viewport |
Type | Description |
InvalidProtocolBufferException |
parseFrom(CodedInputStream input)
public static Viewport parseFrom(CodedInputStream input)
Name | Description |
input | CodedInputStream |
Type | Description |
Viewport |
Type | Description |
IOException |
parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static Viewport parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Name | Description |
input | CodedInputStream |
extensionRegistry | ExtensionRegistryLite |
Type | Description |
Viewport |
Type | Description |
IOException |
parseFrom(InputStream input)
public static Viewport parseFrom(InputStream input)
Name | Description |
input | InputStream |
Type | Description |
Viewport |
Type | Description |
IOException |
parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public static Viewport parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Name | Description |
input | InputStream |
extensionRegistry | ExtensionRegistryLite |
Type | Description |
Viewport |
Type | Description |
IOException |
parseFrom(ByteBuffer data)
public static Viewport parseFrom(ByteBuffer data)
Name | Description |
data | ByteBuffer |
Type | Description |
Viewport |
Type | Description |
InvalidProtocolBufferException |
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Viewport parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Name | Description |
data | ByteBuffer |
extensionRegistry | ExtensionRegistryLite |
Type | Description |
Viewport |
Type | Description |
InvalidProtocolBufferException |
parser()
public static Parser<Viewport> parser()
Type | Description |
Parser<Viewport> |
Methods
equals(Object obj)
public boolean equals(Object obj)
Name | Description |
obj | Object |
Type | Description |
boolean |
getDefaultInstanceForType()
public Viewport getDefaultInstanceForType()
Type | Description |
Viewport |
getHigh()
public LatLng getHigh()
Required. The high point of the viewport.
.google.type.LatLng high = 2;
Type | Description |
LatLng | The high. |
getHighOrBuilder()
public LatLngOrBuilder getHighOrBuilder()
Required. The high point of the viewport.
.google.type.LatLng high = 2;
Type | Description |
LatLngOrBuilder |
getLow()
public LatLng getLow()
Required. The low point of the viewport.
.google.type.LatLng low = 1;
Type | Description |
LatLng | The low. |
getLowOrBuilder()
public LatLngOrBuilder getLowOrBuilder()
Required. The low point of the viewport.
.google.type.LatLng low = 1;
Type | Description |
LatLngOrBuilder |
getParserForType()
public Parser<Viewport> getParserForType()
Type | Description |
Parser<Viewport> |
getSerializedSize()
public int getSerializedSize()
Type | Description |
int |
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Type | Description |
UnknownFieldSet |
hasHigh()
public boolean hasHigh()
Required. The high point of the viewport.
.google.type.LatLng high = 2;
Type | Description |
boolean | Whether the high field is set. |
hasLow()
public boolean hasLow()
Required. The low point of the viewport.
.google.type.LatLng low = 1;
Type | Description |
boolean | Whether the low field is set. |
hashCode()
public int hashCode()
Type | Description |
int |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Type | Description |
FieldAccessorTable |
isInitialized()
public final boolean isInitialized()
Type | Description |
boolean |
newBuilderForType()
public Viewport.Builder newBuilderForType()
Type | Description |
Viewport.Builder |
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Viewport.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Name | Description |
parent | BuilderParent |
Type | Description |
Viewport.Builder |
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Name | Description |
unused | UnusedPrivateParameter |
Type | Description |
Object |
toBuilder()
public Viewport.Builder toBuilder()
Type | Description |
Viewport.Builder |
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Name | Description |
output | CodedOutputStream |
Type | Description |
IOException |