Merge pull request #1331 from jcanizales/use-protos-main-repo

Updates the sample ObjC app to use protocol buffer messages
pull/1336/head
Michael Lumish 10 years ago
commit e00bd9c8e0
  1. 1
      src/objective-c/examples/Sample/Podfile
  2. 35
      src/objective-c/examples/Sample/SampleTests/SampleTests.m
  3. 387
      src/objective-c/examples/Sample/protos/Route_guide.pb.h
  4. 1435
      src/objective-c/examples/Sample/protos/Route_guide.pb.m
  5. 17
      src/objective-c/examples/Sample/protos/Route_guide.podspec
  6. 121
      src/objective-c/examples/Sample/protos/route_guide.proto

@ -2,6 +2,7 @@ source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
pod 'gRPC', :path => "../../../.."
pod 'Route_guide', :path => "protos"
link_with 'Sample', 'SampleTests'

@ -38,6 +38,7 @@
#import <gRPC/GRPCMethodName.h>
#import <gRPC/GRXWriter+Immediate.h>
#import <gRPC/GRXWriteable.h>
#import <Route_guide/Route_guide.pb.h>
@interface SampleTests : XCTestCase
@end
@ -101,4 +102,38 @@
[self waitForExpectationsWithTimeout:2.0 handler:nil];
}
- (void)testSimpleProtoRPC {
__weak XCTestExpectation *response = [self expectationWithDescription:@"Response received."];
__weak XCTestExpectation *expectedResponse =
[self expectationWithDescription:@"Expected response."];
__weak XCTestExpectation *completion = [self expectationWithDescription:@"RPC completed."];
GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:@"grpc.example.routeguide"
interface:@"RouteGuide"
method:@"GetFeature"];
RGDPoint *point = [[[[[RGDPointBuilder alloc] init] setLatitude:28E7] setLongitude:-15E7] build];
id<GRXWriter> requestsWriter = [GRXWriter writerWithValue:[point data]];
GRPCCall *call = [[GRPCCall alloc] initWithHost:@"127.0.0.1:8980"
method:method
requestsWriter:requestsWriter];
id<GRXWriteable> responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) {
XCTAssertNotNil(value, @"nil value received as response.");
[response fulfill];
RGDFeature *feature = [RGDFeature parseFromData:value];
XCTAssertEqualObjects(point, feature.location);
XCTAssertNotNil(feature.name, @"Response's name is nil.");
[expectedResponse fulfill];
} completionHandler:^(NSError *errorOrNil) {
XCTAssertNil(errorOrNil, @"Finished with unexpected error: %@", errorOrNil);
[completion fulfill];
}];
[call startWithWriteable:responsesWriteable];
[self waitForExpectationsWithTimeout:2.0 handler:nil];
}
@end

