-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathgeojson.dart
761 lines (629 loc) · 21.4 KB
/
geojson.dart
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
import 'package:json_annotation/json_annotation.dart';
import 'package:turf/meta.dart';
part 'geojson.g.dart';
@JsonEnum(alwaysCreate: true)
enum GeoJSONObjectType {
@JsonValue('Point')
point,
@JsonValue('MultiPoint')
multiPoint,
@JsonValue('LineString')
lineString,
@JsonValue('MultiLineString')
multiLineString,
@JsonValue('Polygon')
polygon,
@JsonValue('MultiPolygon')
multiPolygon,
@JsonValue('GeometryCollection')
geometryCollection,
@JsonValue('Feature')
feature,
@JsonValue('FeatureCollection')
featureCollection,
}
abstract class GeoJSONObject {
final GeoJSONObjectType type;
BBox? bbox;
GeoJSONObject.withType(this.type, {this.bbox});
Map<String, dynamic> serialize(Map<String, dynamic> map) => {
'type': _$GeoJSONObjectTypeEnumMap[type],
...map,
};
static GeoJSONObject fromJson(Map<String, dynamic> json) {
GeoJSONObjectType decoded = json['type'] is GeoJSONObjectType
? json['type']
: $enumDecode(_$GeoJSONObjectTypeEnumMap, json['type']);
switch (decoded) {
case GeoJSONObjectType.point:
return Point.fromJson(json);
case GeoJSONObjectType.multiPoint:
return MultiPoint.fromJson(json);
case GeoJSONObjectType.lineString:
return LineString.fromJson(json);
case GeoJSONObjectType.multiLineString:
return MultiLineString.fromJson(json);
case GeoJSONObjectType.polygon:
return Polygon.fromJson(json);
case GeoJSONObjectType.multiPolygon:
return MultiPolygon.fromJson(json);
case GeoJSONObjectType.geometryCollection:
return GeometryCollection.fromJson(json);
case GeoJSONObjectType.feature:
return Feature.fromJson(json);
case GeoJSONObjectType.featureCollection:
return FeatureCollection.fromJson(json);
}
}
toJson();
GeoJSONObject clone();
void geomEachImpl1(GeomEachCallback callback);
}
/// Coordinate types, following https://tools.ietf.org/html/rfc7946#section-4
abstract class CoordinateType implements Iterable<num> {
final List<num> _items;
CoordinateType(List<num> list) : _items = List.of(list, growable: false);
@override
num get first => _items.first;
@override
num get last => _items.last;
@override
int get length => _items.length;
num? operator [](int index) => _items[index];
void operator []=(int index, num value) => _items[index] = value;
@override
bool any(bool Function(num element) test) => _items.any(test);
@override
List<R> cast<R>() => _items.cast<R>();
@override
bool contains(Object? element) => _items.contains(element);
@override
num elementAt(int index) => _items.elementAt(index);
@override
bool every(bool Function(num element) test) => _items.every(test);
@override
Iterable<T> expand<T>(Iterable<T> Function(num element) f) =>
_items.expand<T>(f);
@override
num firstWhere(bool Function(num element) test, {num Function()? orElse}) =>
_items.firstWhere(test);
@override
T fold<T>(T initialValue, T Function(T previousValue, num element) combine) =>
_items.fold<T>(initialValue, combine);
@override
Iterable<num> followedBy(Iterable<num> other) => _items.followedBy(other);
@override
void forEach(void Function(num element) f) => _items.forEach(f);
@override
bool get isEmpty => _items.isEmpty;
@override
bool get isNotEmpty => _items.isNotEmpty;
@override
Iterator<num> get iterator => _items.iterator;
@override
String join([String separator = '']) => _items.join(separator);
@override
num lastWhere(bool Function(num element) test, {num Function()? orElse}) =>
_items.lastWhere(test, orElse: orElse);
@override
Iterable<T> map<T>(T Function(num e) f) => _items.map(f);
@override
num reduce(num Function(num value, num element) combine) =>
_items.reduce(combine);
@override
num get single => _items.single;
@override
num singleWhere(bool Function(num element) test, {num Function()? orElse}) =>
_items.singleWhere(test, orElse: orElse);
@override
Iterable<num> skip(int count) => _items.skip(count);
@override
Iterable<num> skipWhile(bool Function(num value) test) =>
_items.skipWhile(test);
@override
Iterable<num> take(int count) => _items.take(count);
@override
Iterable<num> takeWhile(bool Function(num value) test) =>
_items.takeWhile(test);
@override
List<num> toList({bool growable = true}) => _items;
@override
Set<num> toSet() => _items.toSet();
@override
Iterable<num> where(bool Function(num element) test) => _items.where(test);
@override
Iterable<T> whereType<T>() => _items.whereType<T>();
List<num> toJson() => _items;
CoordinateType clone();
CoordinateType toSigned();
bool get isSigned;
_untilSigned(val, limit) {
if (val > limit) {
return _untilSigned(val - 360, limit);
} else {
return val;
}
}
}
// Position, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.1
/// Please make sure, you arrange your parameters like this:
/// 1. Longitude, 2. Latitude, 3. Altitude (optional)
class Position extends CoordinateType {
Position(num lng, num lat, [num? alt])
: super([
lng,
lat,
if (alt != null) alt,
]);
Position.named({required num lat, required num lng, num? alt})
: super([
lng,
lat,
if (alt != null) alt,
]);
/// Position.of([<Lng>, <Lat>, <Alt (optional)>])
Position.of(List<num> list)
: assert(list.length >= 2 && list.length <= 3),
super(list);
factory Position.fromJson(List<num> list) => Position.of(list);
Position operator +(Position p) => Position.of([
lng + p.lng,
lat + p.lat,
if (alt != null && p.alt != null) alt! + p.alt!
]);
Position operator -(Position p) => Position.of([
lng - p.lng,
lat - p.lat,
if (alt != null && p.alt != null) alt! - p.alt!,
]);
num dotProduct(Position p) =>
(lng * p.lng) +
(lat * p.lat) +
(alt != null && p.alt != null ? (alt! * p.alt!) : 0);
Position crossProduct(Position p) {
if (alt != null && p.alt != null) {
return Position(
lat * p.alt! - alt! * p.lat,
alt! * p.lng - lng * p.alt!,
lng * p.lat - lat * p.lng,
);
}
throw Exception('Cross product only implemented for 3 dimensions');
}
Position operator *(Position p) => crossProduct(p);
num get lng => _items[0];
num get lat => _items[1];
num? get alt => length == 3 ? _items[2] : null;
@override
bool get isSigned => lng <= 180 && lat <= 90;
@override
Position toSigned() => Position.named(
lng: _untilSigned(lng, 180),
lat: _untilSigned(lat, 90),
alt: alt,
);
@override
Position clone() => Position.of(_items);
@override
int get hashCode => Object.hashAll(_items);
@override
bool operator ==(dynamic other) => other is Position
? lng == other.lng && lat == other.lat && alt == other.alt
: false;
}
// Bounding box, as specified here https://tools.ietf.org/html/rfc7946#section-5
/// Please make sure, you arrange your parameters like this:
/// Longitude 1, Latitude 1, Altitude 1 (optional), Longitude 2, Latitude 2, Altitude 2 (optional)
/// You can either specify 4 or 6 parameters
class BBox extends CoordinateType {
BBox(
num lng1,
num lat1,
num alt1,
num lng2, [
num? lat2,
num? alt2,
]) : super([
lng1,
lat1,
alt1,
lng2,
if (lat2 != null) lat2,
if (alt2 != null) alt2,
]);
BBox.named({
required num lng1,
required num lat1,
num? alt1,
required num lng2,
required num lat2,
num? alt2,
}) : super([
lng1,
lat1,
if (alt1 != null) alt1,
lng2,
lat2,
if (alt2 != null) alt2,
]);
/// Position.of([<Lng>, <Lat>, <Alt (optional)>])
BBox.of(List<num> list)
: assert(list.length == 4 || list.length == 6),
super(list);
factory BBox.fromJson(List<num> list) => BBox.of(list);
bool get _is3D => length == 6;
num get lng1 => _items[0];
num get lat1 => _items[1];
num? get alt1 => _is3D ? _items[2] : null;
num get lng2 => _items[_is3D ? 3 : 2];
num get lat2 => _items[_is3D ? 4 : 3];
num? get alt2 => _is3D ? _items[5] : null;
@override
BBox clone() => BBox.of(_items);
@override
bool get isSigned => lng1 <= 180 && lng2 <= 180 && lat1 <= 90 && lat2 <= 90;
@override
BBox toSigned() => BBox.named(
alt1: alt1,
alt2: alt2,
lat1: _untilSigned(lat1, 90),
lat2: _untilSigned(lat2, 90),
lng1: _untilSigned(lng1, 180),
lng2: _untilSigned(lng2, 180),
);
@override
int get hashCode => Object.hashAll(_items);
@override
bool operator ==(Object other) => other is BBox
? lng1 == other.lng1 &&
lat1 == other.lat1 &&
alt1 == other.alt1 &&
lng2 == other.lng2 &&
lat2 == other.lat2 &&
alt2 == other.alt2
: false;
}
abstract class GeometryObject extends GeoJSONObject {
GeometryObject.withType(GeoJSONObjectType type, {BBox? bbox})
: super.withType(type, bbox: bbox);
static GeometryObject deserialize(Map<String, dynamic> json) {
return json['type'] == 'GeometryCollection' ||
json['type'] == GeoJSONObjectType.geometryCollection
? GeometryCollection.fromJson(json)
: GeometryType.deserialize(json);
}
@override
void geomEachImpl1(
GeomEachCallback callback, {
Map<String, dynamic>? featureProperties,
BBox? featureBBox,
dynamic featureId,
int? featureIndex,
});
}
abstract class GeometryType<T> extends GeometryObject {
T coordinates;
@override
void geomEachImpl1(
GeomEachCallback callback, {
Map<String, dynamic>? featureProperties,
BBox? featureBBox,
dynamic featureId,
int? featureIndex,
}) {
if (callback(
this,
featureIndex,
featureProperties,
featureBBox,
featureId,
) ==
false) {
throw ShortCircuit();
}
}
GeometryType.withType(this.coordinates, GeoJSONObjectType type, {BBox? bbox})
: super.withType(type, bbox: bbox);
static GeometryType deserialize(Map<String, dynamic> json) {
GeoJSONObjectType decoded = json['type'] is GeoJSONObjectType
? json['type']
: $enumDecode(_$GeoJSONObjectTypeEnumMap, json['type']);
switch (decoded) {
case GeoJSONObjectType.point:
return Point.fromJson(json);
case GeoJSONObjectType.multiPoint:
return MultiPoint.fromJson(json);
case GeoJSONObjectType.lineString:
return LineString.fromJson(json);
case GeoJSONObjectType.multiLineString:
return MultiLineString.fromJson(json);
case GeoJSONObjectType.polygon:
return Polygon.fromJson(json);
case GeoJSONObjectType.multiPolygon:
return MultiPolygon.fromJson(json);
default:
throw Exception('${json['type']} is not a valid GeoJSON type');
}
}
@override
GeometryType<T> clone();
}
/// Point, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.2
@JsonSerializable(explicitToJson: true)
class Point extends GeometryType<Position> {
Point({BBox? bbox, required Position coordinates})
: super.withType(coordinates, GeoJSONObjectType.point, bbox: bbox);
factory Point.fromJson(Map<String, dynamic> json) => _$PointFromJson(json);
@override
Map<String, dynamic> toJson() => super.serialize(_$PointToJson(this));
@override
Point clone() => Point(coordinates: coordinates.clone(), bbox: bbox?.clone());
@override
int get hashCode => Object.hashAll([
type,
...coordinates,
if (bbox != null) ...bbox!,
]);
@override
bool operator ==(Object other) =>
other is Point ? coordinates == other.coordinates : false;
}
/// MultiPoint, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.3
@JsonSerializable(explicitToJson: true)
class MultiPoint extends GeometryType<List<Position>> {
MultiPoint({BBox? bbox, List<Position> coordinates = const []})
: super.withType(coordinates, GeoJSONObjectType.multiPoint, bbox: bbox);
factory MultiPoint.fromJson(Map<String, dynamic> json) =>
_$MultiPointFromJson(json);
MultiPoint.fromPoints({BBox? bbox, required List<Point> points})
: assert(points.length >= 2),
super.withType(points.map((e) => e.coordinates).toList(),
GeoJSONObjectType.multiPoint,
bbox: bbox);
@override
Map<String, dynamic> toJson() => super.serialize(_$MultiPointToJson(this));
@override
MultiPoint clone() => MultiPoint(
coordinates: coordinates.map((e) => e.clone()).toList(),
bbox: bbox?.clone(),
);
}
/// LineString, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.4
@JsonSerializable(explicitToJson: true)
class LineString extends GeometryType<List<Position>> {
LineString({BBox? bbox, List<Position> coordinates = const []})
: super.withType(coordinates, GeoJSONObjectType.lineString, bbox: bbox);
factory LineString.fromJson(Map<String, dynamic> json) =>
_$LineStringFromJson(json);
LineString.fromPoints({BBox? bbox, required List<Point> points})
: assert(points.length >= 2),
super.withType(points.map((e) => e.coordinates).toList(),
GeoJSONObjectType.lineString,
bbox: bbox);
@override
Map<String, dynamic> toJson() => super.serialize(_$LineStringToJson(this));
@override
LineString clone() => LineString(
coordinates: coordinates.map((e) => e.clone()).toList(),
bbox: bbox?.clone());
}
/// MultiLineString, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.5
@JsonSerializable(explicitToJson: true)
class MultiLineString extends GeometryType<List<List<Position>>> {
MultiLineString({BBox? bbox, List<List<Position>> coordinates = const []})
: super.withType(coordinates, GeoJSONObjectType.multiLineString,
bbox: bbox);
factory MultiLineString.fromJson(Map<String, dynamic> json) =>
_$MultiLineStringFromJson(json);
MultiLineString.fromLineStrings(
{BBox? bbox, required List<LineString> lineStrings})
: assert(lineStrings.length >= 2),
super.withType(lineStrings.map((e) => e.coordinates).toList(),
GeoJSONObjectType.multiLineString,
bbox: bbox);
@override
Map<String, dynamic> toJson() =>
super.serialize(_$MultiLineStringToJson(this));
@override
MultiLineString clone() => MultiLineString(
coordinates:
coordinates.map((e) => e.map((e) => e.clone()).toList()).toList(),
bbox: bbox?.clone(),
);
}
/// Polygon, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.6
@JsonSerializable(explicitToJson: true)
class Polygon extends GeometryType<List<List<Position>>> {
Polygon({BBox? bbox, List<List<Position>> coordinates = const []})
: super.withType(coordinates, GeoJSONObjectType.polygon, bbox: bbox);
factory Polygon.fromJson(Map<String, dynamic> json) =>
_$PolygonFromJson(json);
Polygon.fromPoints({BBox? bbox, required List<List<Point>> points})
: assert(points.expand((list) => list).length >= 3),
super.withType(
points.map((e) => e.map((e) => e.coordinates).toList()).toList(),
GeoJSONObjectType.polygon,
bbox: bbox);
@override
Map<String, dynamic> toJson() => super.serialize(_$PolygonToJson(this));
@override
Polygon clone() => Polygon(
coordinates:
coordinates.map((e) => e.map((e) => e.clone()).toList()).toList(),
bbox: bbox?.clone(),
);
}
/// MultiPolygon, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.7
@JsonSerializable(explicitToJson: true)
class MultiPolygon extends GeometryType<List<List<List<Position>>>> {
MultiPolygon({BBox? bbox, List<List<List<Position>>> coordinates = const []})
: super.withType(coordinates, GeoJSONObjectType.multiPolygon, bbox: bbox);
factory MultiPolygon.fromJson(Map<String, dynamic> json) =>
_$MultiPolygonFromJson(json);
MultiPolygon.fromPolygons({BBox? bbox, required List<Polygon> polygons})
: assert(polygons.length >= 2),
super.withType(polygons.map((e) => e.coordinates).toList(),
GeoJSONObjectType.multiPolygon,
bbox: bbox);
@override
Map<String, dynamic> toJson() => super.serialize(_$MultiPolygonToJson(this));
@override
MultiPolygon clone() => MultiPolygon(
coordinates: coordinates
.map((e) => e.map((e) => e.map((e) => e.clone()).toList()).toList())
.toList(),
bbox: bbox?.clone(),
);
}
/// GeometryCollection, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.8
@JsonSerializable(explicitToJson: true, createFactory: false)
class GeometryCollection extends GeometryObject {
List<GeometryType> geometries;
GeometryCollection({BBox? bbox, this.geometries = const []})
: super.withType(GeoJSONObjectType.geometryCollection, bbox: bbox);
factory GeometryCollection.fromJson(Map<String, dynamic> json) =>
GeometryCollection(
bbox: json['bbox'] == null
? null
: BBox.fromJson(
(json['bbox'] as List).map((e) => e as num).toList(),
),
geometries: (json['geometries'] as List?)
?.map((e) => GeometryType.deserialize(e))
.toList() ??
const [],
);
@override
Map<String, dynamic> toJson() =>
super.serialize(_$GeometryCollectionToJson(this));
@override
GeometryCollection clone() => GeometryCollection(
geometries: geometries.map((e) => e.clone()).toList(),
bbox: bbox?.clone(),
);
@override
void geomEachImpl1(
GeomEachCallback callback, {
Map<String, dynamic>? featureProperties,
BBox? featureBBox,
featureId,
int? featureIndex,
}) {
for (var geom in geometries) {
geom.geomEachImpl1(
callback,
featureProperties: featureProperties,
featureBBox: featureBBox,
featureId: featureId,
featureIndex: featureIndex,
);
}
}
}
/// Feature, as specified here https://tools.ietf.org/html/rfc7946#section-3.2
class Feature<T extends GeometryObject> extends GeoJSONObject {
dynamic id;
Map<String, dynamic>? properties;
T? geometry;
Map<String, dynamic> fields;
Feature({
BBox? bbox,
this.id,
this.properties = const {},
this.geometry,
this.fields = const {},
}) : super.withType(GeoJSONObjectType.feature, bbox: bbox);
factory Feature.fromJson(Map<String, dynamic> json) => Feature(
id: json['id'],
geometry: json['geometry'] == null
? null
: GeometryObject.deserialize(json['geometry']) as T,
properties: json['properties'],
bbox: json['bbox'] == null
? null
: BBox.fromJson(
(json['bbox'] as List).map((e) => e as num).toList()),
fields: Map.fromEntries(
json.entries.where(
(el) =>
el.key != 'geometry' &&
el.key != 'properties' &&
el.key != 'id',
),
),
);
dynamic operator [](String key) {
switch (key) {
case 'id':
return id;
case 'properties':
return properties;
case 'geometry':
return geometry;
case 'type':
return type;
case 'bbox':
return bbox;
default:
return fields[key];
}
}
@override
int get hashCode => Object.hash(type, id);
@override
bool operator ==(dynamic other) => other is Feature ? id == other.id : false;
@override
Map<String, dynamic> toJson() => super.serialize({
'id': id,
'geometry': geometry!.toJson(),
'properties': properties,
...fields,
});
@override
Feature<T> clone() => Feature<T>(
geometry: geometry?.clone() as T?,
bbox: bbox?.clone(),
fields: Map.of(fields),
properties: Map.of(properties ?? {}),
id: id,
);
@override
void geomEachImpl1(GeomEachCallback callback, {int? featureIndex}) {
geometry?.geomEachImpl1(callback);
}
}
/// FeatureCollection, as specified here https://tools.ietf.org/html/rfc7946#section-3.3
class FeatureCollection<T extends GeometryObject> extends GeoJSONObject {
List<Feature<T>> features;
FeatureCollection({BBox? bbox, this.features = const []})
: super.withType(GeoJSONObjectType.featureCollection, bbox: bbox);
factory FeatureCollection.fromJson(Map<String, dynamic> json) =>
FeatureCollection(
bbox: json['bbox'] == null
? null
: BBox.fromJson(
(json['bbox'] as List).map((e) => e as num).toList()),
features: (json['features'] as List<dynamic>?)
?.map((e) => Feature<T>.fromJson(e as Map<String, dynamic>))
.toList() ??
const [],
);
@override
Map<String, dynamic> toJson() => super.serialize(<String, dynamic>{
'features': features.map((e) => e.toJson()).toList(),
'bbox': bbox?.toJson(),
});
@override
FeatureCollection<T> clone() => FeatureCollection(
features: features.map((e) => e.clone()).toList(),
bbox: bbox?.clone(),
);
@override
void geomEachImpl1(GeomEachCallback callback) {
int featuresLength = features.length;
for (int featureIndex = 0; featureIndex < featuresLength; featureIndex++) {
features[featureIndex]
.geomEachImpl1(callback, featureIndex: featureIndex);
}
}
}