@feltmaps/js-sdk 1.10.2 → 1.11.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6100,12 +6100,28 @@ interface RasterLayerSource {
6100
6100
  bands: Array<RasterBand>;
6101
6101
  }
6102
6102
  /**
6103
- * The RasterBand interface describes the metadata for a raster band, necessary for
6104
- * calculating the encoded raster value from the red, green, and blue values of the pixel.
6103
+ * The RasterBand interface describes one band of a raster: how to identify it when
6104
+ * asking for statistics, what to call it, and the values needed to calculate the
6105
+ * encoded raster value from the red, green, and blue values of a pixel.
6105
6106
  *
6106
6107
  * @group Layer sources
6107
6108
  */
6108
6109
  interface RasterBand {
6110
+ /**
6111
+ * The identifier for this band, such as `"band:1"`.
6112
+ *
6113
+ * Pass this to the raster statistics methods, such as
6114
+ * {@link LayersController.getRasterAggregates}, and use it to refer to the band
6115
+ * inside a filter.
6116
+ */
6117
+ id: string;
6118
+ /**
6119
+ * The name of the band, such as "Red" or "Elevation".
6120
+ *
6121
+ * Felt takes this from the raster itself when the file names its bands, and
6122
+ * falls back to "Band 1", "Band 2" and so on.
6123
+ */
6124
+ displayName: string;
6109
6125
  /**
6110
6126
  * Encoding base value as a floating point number
6111
6127
  */
@@ -8188,6 +8204,519 @@ interface GetLayerPrecomputedCalculationParams extends TypeOf<typeof GetLayerPre
8188
8204
  gridConfig: GridConfig;
8189
8205
  }
8190
8206
 