@ -0,0 +1,387 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
#import <ProtocolBuffers/ProtocolBuffers.h>
// @@protoc_insertion_point(imports)
@class ObjectiveCFileOptions;
@class ObjectiveCFileOptionsBuilder;
@class PBDescriptorProto;
@class PBDescriptorProtoBuilder;
@class PBDescriptorProtoExtensionRange;
@class PBDescriptorProtoExtensionRangeBuilder;
@class PBEnumDescriptorProto;
@class PBEnumDescriptorProtoBuilder;
@class PBEnumOptions;
@class PBEnumOptionsBuilder;
@class PBEnumValueDescriptorProto;
@class PBEnumValueDescriptorProtoBuilder;
@class PBEnumValueOptions;
@class PBEnumValueOptionsBuilder;
@class PBFieldDescriptorProto;
@class PBFieldDescriptorProtoBuilder;
@class PBFieldOptions;
@class PBFieldOptionsBuilder;
@class PBFileDescriptorProto;
@class PBFileDescriptorProtoBuilder;
@class PBFileDescriptorSet;
@class PBFileDescriptorSetBuilder;
@class PBFileOptions;
@class PBFileOptionsBuilder;
@class PBMessageOptions;
@class PBMessageOptionsBuilder;
@class PBMethodDescriptorProto;
@class PBMethodDescriptorProtoBuilder;
@class PBMethodOptions;
@class PBMethodOptionsBuilder;
@class PBOneofDescriptorProto;
@class PBOneofDescriptorProtoBuilder;
@class PBServiceDescriptorProto;
@class PBServiceDescriptorProtoBuilder;
@class PBServiceOptions;
@class PBServiceOptionsBuilder;
@class PBSourceCodeInfo;
@class PBSourceCodeInfoBuilder;
@class PBSourceCodeInfoLocation;
@class PBSourceCodeInfoLocationBuilder;
@class PBUninterpretedOption;
@class PBUninterpretedOptionBuilder;
@class PBUninterpretedOptionNamePart;
@class PBUninterpretedOptionNamePartBuilder;
@class RGDFeature;
@class RGDFeatureBuilder;
@class RGDPoint;
@class RGDPointBuilder;
@class RGDRectangle;
@class RGDRectangleBuilder;
@class RGDRouteNote;
@class RGDRouteNoteBuilder;
@class RGDRouteSummary;
@class RGDRouteSummaryBuilder;
@interface RGDRouteGuideRoot : NSObject {
}
+ (PBExtensionRegistry*) extensionRegistry;
+ (void) registerAllExtensions:(PBMutableExtensionRegistry*) registry;
@end
@interface RGDPoint : PBGeneratedMessage<GeneratedMessageProtocol> {
@private
BOOL hasLatitude_:1;
BOOL hasLongitude_:1;
SInt32 latitude;
SInt32 longitude;
}
- (BOOL) hasLatitude;
- (BOOL) hasLongitude;
@property (readonly) SInt32 latitude;
@property (readonly) SInt32 longitude;
+ (instancetype) defaultInstance;
- (instancetype) defaultInstance;
- (BOOL) isInitialized;
- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output;
- (RGDPointBuilder*) builder;
+ (RGDPointBuilder*) builder;
+ (RGDPointBuilder*) builderWithPrototype:(RGDPoint*) prototype;
- (RGDPointBuilder*) toBuilder;
+ (RGDPoint*) parseFromData:(NSData*) data;
+ (RGDPoint*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (RGDPoint*) parseFromInputStream:(NSInputStream*) input;
+ (RGDPoint*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (RGDPoint*) parseFromCodedInputStream:(PBCodedInputStream*) input;
+ (RGDPoint*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
@end
@interface RGDPointBuilder : PBGeneratedMessageBuilder {
@private
RGDPoint* resultPoint;
}
- (RGDPoint*) defaultInstance;
- (RGDPointBuilder*) clear;
- (RGDPointBuilder*) clone;
- (RGDPoint*) build;
- (RGDPoint*) buildPartial;
- (RGDPointBuilder*) mergeFrom:(RGDPoint*) other;
- (RGDPointBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input;
- (RGDPointBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
- (BOOL) hasLatitude;
- (SInt32) latitude;
- (RGDPointBuilder*) setLatitude:(SInt32) value;
- (RGDPointBuilder*) clearLatitude;
- (BOOL) hasLongitude;
- (SInt32) longitude;
- (RGDPointBuilder*) setLongitude:(SInt32) value;
- (RGDPointBuilder*) clearLongitude;
@end
@interface RGDRectangle : PBGeneratedMessage<GeneratedMessageProtocol> {
@private
BOOL hasLo_:1;
BOOL hasHi_:1;
RGDPoint* lo;
RGDPoint* hi;
}
- (BOOL) hasLo;
- (BOOL) hasHi;
@property (readonly, strong) RGDPoint* lo;
@property (readonly, strong) RGDPoint* hi;
+ (instancetype) defaultInstance;
- (instancetype) defaultInstance;
- (BOOL) isInitialized;
- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output;
- (RGDRectangleBuilder*) builder;
+ (RGDRectangleBuilder*) builder;
+ (RGDRectangleBuilder*) builderWithPrototype:(RGDRectangle*) prototype;
- (RGDRectangleBuilder*) toBuilder;
+ (RGDRectangle*) parseFromData:(NSData*) data;
+ (RGDRectangle*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (RGDRectangle*) parseFromInputStream:(NSInputStream*) input;
+ (RGDRectangle*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (RGDRectangle*) parseFromCodedInputStream:(PBCodedInputStream*) input;
+ (RGDRectangle*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
@end
@interface RGDRectangleBuilder : PBGeneratedMessageBuilder {
@private
RGDRectangle* resultRectangle;
}
- (RGDRectangle*) defaultInstance;
- (RGDRectangleBuilder*) clear;
- (RGDRectangleBuilder*) clone;
- (RGDRectangle*) build;
- (RGDRectangle*) buildPartial;
- (RGDRectangleBuilder*) mergeFrom:(RGDRectangle*) other;
- (RGDRectangleBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input;
- (RGDRectangleBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
- (BOOL) hasLo;
- (RGDPoint*) lo;
- (RGDRectangleBuilder*) setLo:(RGDPoint*) value;
- (RGDRectangleBuilder*) setLoBuilder:(RGDPointBuilder*) builderForValue;
- (RGDRectangleBuilder*) mergeLo:(RGDPoint*) value;
- (RGDRectangleBuilder*) clearLo;
- (BOOL) hasHi;
- (RGDPoint*) hi;
- (RGDRectangleBuilder*) setHi:(RGDPoint*) value;
- (RGDRectangleBuilder*) setHiBuilder:(RGDPointBuilder*) builderForValue;
- (RGDRectangleBuilder*) mergeHi:(RGDPoint*) value;
- (RGDRectangleBuilder*) clearHi;
@end
@interface RGDFeature : PBGeneratedMessage<GeneratedMessageProtocol> {
@private
BOOL hasName_:1;
BOOL hasLocation_:1;
NSString* name;
RGDPoint* location;
}
- (BOOL) hasName;
- (BOOL) hasLocation;
@property (readonly, strong) NSString* name;
@property (readonly, strong) RGDPoint* location;
+ (instancetype) defaultInstance;
- (instancetype) defaultInstance;
- (BOOL) isInitialized;
- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output;
- (RGDFeatureBuilder*) builder;
+ (RGDFeatureBuilder*) builder;
+ (RGDFeatureBuilder*) builderWithPrototype:(RGDFeature*) prototype;
- (RGDFeatureBuilder*) toBuilder;
+ (RGDFeature*) parseFromData:(NSData*) data;
+ (RGDFeature*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (RGDFeature*) parseFromInputStream:(NSInputStream*) input;
+ (RGDFeature*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (RGDFeature*) parseFromCodedInputStream:(PBCodedInputStream*) input;
+ (RGDFeature*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
@end
@interface RGDFeatureBuilder : PBGeneratedMessageBuilder {
@private
RGDFeature* resultFeature;
}
- (RGDFeature*) defaultInstance;
- (RGDFeatureBuilder*) clear;
- (RGDFeatureBuilder*) clone;
- (RGDFeature*) build;
- (RGDFeature*) buildPartial;
- (RGDFeatureBuilder*) mergeFrom:(RGDFeature*) other;
- (RGDFeatureBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input;
- (RGDFeatureBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
- (BOOL) hasName;
- (NSString*) name;
- (RGDFeatureBuilder*) setName:(NSString*) value;
- (RGDFeatureBuilder*) clearName;
- (BOOL) hasLocation;
- (RGDPoint*) location;
- (RGDFeatureBuilder*) setLocation:(RGDPoint*) value;
- (RGDFeatureBuilder*) setLocationBuilder:(RGDPointBuilder*) builderForValue;
- (RGDFeatureBuilder*) mergeLocation:(RGDPoint*) value;
- (RGDFeatureBuilder*) clearLocation;
@end
@interface RGDRouteNote : PBGeneratedMessage<GeneratedMessageProtocol> {
@private
BOOL hasMessage_:1;
BOOL hasLocation_:1;
NSString* message;
RGDPoint* location;
}
- (BOOL) hasLocation;
- (BOOL) hasMessage;
@property (readonly, strong) RGDPoint* location;
@property (readonly, strong) NSString* message;
+ (instancetype) defaultInstance;
- (instancetype) defaultInstance;
- (BOOL) isInitialized;
- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output;
- (RGDRouteNoteBuilder*) builder;
+ (RGDRouteNoteBuilder*) builder;
+ (RGDRouteNoteBuilder*) builderWithPrototype:(RGDRouteNote*) prototype;
- (RGDRouteNoteBuilder*) toBuilder;
+ (RGDRouteNote*) parseFromData:(NSData*) data;
+ (RGDRouteNote*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (RGDRouteNote*) parseFromInputStream:(NSInputStream*) input;
+ (RGDRouteNote*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (RGDRouteNote*) parseFromCodedInputStream:(PBCodedInputStream*) input;
+ (RGDRouteNote*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
@end
@interface RGDRouteNoteBuilder : PBGeneratedMessageBuilder {
@private
RGDRouteNote* resultRouteNote;
}
- (RGDRouteNote*) defaultInstance;
- (RGDRouteNoteBuilder*) clear;
- (RGDRouteNoteBuilder*) clone;
- (RGDRouteNote*) build;
- (RGDRouteNote*) buildPartial;
- (RGDRouteNoteBuilder*) mergeFrom:(RGDRouteNote*) other;
- (RGDRouteNoteBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input;
- (RGDRouteNoteBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
- (BOOL) hasLocation;
- (RGDPoint*) location;
- (RGDRouteNoteBuilder*) setLocation:(RGDPoint*) value;
- (RGDRouteNoteBuilder*) setLocationBuilder:(RGDPointBuilder*) builderForValue;
- (RGDRouteNoteBuilder*) mergeLocation:(RGDPoint*) value;
- (RGDRouteNoteBuilder*) clearLocation;
- (BOOL) hasMessage;
- (NSString*) message;
- (RGDRouteNoteBuilder*) setMessage:(NSString*) value;
- (RGDRouteNoteBuilder*) clearMessage;
@end
@interface RGDRouteSummary : PBGeneratedMessage<GeneratedMessageProtocol> {
@private
BOOL hasPointCount_:1;
BOOL hasFeatureCount_:1;
BOOL hasDistance_:1;
BOOL hasElapsedTime_:1;
SInt32 pointCount;
SInt32 featureCount;
SInt32 distance;
SInt32 elapsedTime;
}
- (BOOL) hasPointCount;
- (BOOL) hasFeatureCount;
- (BOOL) hasDistance;
- (BOOL) hasElapsedTime;
@property (readonly) SInt32 pointCount;
@property (readonly) SInt32 featureCount;
@property (readonly) SInt32 distance;
@property (readonly) SInt32 elapsedTime;
+ (instancetype) defaultInstance;
- (instancetype) defaultInstance;
- (BOOL) isInitialized;
- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output;
- (RGDRouteSummaryBuilder*) builder;
+ (RGDRouteSummaryBuilder*) builder;
+ (RGDRouteSummaryBuilder*) builderWithPrototype:(RGDRouteSummary*) prototype;
- (RGDRouteSummaryBuilder*) toBuilder;
+ (RGDRouteSummary*) parseFromData:(NSData*) data;
+ (RGDRouteSummary*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (RGDRouteSummary*) parseFromInputStream:(NSInputStream*) input;
+ (RGDRouteSummary*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (RGDRouteSummary*) parseFromCodedInputStream:(PBCodedInputStream*) input;
+ (RGDRouteSummary*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
@end
@interface RGDRouteSummaryBuilder : PBGeneratedMessageBuilder {
@private
RGDRouteSummary* resultRouteSummary;
}
- (RGDRouteSummary*) defaultInstance;
- (RGDRouteSummaryBuilder*) clear;
- (RGDRouteSummaryBuilder*) clone;
- (RGDRouteSummary*) build;
- (RGDRouteSummary*) buildPartial;
- (RGDRouteSummaryBuilder*) mergeFrom:(RGDRouteSummary*) other;
- (RGDRouteSummaryBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input;
- (RGDRouteSummaryBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
- (BOOL) hasPointCount;
- (SInt32) pointCount;
- (RGDRouteSummaryBuilder*) setPointCount:(SInt32) value;
- (RGDRouteSummaryBuilder*) clearPointCount;
- (BOOL) hasFeatureCount;
- (SInt32) featureCount;
- (RGDRouteSummaryBuilder*) setFeatureCount:(SInt32) value;
- (RGDRouteSummaryBuilder*) clearFeatureCount;
- (BOOL) hasDistance;
- (SInt32) distance;
- (RGDRouteSummaryBuilder*) setDistance:(SInt32) value;
- (RGDRouteSummaryBuilder*) clearDistance;
- (BOOL) hasElapsedTime;
- (SInt32) elapsedTime;
- (RGDRouteSummaryBuilder*) setElapsedTime:(SInt32) value;
- (RGDRouteSummaryBuilder*) clearElapsedTime;
@end
// @@protoc_insertion_point(global_scope)

File diff suppressed because it is too large Load Diff

@ -0,0 +1,17 @@
Pod::Spec.new do |s|
s.name = 'Route_guide'
s.version = '0.0.1'
s.summary = 'Protobuf library generated from route_guide.proto'
s.homepage = 'https://github.com/grpc/grpc/tree/master/src/objective-c/examples/Sample/protos'
s.license = 'New BSD'
s.authors = { 'Jorge Canizales' => 'jcanizales@google.com' }
s.source_files = '*.pb.{h,m}'
s.public_header_files = '*.pb.h'
s.platform = :ios
s.ios.deployment_target = '6.0'
s.requires_arc = true
s.dependency 'ProtocolBuffers', '~> 1.9'
end

@ -0,0 +1,121 @@
// Copyright 2015, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto2";
package grpc.example.routeguide;
import "google/protobuf/objectivec-descriptor.proto";
option (google.protobuf.objectivec_file_options).class_prefix = "RGD";
// Interface exported by the server.
service RouteGuide {
// A simple RPC.
//
// Obtains the feature at a given position.
rpc GetFeature(Point) returns (Feature) {}
// A server-to-client streaming RPC.
//
// Obtains the Features available within the given Rectangle. Results are
// streamed rather than returned at once (e.g. in a response message with a
// repeated field), as the rectangle may cover a large area and contain a
// huge number of features.
// rpc ListFeatures(Rectangle) returns (stream Feature) {}
// A client-to-server streaming RPC.
//
// Accepts a stream of Points on a route being traversed, returning a
// RouteSummary when traversal is completed.
// rpc RecordRoute(stream Point) returns (RouteSummary) {}
// A Bidirectional streaming RPC.
//
// Accepts a stream of RouteNotes sent while a route is being traversed,
// while receiving other RouteNotes (e.g. from other users).
// rpc RouteChat(stream RouteNote) returns (stream RouteNote) {}
}
// Points are represented as latitude-longitude pairs in the E7 representation
// (degrees multiplied by 10**7 and rounded to the nearest integer).
// Latitudes should be in the range +/- 90 degrees and longitude should be in
// the range +/- 180 degrees (inclusive).
message Point {
optional int32 latitude = 1;
optional int32 longitude = 2;
}
// A latitude-longitude rectangle, represented as two diagonally opposite
// points "lo" and "hi".
message Rectangle {
// One corner of the rectangle.
optional Point lo = 1;
// The other corner of the rectangle.
optional Point hi = 2;
}
// A feature names something at a given point.
//
// If a feature could not be named, the name is empty.
message Feature {
// The name of the feature.
optional string name = 1;
// The point where the feature is detected.
optional Point location = 2;
}
// A RouteNote is a message sent while at a given point.
message RouteNote {
// The location from which the message is sent.
optional Point location = 1;
// The message to be sent.
optional string message = 2;
}
// A RouteSummary is received in response to a RecordRoute rpc.
//
// It contains the number of individual points received, the number of
// detected features, and the total distance covered as the cumulative sum of
// the distance between each point.
message RouteSummary {
// The number of points received.
optional int32 point_count = 1;
// The number of known features passed while traversing the route.
optional int32 feature_count = 2;
// The distance covered in metres.
optional int32 distance = 3;
// The duration of the traversal in seconds.
optional int32 elapsed_time = 4;
}
Loading…
Cancel
Save