-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
vectortile-gen.go
1940 lines (1752 loc) · 84.8 KB
/
vectortile-gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2021 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package vectortile provides access to the Semantic Tile API.
//
// For product documentation, see: https://developers.google.com/maps/contact-sales/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/vectortile/v1"
// ...
// ctx := context.Background()
// vectortileService, err := vectortile.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// vectortileService, err := vectortile.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// vectortileService, err := vectortile.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package vectortile // import "google.golang.org/api/vectortile/v1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
const apiId = "vectortile:v1"
const apiName = "vectortile"
const apiVersion = "v1"
const basePath = "https://vectortile.googleapis.com/"
const mtlsBasePath = "https://vectortile.mtls.googleapis.com/"
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Featuretiles = NewFeaturetilesService(s)
s.Terraintiles = NewTerraintilesService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Featuretiles *FeaturetilesService
Terraintiles *TerraintilesService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewFeaturetilesService(s *Service) *FeaturetilesService {
rs := &FeaturetilesService{s: s}
return rs
}
type FeaturetilesService struct {
s *Service
}
func NewTerraintilesService(s *Service) *TerraintilesService {
rs := &TerraintilesService{s: s}
return rs
}
type TerraintilesService struct {
s *Service
}
// Area: Represents an area. Used to represent regions such as water,
// parks, etc. Next ID: 10
type Area struct {
// BasemapZOrder: The z-order of this geometry when rendered on a flat
// basemap. Geometry with a lower z-order should be rendered beneath
// geometry with a higher z-order. This z-ordering does not imply
// anything about the altitude of the area relative to the ground, but
// it can be used to prevent z-fighting. Unlike Area.z_order this can be
// used to compare with Line.basemap_z_order, and in fact may yield more
// accurate rendering (where a line may be rendered beneath an area).
BasemapZOrder *BasemapZOrder `json:"basemapZOrder,omitempty"`
// HasExternalEdges: True if the polygon is not entirely internal to the
// feature that it belongs to: that is, some of the edges are bordering
// another feature.
HasExternalEdges bool `json:"hasExternalEdges,omitempty"`
// InternalEdges: When has_external_edges is true, the polygon has some
// edges that border another feature. This field indicates the internal
// edges that do not border another feature. Each value is an index into
// the vertices array, and denotes the start vertex of the internal edge
// (the next vertex in the boundary loop is the end of the edge). If the
// selected vertex is the last vertex in the boundary loop, then the
// edge between that vertex and the starting vertex of the loop is
// internal. This field may be used for styling. For example, building
// parapets could be placed only on the external edges of a building
// polygon, or water could be lighter colored near the external edges of
// a body of water. If has_external_edges is false, all edges are
// internal and this field will be empty.
InternalEdges []int64 `json:"internalEdges,omitempty"`
// LoopBreaks: Identifies the boundary loops of the polygon. Only set
// for INDEXED_TRIANGLE polygons. Each value is an index into the
// vertices array indicating the beginning of a loop. For instance,
// values of [2, 5] would indicate loop_data contained 3 loops with
// indices 0-1, 2-4, and 5-end. This may be used in conjunction with the
// internal_edges field for styling polygon boundaries. Note that an
// edge may be on a polygon boundary but still internal to the feature.
// For example, a feature split across multiple tiles will have an
// internal polygon boundary edge along the edge of the tile.
LoopBreaks []int64 `json:"loopBreaks,omitempty"`
// TriangleIndices: When the polygon encoding is of type
// INDEXED_TRIANGLES, this contains the indices of the triangle vertices
// in the vertex_offsets field. There are 3 vertex indices per triangle.
TriangleIndices []int64 `json:"triangleIndices,omitempty"`
// Type: The polygon encoding type used for this area.
//
// Possible values:
// "TRIANGLE_FAN" - The first vertex in vertex_offset is the center of
// a triangle fan. The other vertices are arranged around this vertex in
// a fan shape. The following diagram showes a triangle fan polygon with
// the vertices labelled with their indices in the vertex_offset list.
// Triangle fan polygons always have a single boundary loop. Vertices
// may be in either a clockwise or counterclockwise order. (1) / \ / \ /
// \ (0)-----(2) / \ / / \ / / \ / (4)-----(3)
// "INDEXED_TRIANGLES" - The polygon is a set of triangles with three
// vertex indices per triangle. The vertex indices can be found in the
// triangle_indices field. Indexed triangle polygons also contain
// information about boundary loops. These identify the loops at the
// boundary of the polygon and may be used in conjunction with the
// internal_edges field for styling. Boundary loops may represent either
// a hole or a disconnected component of the polygon. The following
// diagram shows an indexed triangle polygon with two boundary loops.
// (0) (4) / \ / \ / \ / \ (1)----(2) (3)----(5)
// "TRIANGLE_STRIP" - A strip of triangles, where each triangle uses
// the last edge of the previous triangle. Vertices may be in either a
// clockwise or counterclockwise order. Only polygons without the
// has_external_edges flag set will use triangle strips. (0) / \ / \ / \
// (2)-----(1) / \ / / \ / / \ / (4)-----(3)
Type string `json:"type,omitempty"`
// VertexOffsets: The vertices present in the polygon defining the area.
VertexOffsets *Vertex2DList `json:"vertexOffsets,omitempty"`
// ZOrder: The z-ordering of this area. Areas with a lower z-order
// should be rendered beneath areas with a higher z-order. This
// z-ordering does not imply anything about the altitude of the line
// relative to the ground, but it can be used to prevent z-fighting
// during rendering on the client. This z-ordering can only be used to
// compare areas, and cannot be compared with the z_order field in the
// Line message. The z-order may be negative or zero. Prefer
// Area.basemap_z_order.
ZOrder int64 `json:"zOrder,omitempty"`
// ForceSendFields is a list of field names (e.g. "BasemapZOrder") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BasemapZOrder") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Area) MarshalJSON() ([]byte, error) {
type NoMethod Area
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BasemapZOrder: Metadata necessary to determine the ordering of a
// particular basemap element relative to others. To render the basemap
// correctly, sort by z-plane, then z-grade, then z-within-grade.
type BasemapZOrder struct {
// ZGrade: The second most significant component of the ordering of a
// component to be rendered onto the basemap.
ZGrade int64 `json:"zGrade,omitempty"`
// ZPlane: The most significant component of the ordering of a component
// to be rendered onto the basemap.
ZPlane int64 `json:"zPlane,omitempty"`
// ZWithinGrade: The least significant component of the ordering of a
// component to be rendered onto the basemap.
ZWithinGrade int64 `json:"zWithinGrade,omitempty"`
// ForceSendFields is a list of field names (e.g. "ZGrade") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ZGrade") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BasemapZOrder) MarshalJSON() ([]byte, error) {
type NoMethod BasemapZOrder
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ExtrudedArea: Represents a height-extruded area: a 3D prism with a
// constant X-Y plane cross section. Used to represent extruded
// buildings. A single building may consist of several extruded areas.
// The min_z and max_z fields are scaled to the size of the tile. An
// extruded area with a max_z value of 4096 has the same height as the
// width of the tile that it is on.
type ExtrudedArea struct {
// Area: The area representing the footprint of the extruded area.
Area *Area `json:"area,omitempty"`
// MaxZ: The z-value in local tile coordinates where the extruded area
// ends.
MaxZ int64 `json:"maxZ,omitempty"`
// MinZ: The z-value in local tile coordinates where the extruded area
// begins. This is non-zero for extruded areas that begin off the
// ground. For example, a building with a skybridge may have an extruded
// area component with a non-zero min_z.
MinZ int64 `json:"minZ,omitempty"`
// ForceSendFields is a list of field names (e.g. "Area") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Area") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ExtrudedArea) MarshalJSON() ([]byte, error) {
type NoMethod ExtrudedArea
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Feature: A feature representing a single geographic entity.
type Feature struct {
// DisplayName: The localized name of this feature. Currently only
// returned for roads.
DisplayName string `json:"displayName,omitempty"`
// Geometry: The geometry of this feature, representing the space that
// it occupies in the world.
Geometry *Geometry `json:"geometry,omitempty"`
// PlaceId: Place ID of this feature, suitable for use in Places API
// details requests.
PlaceId string `json:"placeId,omitempty"`
// Relations: Relations to other features.
Relations []*Relation `json:"relations,omitempty"`
// SegmentInfo: Metadata for features with the SEGMENT FeatureType.
SegmentInfo *SegmentInfo `json:"segmentInfo,omitempty"`
// Type: The type of this feature.
//
// Possible values:
// "FEATURE_TYPE_UNSPECIFIED" - Unknown feature type.
// "STRUCTURE" - Structures such as buildings and bridges.
// "BAR" - A business serving alcoholic drinks to be consumed onsite.
// "BANK" - A financial institution that offers services to the
// general public.
// "LODGING" - A place that provides any type of lodging for
// travelers.
// "CAFE" - A business that sells coffee, tea, and sometimes small
// meals.
// "RESTAURANT" - A business that prepares meals on-site for service
// to customers.
// "EVENT_VENUE" - A venue for private and public events.
// "TOURIST_DESTINATION" - Place of interest to tourists, typically
// for natural or cultural value.
// "SHOPPING" - A structure containing a business or businesses that
// sell goods.
// "SCHOOL" - Institution where young people receive general (not
// vocation or professional) education.
// "SEGMENT" - Segments such as roads and train lines.
// "ROAD" - A way leading from one place to another intended for use
// by vehicles.
// "LOCAL_ROAD" - A small city street, typically for travel in a
// residential neighborhood.
// "ARTERIAL_ROAD" - Major through road that's expected to carry large
// volumes of traffic.
// "HIGHWAY" - A major road including freeways and state highways.
// "CONTROLLED_ACCESS_HIGHWAY" - A highway with grade-separated
// crossings that is accessed exclusively by ramps. These are usually
// called "freeways" or "motorways". The enable_detailed_highway_types
// request flag must be set in order for this type to be returned.
// "FOOTPATH" - A path that's primarily intended for use by
// pedestrians and/or cyclists.
// "RAIL" - Tracks intended for use by trains.
// "FERRY" - Services which are part of the road network but are not
// roads.
// "REGION" - Non-water areas such as parks and forest.
// "PARK" - Outdoor areas such as parks and botanical gardens.
// "BEACH" - A pebbly or sandy shore along the edge of a sea or lake.
// "FOREST" - Area of land covered by trees.
// "POLITICAL" - Political entities, such as provinces and districts.
// "ADMINISTRATIVE_AREA1" - Top-level divisions within a country, such
// as prefectures or states.
// "LOCALITY" - Cities, towns, and other municipalities.
// "SUBLOCALITY" - Divisions within a locality like a borough or ward.
// "WATER" - Water features such as rivers and lakes.
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "DisplayName") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DisplayName") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Feature) MarshalJSON() ([]byte, error) {
type NoMethod Feature
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// FeatureTile: A tile containing information about the map features
// located in the region it covers.
type FeatureTile struct {
// Coordinates: The global tile coordinates that uniquely identify this
// tile.
Coordinates *TileCoordinates `json:"coordinates,omitempty"`
// Features: Features present on this map tile.
Features []*Feature `json:"features,omitempty"`
// Name: Resource name of the tile. The tile resource name is prefixed
// by its collection ID `tiles/` followed by the resource ID, which
// encodes the tile's global x and y coordinates and zoom level as
// `@,,z`. For example, `tiles/@1,2,3z`.
Name string `json:"name,omitempty"`
// Providers: Data providers for the data contained in this tile.
Providers []*ProviderInfo `json:"providers,omitempty"`
// Status: Tile response status code to support tile caching.
//
// Possible values:
// "STATUS_OK" - Everything worked out OK. The cache-control header
// determines how long this Tile response may be cached by the client.
// See also version_id and STATUS_OK_DATA_UNCHANGED.
// "STATUS_OK_DATA_UNCHANGED" - Indicates that the request was
// processed successfully and that the tile data that would have been
// returned are identical to the data already in the client's cache, as
// specified by the value of client_tile_version_id contained in
// GetFeatureTileRequest. In particular, the tile's features and
// providers will not be populated when the tile data is identical.
// However, the cache-control header and version_id can still change
// even when the tile contents itself does not, so clients should always
// use the most recent values returned by the API.
Status string `json:"status,omitempty"`
// VersionId: An opaque value, usually less than 30 characters, that
// contains version info about this tile and the data that was used to
// generate it. The client should store this value in its tile cache and
// pass it back to the API in the client_tile_version_id field of
// subsequent tile requests in order to enable the API to detect when
// the new tile would be the same as the one the client already has in
// its cache. Also see STATUS_OK_DATA_UNCHANGED.
VersionId string `json:"versionId,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Coordinates") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Coordinates") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *FeatureTile) MarshalJSON() ([]byte, error) {
type NoMethod FeatureTile
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// FirstDerivativeElevationGrid: 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
// between them as integers at some requested level of precision to take
// advantage of integer packing. The actual altitude values a[] can be
// reconstructed using the scale and each row's first_altitude and
// altitude_diff fields. More details in
// go/elevation-encoding-options-for-enduro under "Recommended
// implementation".
type FirstDerivativeElevationGrid struct {
// AltitudeMultiplier: A multiplier applied to the altitude fields below
// to extract the actual altitudes in meters from the elevation grid.
AltitudeMultiplier float64 `json:"altitudeMultiplier,omitempty"`
// Rows: Rows of points containing altitude data making up the elevation
// grid. Each row is the same length. Rows are ordered from north to
// south. E.g: rows[0] is the north-most row, and rows[n] is the
// south-most row.
Rows []*Row `json:"rows,omitempty"`
// ForceSendFields is a list of field names (e.g. "AltitudeMultiplier")
// to unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AltitudeMultiplier") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *FirstDerivativeElevationGrid) MarshalJSON() ([]byte, error) {
type NoMethod FirstDerivativeElevationGrid
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *FirstDerivativeElevationGrid) UnmarshalJSON(data []byte) error {
type NoMethod FirstDerivativeElevationGrid
var s1 struct {
AltitudeMultiplier gensupport.JSONFloat64 `json:"altitudeMultiplier"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.AltitudeMultiplier = float64(s1.AltitudeMultiplier)
return nil
}
// Geometry: Represents the geometry of a feature, that is, the shape
// that it has on the map. The local tile coordinate system has the
// origin at the north-west (upper-left) corner of the tile, and is
// scaled to 4096 units across each edge. The height (Z) axis has the
// same scale factor: an extruded area with a max_z value of 4096 has
// the same height as the width of the tile that it is on. There is no
// clipping boundary, so it is possible that some coordinates will lie
// outside the tile boundaries.
type Geometry struct {
// Areas: The areas present in this geometry.
Areas []*Area `json:"areas,omitempty"`
// ExtrudedAreas: The extruded areas present in this geometry. Not
// populated if modeled_volumes are included in this geometry unless
// always_include_building_footprints is set in GetFeatureTileRequest,
// in which case the client should decide which (extruded areas or
// modeled volumes) should be used (they should not be rendered
// together).
ExtrudedAreas []*ExtrudedArea `json:"extrudedAreas,omitempty"`
// Lines: The lines present in this geometry.
Lines []*Line `json:"lines,omitempty"`
// ModeledVolumes: The modeled volumes present in this geometry. Not
// populated unless enable_modeled_volumes has been set in
// GetFeatureTileRequest.
ModeledVolumes []*ModeledVolume `json:"modeledVolumes,omitempty"`
// ForceSendFields is a list of field names (e.g. "Areas") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Areas") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Geometry) MarshalJSON() ([]byte, error) {
type NoMethod Geometry
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Line: Represents a 2D polyline. Used to represent segments such as
// roads, train tracks, etc.
type Line struct {
// BasemapZOrder: The z-order of this geometry when rendered on a flat
// basemap. Geometry with a lower z-order should be rendered beneath
// geometry with a higher z-order. This z-ordering does not imply
// anything about the altitude of the area relative to the ground, but
// it can be used to prevent z-fighting. Unlike Line.z_order this can be
// used to compare with Area.basemap_z_order, and in fact may yield more
// accurate rendering (where a line may be rendered beneath an area).
BasemapZOrder *BasemapZOrder `json:"basemapZOrder,omitempty"`
// VertexOffsets: The vertices present in the polyline.
VertexOffsets *Vertex2DList `json:"vertexOffsets,omitempty"`
// ZOrder: The z-order of the line. Lines with a lower z-order should be
// rendered beneath lines with a higher z-order. This z-ordering does
// not imply anything about the altitude of the area relative to the
// ground, but it can be used to prevent z-fighting during rendering on
// the client. In general, larger and more important road features will
// have a higher z-order line associated with them. This z-ordering can
// only be used to compare lines, and cannot be compared with the
// z_order field in the Area message. The z-order may be negative or
// zero. Prefer Line.basemap_z_order.
ZOrder int64 `json:"zOrder,omitempty"`
// ForceSendFields is a list of field names (e.g. "BasemapZOrder") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BasemapZOrder") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Line) MarshalJSON() ([]byte, error) {
type NoMethod Line
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ModeledVolume: Represents a modeled volume in 3D space. Used to
// represent 3D buildings.
type ModeledVolume struct {
// Strips: The triangle strips present in this mesh.
Strips []*TriangleStrip `json:"strips,omitempty"`
// VertexOffsets: The vertices present in the mesh defining the modeled
// volume.
VertexOffsets *Vertex3DList `json:"vertexOffsets,omitempty"`
// ForceSendFields is a list of field names (e.g. "Strips") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Strips") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ModeledVolume) MarshalJSON() ([]byte, error) {
type NoMethod ModeledVolume
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ProviderInfo: Information about the data providers that should be
// included in the attribution string shown by the client.
type ProviderInfo struct {
// Description: Attribution string for this provider. This string is not
// localized.
Description string `json:"description,omitempty"`
// ForceSendFields is a list of field names (e.g. "Description") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Description") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ProviderInfo) MarshalJSON() ([]byte, error) {
type NoMethod ProviderInfo
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Relation: Represents a relation to another feature in the tile. For
// example, a building might be occupied by a given POI. The related
// feature can be retrieved using the related feature index.
type Relation struct {
// RelatedFeatureIndex: Zero-based index to look up the related feature
// from the list of features in the tile.
RelatedFeatureIndex int64 `json:"relatedFeatureIndex,omitempty"`
// RelationType: Relation type between the origin feature to the related
// feature.
//
// Possible values:
// "RELATION_TYPE_UNSPECIFIED" - Unspecified relation type. Should
// never happen.
// "OCCUPIES" - The origin feature occupies the related feature.
// "PRIMARILY_OCCUPIED_BY" - The origin feature is primarily occupied
// by the related feature.
RelationType string `json:"relationType,omitempty"`
// ForceSendFields is a list of field names (e.g. "RelatedFeatureIndex")
// to unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "RelatedFeatureIndex") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *Relation) MarshalJSON() ([]byte, error) {
type NoMethod Relation
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// RoadInfo: Extra metadata relating to roads.
type RoadInfo struct {
// IsPrivate: Road has signage discouraging or prohibiting use by the
// general public. E.g., roads with signs that say "Private", or "No
// trespassing."
IsPrivate bool `json:"isPrivate,omitempty"`
// ForceSendFields is a list of field names (e.g. "IsPrivate") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "IsPrivate") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *RoadInfo) MarshalJSON() ([]byte, error) {
type NoMethod RoadInfo
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Row: A row of altitude points in the elevation grid, ordered from
// west to east.
type Row struct {
// AltitudeDiffs: The difference between each successive pair of
// altitudes, from west to east. The first, westmost point, is just the
// altitude rather than a diff. The units are specified by the
// altitude_multiplier parameter above; the value in meters is given by
// altitude_multiplier * altitude_diffs[n]. The altitude row (in metres
// above sea level) can be reconstructed with: a[0] = altitude_diffs[0]
// * altitude_multiplier when n > 0, a[n] = a[n-1] + altitude_diffs[n-1]
// * altitude_multiplier.
AltitudeDiffs []int64 `json:"altitudeDiffs,omitempty"`
// ForceSendFields is a list of field names (e.g. "AltitudeDiffs") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AltitudeDiffs") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Row) MarshalJSON() ([]byte, error) {
type NoMethod Row
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SecondDerivativeElevationGrid: 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.
type SecondDerivativeElevationGrid struct {
// AltitudeMultiplier: A multiplier applied to the elements in the
// encoded data to extract the actual altitudes in meters.
AltitudeMultiplier float64 `json:"altitudeMultiplier,omitempty"`
// ColumnCount: The number of columns included in the encoded elevation
// data (i.e. the horizontal resolution of the grid).
ColumnCount int64 `json:"columnCount,omitempty"`
// EncodedData: 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 |
// ----------------------------------------------------------------------
// --|
EncodedData string `json:"encodedData,omitempty"`
// RowCount: The number of rows included in the encoded elevation data
// (i.e. the vertical resolution of the grid).
RowCount int64 `json:"rowCount,omitempty"`
// ForceSendFields is a list of field names (e.g. "AltitudeMultiplier")
// to unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AltitudeMultiplier") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *SecondDerivativeElevationGrid) MarshalJSON() ([]byte, error) {
type NoMethod SecondDerivativeElevationGrid
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *SecondDerivativeElevationGrid) UnmarshalJSON(data []byte) error {
type NoMethod SecondDerivativeElevationGrid
var s1 struct {
AltitudeMultiplier gensupport.JSONFloat64 `json:"altitudeMultiplier"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.AltitudeMultiplier = float64(s1.AltitudeMultiplier)
return nil
}
// SegmentInfo: Extra metadata relating to segments.
type SegmentInfo struct {
// RoadInfo: Metadata for features with the ROAD FeatureType.
RoadInfo *RoadInfo `json:"roadInfo,omitempty"`
// ForceSendFields is a list of field names (e.g. "RoadInfo") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "RoadInfo") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SegmentInfo) MarshalJSON() ([]byte, error) {
type NoMethod SegmentInfo
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TerrainTile: A tile containing information about the terrain located
// in the region it covers.
type TerrainTile struct {
// Coordinates: The global tile coordinates that uniquely identify this
// tile.
Coordinates *TileCoordinates `json:"coordinates,omitempty"`
// FirstDerivative: Terrain elevation data encoded as a
// FirstDerivativeElevationGrid. cs/symbol:FirstDerivativeElevationGrid.
FirstDerivative *FirstDerivativeElevationGrid `json:"firstDerivative,omitempty"`
// Name: Resource name of the tile. The tile resource name is prefixed
// by its collection ID `terrain/` followed by the resource ID, which
// encodes the tile's global x and y coordinates and zoom level as
// `@,,z`. For example, `terrain/@1,2,3z`.
Name string `json:"name,omitempty"`
// SecondDerivative: Terrain elevation data encoded as a
// SecondDerivativeElevationGrid.
// cs/symbol:SecondDerivativeElevationGrid. See go/byte-encoded-terrain
// for more details.
SecondDerivative *SecondDerivativeElevationGrid `json:"secondDerivative,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Coordinates") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Coordinates") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`