Package com.google.geo.type
Class Viewport
java.lang.Object
com.google.protobuf.AbstractMessageLite<MessageType,BuilderType>
com.google.protobuf.GeneratedMessageLite<Viewport,Viewport.Builder>
com.google.geo.type.Viewport
- All Implemented Interfaces:
ViewportOrBuilder,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder
public final class Viewport
extends com.google.protobuf.GeneratedMessageLite<Viewport,Viewport.Builder>
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-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA latitude-longitude viewport, represented as two diagonally opposite `low` and `high` points.Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageLite
com.google.protobuf.GeneratedMessageLite.DefaultInstanceBasedParser<T extends com.google.protobuf.GeneratedMessageLite<T,?>>, com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType, BuilderType>, BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType, BuilderType>>, com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType, BuilderType>, BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType, BuilderType>>, com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType, BuilderType>, BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType, BuilderType>>, com.google.protobuf.GeneratedMessageLite.GeneratedExtension<ContainingType extends com.google.protobuf.MessageLite, Type extends Object>, com.google.protobuf.GeneratedMessageLite.MethodToInvoke, com.google.protobuf.GeneratedMessageLite.SerializedForm Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessageLite
unknownFieldsFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionprotected final ObjectdynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1) static ViewportgetHigh()Required.getLow()Required.booleanhasHigh()Required.booleanhasLow()Required.static Viewport.Builderstatic Viewport.BuildernewBuilder(Viewport prototype) static ViewportparseDelimitedFrom(InputStream input) static ViewportparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static ViewportparseFrom(byte[] data) static ViewportparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static ViewportparseFrom(com.google.protobuf.ByteString data) static ViewportparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static ViewportparseFrom(com.google.protobuf.CodedInputStream input) static ViewportparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static ViewportparseFrom(InputStream input) static ViewportparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static ViewportparseFrom(ByteBuffer data) static ViewportparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<Viewport>parser()Methods inherited from class com.google.protobuf.GeneratedMessageLite
createBuilder, createBuilder, dynamicMethod, dynamicMethod, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, emptyProtobufList, equals, getDefaultInstanceForType, getParserForType, getSerializedSize, hashCode, isInitialized, isInitialized, makeImmutable, mergeLengthDelimitedField, mergeUnknownFields, mergeVarintField, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBuilderForType, newMessageInfo, newRepeatedGeneratedExtension, newSingularGeneratedExtension, parseDelimitedFrom, parseDelimitedFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parsePartialFrom, parseUnknownField, registerDefaultInstance, toBuilder, toString, writeToMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType, isInitialized
-
Field Details
-
LOW_FIELD_NUMBER
public static final int LOW_FIELD_NUMBER- See Also:
-
HIGH_FIELD_NUMBER
public static final int HIGH_FIELD_NUMBER- See Also:
-
-
Method Details
-
hasLow
public boolean hasLow()Required. The low point of the viewport.
.google.type.LatLng low = 1 [json_name = "low"];- Specified by:
hasLowin interfaceViewportOrBuilder- Returns:
- Whether the low field is set.
-
getLow
Required. The low point of the viewport.
.google.type.LatLng low = 1 [json_name = "low"];- Specified by:
getLowin interfaceViewportOrBuilder- Returns:
- The low.
-
hasHigh
public boolean hasHigh()Required. The high point of the viewport.
.google.type.LatLng high = 2 [json_name = "high"];- Specified by:
hasHighin interfaceViewportOrBuilder- Returns:
- Whether the high field is set.
-
getHigh
Required. The high point of the viewport.
.google.type.LatLng high = 2 [json_name = "high"];- Specified by:
getHighin interfaceViewportOrBuilder- Returns:
- The high.
-
parseFrom
public static Viewport parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Viewport parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Viewport parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Viewport parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Viewport parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Viewport parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static Viewport parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static Viewport parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static Viewport parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilder
-
newBuilder
-
dynamicMethod
protected final Object dynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1) - Specified by:
dynamicMethodin classcom.google.protobuf.GeneratedMessageLite<Viewport,Viewport.Builder>
-
getDefaultInstance
-
parser
-