8207
+ declare const RasterAggregationMethodSchema: ZodEnum<["avg", "min", "max", "sum", "median", "stddev", "majority", "area"]>;
8208
+ /**
8209
+ * A statistic that can be calculated for a raster band.
8210
+ *
8211
+ * `area` is the ground area of the selected pixels, in square metres.
8212
+ *
8213
+ * `majority`, the most common value, needs a band holding whole numbers.
8214
+ *
8215
+ * @group Stats
8216
+ */
8217
+ type RasterAggregationMethod = TypeOf<typeof RasterAggregationMethodSchema>;
8218
+ declare const GetRasterAggregatesParamsSchema: ZodObject<objectUtil.extendShape<{
8219
+ layerId: ZodString;
8220
+ bandId: ZodString;
8221
+ boundary: ZodOptional<ZodUnion<[ZodTuple<[ZodNumber, ZodNumber, ZodNumber, ZodNumber], null>, ZodObject<{
8222
+ type: ZodLiteral<"Polygon">;
8223
+ coordinates: ZodArray<ZodEffects<ZodArray<ZodTuple<[ZodNumber, ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">;
8224
+ }, "strip", ZodTypeAny, {
8225
+ type: "Polygon";
8226
+ coordinates: [number, number][][];
8227
+ }, {
8228
+ type: "Polygon";
8229
+ coordinates: [number, number][][];
8230
+ }>, ZodObject<{
8231
+ type: ZodLiteral<"MultiPolygon">;
8232
+ coordinates: ZodArray<ZodArray<ZodEffects<ZodArray<ZodTuple<[ZodNumber, ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">, "many">;
8233
+ }, "strip", ZodTypeAny, {
8234
+ type: "MultiPolygon";
8235
+ coordinates: [number, number][][][];
8236
+ }, {
8237
+ type: "MultiPolygon";
8238
+ coordinates: [number, number][][][];
8239
+ }>, ZodArray<ZodTuple<[ZodNumber, ZodNumber], null>, "many">]>>;
8240
+ filters: ZodOptional<ZodUnion<[ZodType<FilterTernary, ZodTypeDef, FilterTernary>, ZodUnion<[ZodTuple<[ZodUnion<[ZodString, ZodNull]>, ZodEnum<["in", "ni"]>, ZodUnion<[ZodArray<ZodUnion<[ZodNumber, ZodString, ZodBoolean, ZodNull]>, "many">, ZodNull]>], null>, ZodTuple<[ZodUnion<[ZodString, ZodNull]>, ZodEnum<["lt", "gt", "le", "ge", "eq", "ne", "cn", "nc", "is", "isnt"]>, ZodUnion<[ZodNumber, ZodString, ZodBoolean, ZodNull]>], null>]>, ZodNull, ZodBoolean]>>;
8241
+ }, {
8242
+ aggregation: ZodObject<{
8243
+ methods: ZodArray<ZodEnum<["avg", "min", "max", "sum", "median", "stddev", "majority", "area"]>, "many">;
8244
+ percentiles: ZodOptional<ZodArray<ZodNumber, "many">>;
8245
+ }, "strip", ZodTypeAny, {
8246
+ methods: ("avg" | "max" | "min" | "sum" | "median" | "stddev" | "majority" | "area")[];
8247
+ percentiles?: number[] | undefined;
8248
+ }, {
8249
+ methods: ("avg" | "max" | "min" | "sum" | "median" | "stddev" | "majority" | "area")[];
8250
+ percentiles?: number[] | undefined;
8251
+ }>;
8252
+ }>, "strip", ZodTypeAny, {
8253
+ layerId: string;
8254
+ aggregation: {
8255
+ methods: ("avg" | "max" | "min" | "sum" | "median" | "stddev" | "majority" | "area")[];
8256
+ percentiles?: number[] | undefined;
8257
+ };
8258
+ bandId: string;
8259
+ filters?: boolean | FilterTernary | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | null | undefined;
8260
+ boundary?: [number, number, number, number] | [number, number][] | {
8261
+ type: "Polygon";
8262
+ coordinates: [number, number][][];
8263
+ } | {
8264
+ type: "MultiPolygon";
8265
+ coordinates: [number, number][][][];
8266
+ } | undefined;
8267
+ }, {
8268
+ layerId: string;
8269
+ aggregation: {
8270
+ methods: ("avg" | "max" | "min" | "sum" | "median" | "stddev" | "majority" | "area")[];
8271
+ percentiles?: number[] | undefined;
8272
+ };
8273
+ bandId: string;
8274
+ filters?: boolean | FilterTernary | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | null | undefined;
8275
+ boundary?: [number, number, number, number] | [number, number][] | {
8276
+ type: "Polygon";
8277
+ coordinates: [number, number][][];
8278
+ } | {
8279
+ type: "MultiPolygon";
8280
+ coordinates: [number, number][][][];
8281
+ } | undefined;
8282
+ }>;
8283
+ /**
8284
+ * The parameters for calculating statistics for a raster band, passed to the
8285
+ * {@link LayersController.getRasterAggregates} method.
8286
+ *
8287
+ * @group Stats
8288
+ */
8289
+ interface GetRasterAggregatesParams<T extends RasterAggregationMethod> extends zInfer<typeof GetRasterAggregatesParamsSchema> {
8290
+ /**
8291
+ * The ID of the band to calculate statistics for, read from the `bands` on a
8292
+ * raster layer's source.
8293
+ */
8294
+ bandId: string;
8295
+ /**
8296
+ * The spatial boundary for the pixels to include. Omit this to cover the whole
8297
+ * raster.
8298
+ */
8299
+ boundary?: GeometryFilter;
8300
+ /**
8301
+ * Filters on band values for the pixels to include, such as
8302
+ * `["band:1", "gt", 100]`.
8303
+ */
8304
+ filters?: Filters;
8305
+ /**
8306
+ * Which statistics to calculate for the band.
8307
+ */
8308
+ aggregation: {
8309
+ /**
8310
+ * The statistics to calculate for the band.
8311
+ */
8312
+ methods: T[];
8313
+ /**
8314
+ * Percentile ranks between 0 and 100 to calculate, such as `[10, 50, 90]`.
8315
+ */
8316
+ percentiles?: number[];
8317
+ };
8318
+ }
8319
+ declare const RasterPercentileSchema: ZodObject<{
8320
+ /**
8321
+ * The percentile rank that was requested.
8322
+ */
8323
+ rank: ZodNumber;
8324
+ /**
8325
+ * The band value at this rank.
8326
+ */
8327
+ value: ZodNullable<ZodNumber>;
8328
+ }, "strip", ZodTypeAny, {
8329
+ value: number | null;
8330
+ rank: number;
8331
+ }, {
8332
+ value: number | null;
8333
+ rank: number;
8334
+ }>;
8335
+ /**
8336
+ * One percentile from the response to the
8337
+ * {@link LayersController.getRasterAggregates} method.
8338
+ *
8339
+ * @group Stats
8340
+ */
8341
+ interface RasterPercentile extends zInfer<typeof RasterPercentileSchema> {
8342
+ }
8343
+ /**
8344
+ * The response from the {@link LayersController.getRasterAggregates} method.
8345
+ *
8346
+ * @group Stats
8347
+ */
8348
+ interface GetRasterAggregatesResult<T extends RasterAggregationMethod> {
8349
+ /**
8350
+ * The value calculated for each requested statistic.
8351
+ *
8352
+ * `null` is returned when the boundary and filters selected no pixels, as
8353
+ * opposed to zero, so as not to confuse an empty selection with a real zero.
8354
+ */
8355
+ stats: Record<T, number | null>;
8356
+ /**
8357
+ * The requested percentiles, in the order they were requested. Present only
8358
+ * when percentile ranks were requested.
8359
+ */
8360
+ percentiles?: Array<RasterPercentile>;
8361
+ }
8362
+ declare const GetRasterHistogramParamsSchema: ZodObject<objectUtil.extendShape<{
8363
+ layerId: ZodString;
8364
+ bandId: ZodString;
8365
+ boundary: ZodOptional<ZodUnion<[ZodTuple<[ZodNumber, ZodNumber, ZodNumber, ZodNumber], null>, ZodObject<{
8366
+ type: ZodLiteral<"Polygon">;
8367
+ coordinates: ZodArray<ZodEffects<ZodArray<ZodTuple<[ZodNumber, ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">;
8368
+ }, "strip", ZodTypeAny, {
8369
+ type: "Polygon";
8370
+ coordinates: [number, number][][];
8371
+ }, {
8372
+ type: "Polygon";
8373
+ coordinates: [number, number][][];
8374
+ }>, ZodObject<{
8375
+ type: ZodLiteral<"MultiPolygon">;
8376
+ coordinates: ZodArray<ZodArray<ZodEffects<ZodArray<ZodTuple<[ZodNumber, ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">, "many">;
8377
+ }, "strip", ZodTypeAny, {
8378
+ type: "MultiPolygon";
8379
+ coordinates: [number, number][][][];
8380
+ }, {
8381
+ type: "MultiPolygon";
8382
+ coordinates: [number, number][][][];
8383
+ }>, ZodArray<ZodTuple<[ZodNumber, ZodNumber], null>, "many">]>>;
8384
+ filters: ZodOptional<ZodUnion<[ZodType<FilterTernary, ZodTypeDef, FilterTernary>, ZodUnion<[ZodTuple<[ZodUnion<[ZodString, ZodNull]>, ZodEnum<["in", "ni"]>, ZodUnion<[ZodArray<ZodUnion<[ZodNumber, ZodString, ZodBoolean, ZodNull]>, "many">, ZodNull]>], null>, ZodTuple<[ZodUnion<[ZodString, ZodNull]>, ZodEnum<["lt", "gt", "le", "ge", "eq", "ne", "cn", "nc", "is", "isnt"]>, ZodUnion<[ZodNumber, ZodString, ZodBoolean, ZodNull]>], null>]>, ZodNull, ZodBoolean]>>;
8385
+ }, {
8386
+ steps: ZodUnion<[ZodObject<{
8387
+ type: ZodLiteral<"equal-intervals">;
8388
+ count: ZodNumber;
8389
+ }, "strip", ZodTypeAny, {
8390
+ type: "equal-intervals";
8391
+ count: number;
8392
+ }, {
8393
+ type: "equal-intervals";
8394
+ count: number;
8395
+ }>, ZodArray<ZodNumber, "many">]>;
8396
+ }>, "strip", ZodTypeAny, {
8397
+ layerId: string;
8398
+ steps: number[] | {
8399
+ type: "equal-intervals";
8400
+ count: number;
8401
+ };
8402
+ bandId: string;
8403
+ filters?: boolean | FilterTernary | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | null | undefined;
8404
+ boundary?: [number, number, number, number] | [number, number][] | {
8405
+ type: "Polygon";
8406
+ coordinates: [number, number][][];
8407
+ } | {
8408
+ type: "MultiPolygon";
8409
+ coordinates: [number, number][][][];
8410
+ } | undefined;
8411
+ }, {
8412
+ layerId: string;
8413
+ steps: number[] | {
8414
+ type: "equal-intervals";
8415
+ count: number;
8416
+ };
8417
+ bandId: string;
8418
+ filters?: boolean | FilterTernary | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | null | undefined;
8419
+ boundary?: [number, number, number, number] | [number, number][] | {
8420
+ type: "Polygon";
8421
+ coordinates: [number, number][][];
8422
+ } | {
8423
+ type: "MultiPolygon";
8424
+ coordinates: [number, number][][][];
8425
+ } | undefined;
8426
+ }>;
8427
+ /**
8428
+ * The parameters for requesting a histogram of a raster band's values, passed to
8429
+ * the {@link LayersController.getRasterHistogramData} method.
8430
+ *
8431
+ * @group Stats
8432
+ */
8433
+ interface GetRasterHistogramParams extends zInfer<typeof GetRasterHistogramParamsSchema> {
8434
+ /**
8435
+ * The ID of the band to bin, read from the `bands` on a raster layer's source.
8436
+ */
8437
+ bandId: string;
8438
+ /**
8439
+ * The spatial boundary for the pixels to include. Omit this to cover the whole
8440
+ * raster.
8441
+ */
8442
+ boundary?: GeometryFilter;
8443
+ /**
8444
+ * Filters on band values for the pixels to include.
8445
+ */
8446
+ filters?: Filters;
8447
+ /**
8448
+ * How to divide the band's values into bins, either as a number of equal
8449
+ * intervals or as the bin edges themselves.
8450
+ */
8451
+ steps: {
8452
+ type: "equal-intervals";
8453
+ count: number;
8454
+ } | number[];
8455
+ }
8456
+ declare const RasterHistogramBinSchema: ZodObject<{
8457
+ /**
8458
+ * The left edge of the bin.
8459
+ */
8460
+ min: ZodNumber;
8461
+ /**
8462
+ * The right edge of the bin.
8463
+ */
8464
+ max: ZodNumber;
8465
+ /**
8466
+ * The number of pixels in the bin.
8467
+ */
8468
+ value: ZodNumber;
8469
+ }, "strip", ZodTypeAny, {
8470
+ value: number;
8471
+ max: number;
8472
+ min: number;
8473
+ }, {
8474
+ value: number;
8475
+ max: number;
8476
+ min: number;
8477
+ }>;
8478
+ /**
8479
+ * One bin from the response to the
8480
+ * {@link LayersController.getRasterHistogramData} method.
8481
+ *
8482
+ * @group Stats
8483
+ */
8484
+ interface RasterHistogramBin extends zInfer<typeof RasterHistogramBinSchema> {
8485
+ }
8486
+ /**
8487
+ * The response from the {@link LayersController.getRasterHistogramData} method.
8488
+ *
8489
+ * @group Stats
8490
+ */
8491
+ interface GetRasterHistogramResult {
8492
+ /**
8493
+ * The bins, in ascending order of value.
8494
+ */
8495
+ bins: Array<RasterHistogramBin>;
8496
+ }
8497
+ declare const GetRasterCategoriesParamsSchema: ZodObject<objectUtil.extendShape<{
8498
+ layerId: ZodString;
8499
+ bandId: ZodString;
8500
+ boundary: ZodOptional<ZodUnion<[ZodTuple<[ZodNumber, ZodNumber, ZodNumber, ZodNumber], null>, ZodObject<{
8501
+ type: ZodLiteral<"Polygon">;
8502
+ coordinates: ZodArray<ZodEffects<ZodArray<ZodTuple<[ZodNumber, ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">;
8503
+ }, "strip", ZodTypeAny, {
8504
+ type: "Polygon";
8505
+ coordinates: [number, number][][];
8506
+ }, {
8507
+ type: "Polygon";
8508
+ coordinates: [number, number][][];
8509
+ }>, ZodObject<{
8510
+ type: ZodLiteral<"MultiPolygon">;
8511
+ coordinates: ZodArray<ZodArray<ZodEffects<ZodArray<ZodTuple<[ZodNumber, ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">, "many">;
8512
+ }, "strip", ZodTypeAny, {
8513
+ type: "MultiPolygon";
8514
+ coordinates: [number, number][][][];
8515
+ }, {
8516
+ type: "MultiPolygon";
8517
+ coordinates: [number, number][][][];
8518
+ }>, ZodArray<ZodTuple<[ZodNumber, ZodNumber], null>, "many">]>>;
8519
+ filters: ZodOptional<ZodUnion<[ZodType<FilterTernary, ZodTypeDef, FilterTernary>, ZodUnion<[ZodTuple<[ZodUnion<[ZodString, ZodNull]>, ZodEnum<["in", "ni"]>, ZodUnion<[ZodArray<ZodUnion<[ZodNumber, ZodString, ZodBoolean, ZodNull]>, "many">, ZodNull]>], null>, ZodTuple<[ZodUnion<[ZodString, ZodNull]>, ZodEnum<["lt", "gt", "le", "ge", "eq", "ne", "cn", "nc", "is", "isnt"]>, ZodUnion<[ZodNumber, ZodString, ZodBoolean, ZodNull]>], null>]>, ZodNull, ZodBoolean]>>;
8520
+ }, {
8521
+ limit: ZodOptional<ZodNumber>;
8522
+ }>, "strip", ZodTypeAny, {
8523
+ layerId: string;
8524
+ bandId: string;
8525
+ filters?: boolean | FilterTernary | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | null | undefined;
8526
+ boundary?: [number, number, number, number] | [number, number][] | {
8527
+ type: "Polygon";
8528
+ coordinates: [number, number][][];
8529
+ } | {
8530
+ type: "MultiPolygon";
8531
+ coordinates: [number, number][][][];
8532
+ } | undefined;
8533
+ limit?: number | undefined;
8534
+ }, {
8535
+ layerId: string;
8536
+ bandId: string;
8537
+ filters?: boolean | FilterTernary | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | null | undefined;
8538
+ boundary?: [number, number, number, number] | [number, number][] | {
8539
+ type: "Polygon";
8540
+ coordinates: [number, number][][];
8541
+ } | {
8542
+ type: "MultiPolygon";
8543
+ coordinates: [number, number][][][];
8544
+ } | undefined;
8545
+ limit?: number | undefined;
8546
+ }>;
8547
+ /**
8548
+ * The parameters for counting the distinct values of a raster band, passed to the
8549
+ * {@link LayersController.getRasterCategoryData} method.
8550
+ *
8551
+ * @group Stats
8552
+ */
8553
+ interface GetRasterCategoriesParams extends zInfer<typeof GetRasterCategoriesParamsSchema> {
8554
+ /**
8555
+ * The ID of the band to count values for, read from the `bands` on a raster
8556
+ * layer's source.
8557
+ */
8558
+ bandId: string;
8559
+ /**
8560
+ * The spatial boundary for the pixels to include. Omit this to cover the whole
8561
+ * raster.
8562
+ */
8563
+ boundary?: GeometryFilter;
8564
+ /**
8565
+ * Filters on band values for the pixels to include.
8566
+ */
8567
+ filters?: Filters;
8568
+ /**
8569
+ * The maximum number of categories to return. The most frequent categories are
8570
+ * kept.
8571
+ */
8572
+ limit?: number;
8573
+ }
8574
+ declare const RasterCategorySchema: ZodObject<{
8575
+ /**
8576
+ * The band value this category counts.
8577
+ */
8578
+ key: ZodNumber;
8579
+ /**
8580
+ * The number of pixels holding this value.
8581
+ */
8582
+ value: ZodNumber;
8583
+ /**
8584
+ * The ground area of this category's pixels, in square metres. Absent for a
8585
+ * line boundary, which samples points and so has no area.
8586
+ */
8587
+ areaM2: ZodOptional<ZodNumber>;
8588
+ }, "strip", ZodTypeAny, {
8589
+ value: number;
8590
+ key: number;
8591
+ areaM2?: number | undefined;
8592
+ }, {
8593
+ value: number;
8594
+ key: number;
8595
+ areaM2?: number | undefined;
8596
+ }>;
8597
+ /**
8598
+ * One category from the response to the
8599
+ * {@link LayersController.getRasterCategoryData} method.
8600
+ *
8601
+ * @group Stats
8602
+ */
8603
+ interface RasterCategory extends zInfer<typeof RasterCategorySchema> {
8604
+ }
8605
+ /**
8606
+ * The response from the {@link LayersController.getRasterCategoryData} method.
8607
+ *
8608
+ * @group Stats
8609
+ */
8610
+ interface GetRasterCategoriesResult {
8611
+ /**
8612
+ * The categories, most frequent first.
8613
+ */
8614
+ categories: Array<RasterCategory>;
8615
+ /**
8616
+ * How many distinct values the band holds within the scope, which is larger
8617
+ * than the number of categories returned when `limit` drops some.
8618
+ */
8619
+ total: number;
8620
+ }
8621
+ declare const GetRasterProfileParamsSchema: ZodObject<{
8622
+ layerId: ZodString;
8623
+ bandId: ZodString;
8624
+ boundary: ZodUnion<[ZodObject<{
8625
+ type: ZodLiteral<"LineString">;
8626
+ coordinates: ZodArray<ZodTuple<[ZodNumber, ZodNumber], null>, "many">;
8627
+ }, "strip", ZodTypeAny, {
8628
+ type: "LineString";
8629
+ coordinates: [number, number][];
8630
+ }, {
8631
+ type: "LineString";
8632
+ coordinates: [number, number][];
8633
+ }>, ZodObject<{
8634
+ type: ZodLiteral<"MultiLineString">;
8635
+ coordinates: ZodArray<ZodArray<ZodTuple<[ZodNumber, ZodNumber], null>, "many">, "many">;
8636
+ }, "strip", ZodTypeAny, {
8637
+ type: "MultiLineString";
8638
+ coordinates: [number, number][][];
8639
+ }, {
8640
+ type: "MultiLineString";
8641
+ coordinates: [number, number][][];
8642
+ }>]>;
8643
+ }, "strip", ZodTypeAny, {
8644
+ layerId: string;
8645
+ boundary: {
8646
+ type: "LineString";
8647
+ coordinates: [number, number][];
8648
+ } | {
8649
+ type: "MultiLineString";
8650
+ coordinates: [number, number][][];
8651
+ };
8652
+ bandId: string;
8653
+ }, {
8654
+ layerId: string;
8655
+ boundary: {
8656
+ type: "LineString";
8657
+ coordinates: [number, number][];
8658
+ } | {
8659
+ type: "MultiLineString";
8660
+ coordinates: [number, number][][];
8661
+ };
8662
+ bandId: string;
8663
+ }>;
8664
+ /**
8665
+ * The parameters for sampling a raster band along a line, passed to the
8666
+ * {@link LayersController.getRasterProfile} method.
8667
+ *
8668
+ * @group Stats
8669
+ */
8670
+ interface GetRasterProfileParams extends zInfer<typeof GetRasterProfileParamsSchema> {
8671
+ /**
8672
+ * The ID of the band to sample, read from the `bands` on a raster layer's
8673
+ * source.
8674
+ */
8675
+ bandId: string;
8676
+ /**
8677
+ * The line to sample the band along. The band is sampled at roughly one sample
8678
+ * per pixel along the line's length.
8679
+ */
8680
+ boundary: LineStringGeometry | MultiLineStringGeometry;
8681
+ }
8682
+ declare const RasterProfileSampleSchema: ZodObject<{
8683
+ /**
8684
+ * How far along the line this sample was taken, in ground metres from the
8685
+ * line's start.
8686
+ */
8687
+ distanceM: ZodNumber;
8688
+ /**
8689
+ * The band's value at this sample, or `null` where the raster holds no data or
8690
+ * the line runs outside the raster.
8691
+ */
8692
+ value: ZodNullable<ZodNumber>;
8693
+ }, "strip", ZodTypeAny, {
8694
+ value: number | null;
8695
+ distanceM: number;
8696
+ }, {
8697
+ value: number | null;
8698
+ distanceM: number;
8699
+ }>;
8700
+ /**
8701
+ * One sample from the response to the {@link LayersController.getRasterProfile}
8702
+ * method.
8703
+ *
8704
+ * @group Stats
8705
+ */
8706
+ interface RasterProfileSample extends zInfer<typeof RasterProfileSampleSchema> {
8707
+ }
8708
+ /**
8709
+ * The response from the {@link LayersController.getRasterProfile} method.
8710
+ *
8711
+ * @group Stats
8712
+ */
8713
+ interface GetRasterProfileResult {
8714
+ /**
8715
+ * The samples, ordered from the line's start.
8716
+ */
8717
+ samples: Array<RasterProfileSample>;
8718
+ }
8719
+
8191
8720
  /**
8192
8721
  * The Layers controller allows you to get information about the layers on the
8193
8722
  * map, and make changes to their visibility.
@@ -9007,6 +9536,112 @@ interface LayersController {
9007
9536
  sum: number | null;
9008
9537
  count: number | null;
9009
9538
  }>;
9539
+ /**
9540
+ * Calculates statistics for a raster band.
9541
+ *
9542
+ * @remarks
9543
+ * Summarizes the pixel values of one band of a raster layer. Omit the boundary
9544
+ * to summarize the whole raster, or pass a bounding box or polygon to summarize
9545
+ * part of it. Filters restrict the summary to pixels whose band values match a
9546
+ * condition.
9547
+ *
9548
+ * @example
9549
+ * ```typescript
9550
+ * // Band IDs come from the layer, so read them rather than writing them out
9551
+ * const layer = await felt.getLayer("elevation");
9552
+ * const bandId = layer.source.bands[0].id;
9553
+ *
9554
+ * // The elevation range of the whole raster, since no boundary is given
9555
+ * const elevation = await felt.getRasterAggregates({
9556
+ * layerId: layer.id,
9557
+ * bandId,
9558
+ * aggregation: { methods: ["min", "max", "avg"] },
9559
+ * });
9560
+ *
9561
+ * // How much ground inside a parcel sits above 2,000 metres
9562
+ * const highGround = await felt.getRasterAggregates({
9563
+ * layerId: layer.id,
9564
+ * bandId,
9565
+ * aggregation: { methods: ["area"] },
9566
+ * boundary: parcel,
9567
+ * filters: [bandId, "gt", 2000],
9568
+ * });
9569
+ *
9570
+ * // The elevation that the steepest tenth of the raster sits above
9571
+ * const steep = await felt.getRasterAggregates({
9572
+ * layerId: layer.id,
9573
+ * bandId,
9574
+ * aggregation: { methods: [], percentiles: [90] },
9575
+ * });
9576
+ * ```
9577
+ */
9578
+ getRasterAggregates<T extends RasterAggregationMethod>(params: GetRasterAggregatesParams<T>): Promise<GetRasterAggregatesResult<T>>;
9579
+ /**
9580
+ * Calculates a histogram of a raster band's values.
9581
+ *
9582
+ * @remarks
9583
+ * Divides a band's values into bins and counts the pixels falling into each one.
9584
+ * You can pass a number of equal intervals, or the bin edges themselves when you
9585
+ * already know how you want the values divided.
9586
+ *
9587
+ * @example
9588
+ * ```typescript
9589
+ * // The whole raster's elevation distribution in ten equal intervals
9590
+ * const elevation = await felt.getRasterHistogramData({
9591
+ * layerId: layer.id,
9592
+ * bandId,
9593
+ * steps: { type: "equal-intervals", count: 10 },
9594
+ * });
9595
+ *
9596
+ * // The same bins, counting only the pixels inside a watershed
9597
+ * const inWatershed = await felt.getRasterHistogramData({
9598
+ * layerId: layer.id,
9599
+ * bandId,
9600
+ * steps: [0, 500, 1000, 1500, 2000, 3000],
9601
+ * boundary: watershed,
9602
+ * });
9603
+ * ```
9604
+ */
9605
+ getRasterHistogramData(params: GetRasterHistogramParams): Promise<GetRasterHistogramResult>;
9606
+ /**
9607
+ * Counts the pixels holding each distinct value of a raster band.
9608
+ *
9609
+ * @remarks
9610
+ * This suits a band whose values are class codes, such as a land cover raster.
9611
+ * Each category reports how many pixels hold the value and how much ground they
9612
+ * cover. A band whose values are not whole numbers cannot be counted this way,
9613
+ * and throws.
9614
+ *
9615
+ * @example
9616
+ * ```typescript
9617
+ * // How much of a county each land cover class covers
9618
+ * const landCover = await felt.getRasterCategoryData({
9619
+ * layerId: layer.id,
9620
+ * bandId,
9621
+ * boundary: county,
9622
+ * limit: 10,
9623
+ * });
9624
+ * ```
9625
+ */
9626
+ getRasterCategoryData(params: GetRasterCategoriesParams): Promise<GetRasterCategoriesResult>;
9627
+ /**
9628
+ * Samples a raster band's values along a line.
9629
+ *
9630
+ * @remarks
9631
+ * Returns the values themselves rather than a summary of them, each paired with
9632
+ * how far along the line it was taken. This is what an elevation profile along a
9633
+ * route is drawn from.
9634
+ *
9635
+ * @example
9636
+ * ```typescript
9637
+ * const profile = await felt.getRasterProfile({
9638
+ * layerId: layer.id,
9639
+ * bandId,
9640
+ * boundary: route,
9641
+ * });
9642
+ * ```
9643
+ */
9644
+ getRasterProfile(params: GetRasterProfileParams): Promise<GetRasterProfileResult>;
9010
9645
  /**
9011
9646
  * Get the schema for a layer.
9012
9647
  *
@@ -14956,20 +15591,46 @@ declare const UiControlsOptionsSchema: ZodObject<{
14956
15591
  * @defaultValue true
14957
15592
  */
14958
15593
  scaleBar: ZodOptional<ZodBoolean>;
15594
+ /**
15595
+ * Whether or not the map can be rotated.
15596
+ *
15597
+ * @remarks
15598
+ * This affects all rotation interactions — dragging with the right mouse
15599
+ * button or Ctrl held, two-finger touch rotation, and keyboard shortcuts —
15600
+ * as well as the compass control, which is hidden when rotation is
15601
+ * disabled.
15602
+ *
15603
+ * @defaultValue true
15604
+ */
15605
+ rotation: ZodOptional<ZodBoolean>;
15606
+ /**
15607
+ * Whether or not the right-click context menu is available on the map.
15608
+ *
15609
+ * @remarks
15610
+ * When disabled, right-clicking the map opens neither Felt's context menu
15611
+ * nor the browser's own.
15612
+ *
15613
+ * @defaultValue true
15614
+ */
15615
+ contextMenu: ZodOptional<ZodBoolean>;
14959
15616
  }, "strip", ZodTypeAny, {
15617
+ rotation?: boolean | undefined;
14960
15618
  showLegend?: boolean | undefined;
14961
15619
  cooperativeGestures?: boolean | undefined;
14962
15620
  fullScreenButton?: boolean | undefined;
14963
15621
  geolocation?: boolean | undefined;
14964
15622
  zoomControls?: boolean | undefined;
14965
15623
  scaleBar?: boolean | undefined;
15624
+ contextMenu?: boolean | undefined;
14966
15625
  }, {
15626
+ rotation?: boolean | undefined;
14967
15627
  showLegend?: boolean | undefined;
14968
15628
  cooperativeGestures?: boolean | undefined;
14969
15629
  fullScreenButton?: boolean | undefined;
14970
15630
  geolocation?: boolean | undefined;
14971
15631
  zoomControls?: boolean | undefined;
14972
15632
  scaleBar?: boolean | undefined;
15633
+ contextMenu?: boolean | undefined;
14973
15634
  }>;
14974
15635
  /**
14975
15636
  * The options for which parts of the Felt UI can be shown when interacting with
@@ -15806,4 +16467,4 @@ interface FeltController extends ViewportController, UiController, LayersControl
15806
16467
  iframe: HTMLIFrameElement | null;
15807
16468
  }
15808
16469
 
15809
- export { type GeoJsonDataVectorSource as $, type PlaceElementRead as A, type BasemapsController as B, type ColorBasemap as C, type PlaceElementUpdate as D, type Element as E, type FeltController as F, type GetElementGroupsConstraint as G, type HighlighterElementCreate as H, type ImageElementCreate as I, type PolygonElementCreate as J, type PolygonElementRead as K, type LinkElementRead as L, type MarkerElementCreate as M, type NoteElementCreate as N, type PolygonElementUpdate as O, type PathElementCreate as P, type TextElementRead as Q, type TextElementUpdate as R, type ElementsController as S, type TextElementCreate as T, type UiControlsOptions as U, type ViewportCenterZoom as V, type MapInteractionEvent as W, type InteractionsController as X, type CreateLayersFromGeoJsonParams as Y, type DataOnlyLayer as Z, type FeltTiledVectorSource as _, type Basemap as a, type SelectionController as a$, type GeoJsonFileVectorSource as a0, type GeoJsonUrlVectorSource as a1, type GetLayerGroupsConstraint as a2, type GetLayersConstraint as a3, type GetRenderedFeaturesConstraint as a4, type Layer as a5, type LayerChangeCallbackParams as a6, type LayerCommon as a7, type LayerGroup as a8, type LayerGroupChangeCallbackParams as a9, type LayerBoundaries as aA, type LayerFilters as aB, type AggregatedGridConfig as aC, type AggregationConfig as aD, type AggregationMethod as aE, type CountGridConfig as aF, type GetLayerCalculationParams as aG, type GetLayerCategoriesGroup as aH, type GetLayerCategoriesParams as aI, type GetLayerHistogramBin as aJ, type GetLayerHistogramParams as aK, type GetLayerPrecomputedCalculationParams as aL, type GridConfig as aM, type GridType as aN, type MultiAggregationConfig as aO, type PrecomputedAggregationMethod as aP, type ValueConfiguration as aQ, type LayersController as aR, type MapDetails as aS, type MiscController as aT, type ElementGroupNode as aU, type ElementNode as aV, type EntityNode as aW, type FeatureNode as aX, type FeatureSelection as aY, type LayerGroupNode as aZ, type LayerNode as a_, type LayerProcessingStatus as aa, type LegendDisplay as ab, type LegendItem as ac, type LegendItemChangeCallbackParams as ad, type LegendItemIdentifier as ae, type LegendItemsConstraint as af, type RasterBand as ag, type RasterLayer as ah, type RasterLayerSource as ai, type UpdateLayerParams as aj, type VectorLayer as ak, type LayerFeature as al, type RasterValue as am, type LayerSchema as an, type LayerSchemaAttribute as ao, type LayerSchemaBooleanAttribute as ap, type LayerSchemaCommonAttribute as aq, type LayerSchemaDateAttribute as ar, type LayerSchemaDateTimeAttribute as as, type LayerSchemaNumericAttribute as at, type LayerSchemaTextAttribute as au, type FilterExpression as av, type FilterLogicGate as aw, type FilterTernary as ax, type Filters as ay, type GeometryFilter as az, type ColorBasemapInput as b, type UIPanelElement as b$, type FeltBoundary as b0, type FeltZoom as b1, type GeoJsonFeature as b2, type GeoJsonGeometry as b3, type GeoJsonProperties as b4, type LatLng as b5, type LineStringGeometry as b6, type LngLatTuple as b7, type MultiLineStringGeometry as b8, type MultiPointGeometry as b9, type CreatePanelElementsParams as bA, type DeletePanelElementsParams as bB, type UiOnMapInteractionsOptions as bC, type UpdateActionTriggerParams as bD, type UpdateFeatureActionParams as bE, type UpdatePanelElementsParams as bF, type PlacementForUIElement as bG, type UIPanel as bH, type UIPanelCreateOrUpdate as bI, type UIButtonElement as bJ, type UIButtonElementCreate as bK, type UIButtonElementUpdate as bL, type UITextElement as bM, type UITextElementCreate as bN, type UITextElementUpdate as bO, type UIFlexibleSpaceElement as bP, type UIFlexibleSpaceElementCreate as bQ, type UIFlexibleSpaceElementUpdate as bR, type UIDividerElement as bS, type UIDividerElementCreate as bT, type UIDividerElementUpdate as bU, type UITextInputElement as bV, type UITextInputElementCreate as bW, type UITextInputElementUpdate as bX, type UISelectElement as bY, type UISelectElementCreate as bZ, type UISelectElementUpdate as b_, type MultiPolygonGeometry as ba, type PointGeometry as bb, type PolygonGeometry as bc, type SetVisibilityRequest as bd, type SortConfig as be, type SortDirection as bf, type CircleToolSettings as bg, type ConfigurableToolType as bh, type HighlighterToolSettings as bi, type InputToolSettings as bj, type LineToolSettings as bk, type MarkerToolSettings as bl, type NoteToolSettings as bm, type PinToolSettings as bn, type PlaceFrame as bo, type PlaceSymbol as bp, type PolygonToolSettings as bq, type RouteToolSettings as br, type TextToolSettings as bs, type ToolSettingsChangeEvent as bt, type ToolSettingsMap as bu, type ToolType as bv, type ToolsController as bw, type CreateActionTriggerParams as bx, type CreateFeatureActionParams as by, type CreateOrUpdatePanelParams as bz, type CustomTileBasemap as c, type UIPanelElementCreate as c0, type UIPanelElementUpdate as c1, type UIGridContainerElement as c2, type UIGridContainerElementCreate as c3, type UIGridContainerElementUpdate as c4, type UIButtonRowElement as c5, type UIButtonRowElementCreate as c6, type UIButtonRowElementUpdate as c7, type UICheckboxGroupElement as c8, type UICheckboxGroupElementCreate as c9, type MakeClonableSchema as cA, type UIButtonRowElementCreateClonable as cB, type PromiseOrNot as cC, type UnionToIntersection as cD, type UICheckboxGroupElementUpdate as ca, type UIRadioGroupElement as cb, type UIRadioGroupElementCreate as cc, type UIRadioGroupElementUpdate as cd, type UIToggleGroupElement as ce, type UIToggleGroupElementCreate as cf, type UIToggleGroupElementUpdate as cg, type UIIframeElement as ch, type UIIframeElementCreate as ci, type UIIframeElementUpdate as cj, type UIControlElementOption as ck, type UIActionTriggerCreate as cl, type UIFeatureAction as cm, type UIFeatureActionCreate as cn, type UiController as co, type SetViewportCenterZoomParams as cp, type ViewportConstraints as cq, type ViewportFitBoundsParams as cr, type ViewportState as cs, type ViewportController as ct, type UnwrapPromise as cu, uiActionTriggerSchema as cv, uiFeatureActionSchema as cw, type UIPanelElementCreateClonable as cx, uiPanelCreateSchema as cy, type UIButtonElementCreateClonable as cz, type CustomTileBasemapInput as d, type FeltBasemap as e, type CircleElementCreate as f, type CircleElementRead as g, type CircleElementUpdate as h, type ElementChangeCallbackParams as i, type ElementCreate as j, type ElementGroup as k, type ElementGroupChangeCallbackParams as l, type ElementUpdate as m, type GetElementsConstraint as n, type HighlighterElementRead as o, type HighlighterElementUpdate as p, type ImageElementRead as q, type ImageElementUpdate as r, type MarkerElementRead as s, type MarkerElementUpdate as t, type NoteElementRead as u, type NoteElementUpdate as v, type PathElementRead as w, type PathElementUpdate as x, type PlaceElementCreate as y, type zInfer as z };
16470
+ export { type GeoJsonDataVectorSource as $, type PlaceElementRead as A, type BasemapsController as B, type ColorBasemap as C, type PlaceElementUpdate as D, type Element as E, type FeltController as F, type GetElementGroupsConstraint as G, type HighlighterElementCreate as H, type ImageElementCreate as I, type PolygonElementCreate as J, type PolygonElementRead as K, type LinkElementRead as L, type MarkerElementCreate as M, type NoteElementCreate as N, type PolygonElementUpdate as O, type PathElementCreate as P, type TextElementRead as Q, type TextElementUpdate as R, type ElementsController as S, type TextElementCreate as T, type UiControlsOptions as U, type ViewportCenterZoom as V, type MapInteractionEvent as W, type InteractionsController as X, type CreateLayersFromGeoJsonParams as Y, type DataOnlyLayer as Z, type FeltTiledVectorSource as _, type Basemap as a, type RasterHistogramBin as a$, type GeoJsonFileVectorSource as a0, type GeoJsonUrlVectorSource as a1, type GetLayerGroupsConstraint as a2, type GetLayersConstraint as a3, type GetRenderedFeaturesConstraint as a4, type Layer as a5, type LayerChangeCallbackParams as a6, type LayerCommon as a7, type LayerGroup as a8, type LayerGroupChangeCallbackParams as a9, type LayerBoundaries as aA, type LayerFilters as aB, type AggregatedGridConfig as aC, type AggregationConfig as aD, type AggregationMethod as aE, type CountGridConfig as aF, type GetLayerCalculationParams as aG, type GetLayerCategoriesGroup as aH, type GetLayerCategoriesParams as aI, type GetLayerHistogramBin as aJ, type GetLayerHistogramParams as aK, type GetLayerPrecomputedCalculationParams as aL, type GridConfig as aM, type GridType as aN, type MultiAggregationConfig as aO, type PrecomputedAggregationMethod as aP, type ValueConfiguration as aQ, type GetRasterAggregatesParams as aR, type GetRasterAggregatesResult as aS, type GetRasterCategoriesParams as aT, type GetRasterCategoriesResult as aU, type GetRasterHistogramParams as aV, type GetRasterHistogramResult as aW, type GetRasterProfileParams as aX, type GetRasterProfileResult as aY, type RasterAggregationMethod as aZ, type RasterCategory as a_, type LayerProcessingStatus as aa, type LegendDisplay as ab, type LegendItem as ac, type LegendItemChangeCallbackParams as ad, type LegendItemIdentifier as ae, type LegendItemsConstraint as af, type RasterBand as ag, type RasterLayer as ah, type RasterLayerSource as ai, type UpdateLayerParams as aj, type VectorLayer as ak, type LayerFeature as al, type RasterValue as am, type LayerSchema as an, type LayerSchemaAttribute as ao, type LayerSchemaBooleanAttribute as ap, type LayerSchemaCommonAttribute as aq, type LayerSchemaDateAttribute as ar, type LayerSchemaDateTimeAttribute as as, type LayerSchemaNumericAttribute as at, type LayerSchemaTextAttribute as au, type FilterExpression as av, type FilterLogicGate as aw, type FilterTernary as ax, type Filters as ay, type GeometryFilter as az, type ColorBasemapInput as b, type UITextElementUpdate as b$, type RasterPercentile as b0, type RasterProfileSample as b1, type LayersController as b2, type MapDetails as b3, type MiscController as b4, type ElementGroupNode as b5, type ElementNode as b6, type EntityNode as b7, type FeatureNode as b8, type FeatureSelection as b9, type PinToolSettings as bA, type PlaceFrame as bB, type PlaceSymbol as bC, type PolygonToolSettings as bD, type RouteToolSettings as bE, type TextToolSettings as bF, type ToolSettingsChangeEvent as bG, type ToolSettingsMap as bH, type ToolType as bI, type ToolsController as bJ, type CreateActionTriggerParams as bK, type CreateFeatureActionParams as bL, type CreateOrUpdatePanelParams as bM, type CreatePanelElementsParams as bN, type DeletePanelElementsParams as bO, type UiOnMapInteractionsOptions as bP, type UpdateActionTriggerParams as bQ, type UpdateFeatureActionParams as bR, type UpdatePanelElementsParams as bS, type PlacementForUIElement as bT, type UIPanel as bU, type UIPanelCreateOrUpdate as bV, type UIButtonElement as bW, type UIButtonElementCreate as bX, type UIButtonElementUpdate as bY, type UITextElement as bZ, type UITextElementCreate as b_, type LayerGroupNode as ba, type LayerNode as bb, type SelectionController as bc, type FeltBoundary as bd, type FeltZoom as be, type GeoJsonFeature as bf, type GeoJsonGeometry as bg, type GeoJsonProperties as bh, type LatLng as bi, type LineStringGeometry as bj, type LngLatTuple as bk, type MultiLineStringGeometry as bl, type MultiPointGeometry as bm, type MultiPolygonGeometry as bn, type PointGeometry as bo, type PolygonGeometry as bp, type SetVisibilityRequest as bq, type SortConfig as br, type SortDirection as bs, type CircleToolSettings as bt, type ConfigurableToolType as bu, type HighlighterToolSettings as bv, type InputToolSettings as bw, type LineToolSettings as bx, type MarkerToolSettings as by, type NoteToolSettings as bz, type CustomTileBasemap as c, type UIFlexibleSpaceElement as c0, type UIFlexibleSpaceElementCreate as c1, type UIFlexibleSpaceElementUpdate as c2, type UIDividerElement as c3, type UIDividerElementCreate as c4, type UIDividerElementUpdate as c5, type UITextInputElement as c6, type UITextInputElementCreate as c7, type UITextInputElementUpdate as c8, type UISelectElement as c9, type UIFeatureActionCreate as cA, type UiController as cB, type SetViewportCenterZoomParams as cC, type ViewportConstraints as cD, type ViewportFitBoundsParams as cE, type ViewportState as cF, type ViewportController as cG, type UnwrapPromise as cH, uiActionTriggerSchema as cI, uiFeatureActionSchema as cJ, type UIPanelElementCreateClonable as cK, uiPanelCreateSchema as cL, type UIButtonElementCreateClonable as cM, type MakeClonableSchema as cN, type UIButtonRowElementCreateClonable as cO, type PromiseOrNot as cP, type UnionToIntersection as cQ, type UISelectElementCreate as ca, type UISelectElementUpdate as cb, type UIPanelElement as cc, type UIPanelElementCreate as cd, type UIPanelElementUpdate as ce, type UIGridContainerElement as cf, type UIGridContainerElementCreate as cg, type UIGridContainerElementUpdate as ch, type UIButtonRowElement as ci, type UIButtonRowElementCreate as cj, type UIButtonRowElementUpdate as ck, type UICheckboxGroupElement as cl, type UICheckboxGroupElementCreate as cm, type UICheckboxGroupElementUpdate as cn, type UIRadioGroupElement as co, type UIRadioGroupElementCreate as cp, type UIRadioGroupElementUpdate as cq, type UIToggleGroupElement as cr, type UIToggleGroupElementCreate as cs, type UIToggleGroupElementUpdate as ct, type UIIframeElement as cu, type UIIframeElementCreate as cv, type UIIframeElementUpdate as cw, type UIControlElementOption as cx, type UIActionTriggerCreate as cy, type UIFeatureAction as cz, type CustomTileBasemapInput as d, type FeltBasemap as e, type CircleElementCreate as f, type CircleElementRead as g, type CircleElementUpdate as h, type ElementChangeCallbackParams as i, type ElementCreate as j, type ElementGroup as k, type ElementGroupChangeCallbackParams as l, type ElementUpdate as m, type GetElementsConstraint as n, type HighlighterElementRead as o, type HighlighterElementUpdate as p, type ImageElementRead as q, type ImageElementUpdate as r, type MarkerElementRead as s, type MarkerElementUpdate as t, type NoteElementRead as u, type NoteElementUpdate as v, type PathElementRead as w, type PathElementUpdate as x, type PlaceElementCreate as y, type zInfer as z };