@carto/api-client 0.5.28 → 0.5.30-alpha.143d135.117

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.
@@ -184,8 +184,30 @@ type AggregationType = 'count' | 'avg' | 'min' | 'max' | 'sum' | 'custom';
184
184
  /******************************************************************************
185
185
  * FILTERS
186
186
  */
187
+ /** A spatial filter expressed as a GeoJSON polygon, applied client- or server-side. */
188
+ type GeometrySpatialFilter = Polygon | MultiPolygon;
189
+ /**
190
+ * Filter restricting a widget query to a set of spatial-index cells (H3 or
191
+ * Quadbin). Used for point-and-click selection on cell-rendered layers. Sent to
192
+ * the server-side model API only; maps-api chooses the SQL strategy from
193
+ * `spatialDataType`, so the same payload works for both natively-indexed
194
+ * sources and point/geometry sources dynamically aggregated into cells.
195
+ *
196
+ * @privateRemarks Source: @carto/query-builder (SpatialIndexFilter)
197
+ */
198
+ interface SpatialIndexFilter {
199
+ /**
200
+ * Selected cell ids. h3 = hex string; h3int = `BigInt(\`0x${id}\`)`; quadbin
201
+ * = decimal or `0x`-hex string.
202
+ */
203
+ indexes: string[];
204
+ /** Must match the column type; `h3` and `h3int` are interchangeable. */
205
+ type: 'h3' | 'h3int' | 'quadbin';
206
+ }
187
207
  /** @privateRemarks Source: @carto/react-api */
188
- type SpatialFilter = Polygon | MultiPolygon;
208
+ type SpatialFilter = GeometrySpatialFilter | SpatialIndexFilter;
209
+ /** True when a {@link SpatialFilter} selects spatial-index cells rather than a polygon. */
210
+ declare function isSpatialIndexFilter(spatialFilter: SpatialFilter): spatialFilter is SpatialIndexFilter;
189
211
  /** @privateRemarks Source: @deck.gl/carto */
190
212
  interface Filters {
191
213
  [column: string]: Filter;
@@ -1040,6 +1062,7 @@ type Dataset = {
1040
1062
  name?: string | null;
1041
1063
  spatialIndex?: string | null;
1042
1064
  exportToBucketAvailable?: boolean;
1065
+ featureBbox?: boolean;
1043
1066
  };
1044
1067
 
1045
1068
  type StyleLayerGroupSlug = 'label' | 'road' | 'border' | 'building' | 'water' | 'land';
@@ -1760,7 +1783,7 @@ declare const filterFunctions: Record<FilterType, FilterFunction>;
1760
1783
 
1761
1784
  declare function geojsonFeatures({ geojson, spatialFilter, uniqueIdProperty, }: {
1762
1785
  geojson: FeatureCollection;
1763
- spatialFilter: SpatialFilter;
1786
+ spatialFilter: GeometrySpatialFilter;
1764
1787
  uniqueIdProperty?: string;
1765
1788
  }): FeatureData[];
1766
1789
 
@@ -1770,7 +1793,7 @@ type TileFeatures = {
1770
1793
  tileFormat: TileFormat;
1771
1794
  spatialDataType: SpatialDataType;
1772
1795
  spatialDataColumn?: string;
1773
- spatialFilter?: SpatialFilter;
1796
+ spatialFilter?: GeometrySpatialFilter;
1774
1797
  uniqueIdProperty?: string;
1775
1798
  rasterMetadata?: RasterMetadata;
1776
1799
  storeGeometry?: boolean;
@@ -1792,14 +1815,14 @@ type GeometryExtractOptions = {
1792
1815
  declare function tileFeaturesGeometries({ tiles, tileFormat, spatialFilter, uniqueIdProperty, options, }: {
1793
1816
  tiles: Tile[];
1794
1817
  tileFormat?: TileFormat;
1795
- spatialFilter?: SpatialFilter;
1818
+ spatialFilter?: GeometrySpatialFilter;
1796
1819
  uniqueIdProperty?: string;
1797
1820
  options?: GeometryExtractOptions;
1798
1821
  }): FeatureData[];
1799
1822
 
1800
1823
  type TileFeaturesSpatialIndexOptions = {
1801
1824
  tiles: SpatialIndexTile[];
1802
- spatialFilter?: SpatialFilter;
1825
+ spatialFilter?: GeometrySpatialFilter;
1803
1826
  spatialDataColumn: string;
1804
1827
  spatialDataType: SpatialDataType;
1805
1828
  };
@@ -1846,7 +1869,7 @@ declare class WidgetTilesetSourceImpl extends WidgetSource<WidgetTilesetSourcePr
1846
1869
  */
1847
1870
  loadGeoJSON({ geojson, spatialFilter, }: {
1848
1871
  geojson: FeatureCollection;
1849
- spatialFilter: SpatialFilter;
1872
+ spatialFilter: GeometrySpatialFilter;
1850
1873
  }): void;
1851
1874
  getFeatures(): Promise<FeaturesResponse>;
1852
1875
  getFormula({ column, operation, joinOperation, filters, filterOwner, spatialFilter, }: FormulaRequestOptions): Promise<FormulaResponse>;
@@ -1927,7 +1950,7 @@ declare class WidgetTilesetSource<Props extends WidgetTilesetSourceProps = Widge
1927
1950
  */
1928
1951
  loadGeoJSON({ geojson, spatialFilter, }: {
1929
1952
  geojson: FeatureCollection;
1930
- spatialFilter: SpatialFilter;
1953
+ spatialFilter: GeometrySpatialFilter;
1931
1954
  }): void;
1932
1955
  getFeatures(): Promise<FeaturesResponse>;
1933
1956
  getFormula({ signal, ...options }: FormulaRequestOptions): Promise<FormulaResponse>;
@@ -1993,11 +2016,27 @@ type VectorTilesetSourceOptions = SourceOptions & TilesetSourceOptions;
1993
2016
  type VectorTilesetSourceResponse = TilejsonResult & WidgetTilesetSourceResult;
1994
2017
  declare const vectorTilesetSource: (options: VectorTilesetSourceOptions) => Promise<VectorTilesetSourceResponse>;
1995
2018
 
1996
- type VectorTableSourceOptions = SourceOptions & TableSourceOptions & FilterOptions & ColumnsOption;
2019
+ type VectorTableSourceOptions = SourceOptions & TableSourceOptions & FilterOptions & ColumnsOption & {
2020
+ /**
2021
+ * If `true`, the server includes a `_carto_bbox` property on each polygon
2022
+ * feature, containing the bounding box of the full (unclipped) geometry as
2023
+ * a `"west,south,east,north"` string in WGS84. Used by clients to compute
2024
+ * stable label positions for polygons that span multiple tiles.
2025
+ */
2026
+ featureBbox?: boolean;
2027
+ };
1997
2028
  type VectorTableSourceResponse = TilejsonResult & WidgetTableSourceResult;
1998
2029
  declare const vectorTableSource: (options: VectorTableSourceOptions) => Promise<VectorTableSourceResponse>;
1999
2030
 
2000
- type VectorQuerySourceOptions = SourceOptions & QuerySourceOptions & FilterOptions & ColumnsOption;
2031
+ type VectorQuerySourceOptions = SourceOptions & QuerySourceOptions & FilterOptions & ColumnsOption & {
2032
+ /**
2033
+ * If `true`, the server includes a `_carto_bbox` property on each polygon
2034
+ * feature, containing the bounding box of the full (unclipped) geometry as
2035
+ * a `"west,south,east,north"` string in WGS84. Used by clients to compute
2036
+ * stable label positions for polygons that span multiple tiles.
2037
+ */
2038
+ featureBbox?: boolean;
2039
+ };
2001
2040
  type VectorQuerySourceResponse = TilejsonResult & WidgetQuerySourceResult;
2002
2041
  declare const vectorQuerySource: (options: VectorQuerySourceOptions) => Promise<VectorQuerySourceResponse>;
2003
2042
 
@@ -2238,4 +2277,4 @@ declare function getColumnNameFromGeoColumn(geoColumn: string | null | undefined
2238
2277
  */
2239
2278
  declare function getSpatialIndexFromGeoColumn(geoColumn: string): SpatialIndex | null;
2240
2279
 
2241
- export { type APIErrorContext, type APIRequestType, AUDIT_TAGS, type AddFilterOptions, type AggregationFunction, type AggregationType, AggregationTypes, type AggregationsRequestOptions, type AggregationsResponse, ApiVersion, type Attribute, _default as BASEMAP, type BaseRequestOptions, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CARTO_SOURCES, CartoAPIError, type CategoryOrderBy, type CategoryRequestOptions, type CategoryResponse, type CategoryResponseEntry, type CategoryResponseRaw, CellSet, type ColumnsOption, type D3Scale, DEFAULT_API_BASE_URL, type ExtentRequestOptions, type ExtentResponse, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type FetchMapOptions, type FetchMapResult, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, type FilterOptions, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GetFilterOptions, type GoogleBasemap, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type KeplerMapConfig, type Layer, type LayerDescriptor, type LayerType, type MapLibreBasemap, type MapType, type NamedQueryParameter, OPACITY_MAP, OTHERS_CATEGORY_NAME, type ParseMapResult, type PositionalQueryParameter, Provider, type ProviderType, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterBandType, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RasterTile, type RemoveFilterOptions, SOURCE_DEFAULTS, type Scale, type ScaleKey, type ScaleType, type Scales, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SchemaField, SchemaFieldType, type SortColumnType, type SortDirection, type SourceOptionalOptions, type SourceOptions, type SourceRequiredOptions, type SpatialDataType, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, SpatialIndexColumn, type SpatialIndexTile, type StringSearchOptions, TEXT_LABEL_INDEX, TEXT_NUMBER_FORMATTER, TEXT_OUTLINE_OPACITY, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type Tilejson, type TilejsonResult, type TilesetSourceOptions, type Tilestats, type TimeSeriesRequestOptions, type TimeSeriesResponse, type TrajectoryQuerySourceOptions, type TrajectoryQuerySourceResponse, type TrajectoryTableSourceOptions, type TrajectoryTableSourceResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, ErrorCode as _ErrorCode, type VecExprResult as _VecExprResult, applyLayerGroupFilters as _applyLayerGroupFilters, _buildFeatureFilter, createVecExprEvaluator as _createVecExprEvaluator, domainFromValues as _domainFromValues, evaluateVecExpr as _evaluateVecExpr, fillInMapDatasets as _fillInMapDatasets, fillInTileStats as _fillInTileStats, _getHexagonResolution, getLog10ScaleSteps as _getLog10ScaleSteps, getRasterTileLayerStyleProps as _getRasterTileLayerStyleProps, validateVecExprSyntax as _validateVecExprSyntax, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, calculateClusterRadius, calculateClusterTextFontSize, calculateLayerScale, clearDefaultRequestCache, clearFilters, compileCustomAggregation, configureSource, createColorScale, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getApplicableFilters, getClient, getColorAccessor, getColumnNameFromGeoColumn, getDataFilterExtensionProps, getDefaultAggregationExpColumnAliasForLayerType, getFilter, getIconUrlAccessor, getLayerDescriptor, getLayerProps, getMaxMarkerSize, getSizeAccessor, getSorter, getSpatialIndexFromGeoColumn, getTextAccessor, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, negateAccessor, opacityToAlpha, parseMap, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scaleAggregationResLevel, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, trajectoryQuerySource, trajectoryTableSource, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
2280
+ export { type APIErrorContext, type APIRequestType, AUDIT_TAGS, type AddFilterOptions, type AggregationFunction, type AggregationType, AggregationTypes, type AggregationsRequestOptions, type AggregationsResponse, ApiVersion, type Attribute, _default as BASEMAP, type BaseRequestOptions, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CARTO_SOURCES, CartoAPIError, type CategoryOrderBy, type CategoryRequestOptions, type CategoryResponse, type CategoryResponseEntry, type CategoryResponseRaw, CellSet, type ColumnsOption, type D3Scale, DEFAULT_API_BASE_URL, type ExtentRequestOptions, type ExtentResponse, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type FetchMapOptions, type FetchMapResult, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, type FilterOptions, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GeometrySpatialFilter, type GetFilterOptions, type GoogleBasemap, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type KeplerMapConfig, type Layer, type LayerDescriptor, type LayerType, type MapLibreBasemap, type MapType, type NamedQueryParameter, OPACITY_MAP, OTHERS_CATEGORY_NAME, type ParseMapResult, type PositionalQueryParameter, Provider, type ProviderType, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterBandType, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RasterTile, type RemoveFilterOptions, SOURCE_DEFAULTS, type Scale, type ScaleKey, type ScaleType, type Scales, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SchemaField, SchemaFieldType, type SortColumnType, type SortDirection, type SourceOptionalOptions, type SourceOptions, type SourceRequiredOptions, type SpatialDataType, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, SpatialIndexColumn, type SpatialIndexFilter, type SpatialIndexTile, type StringSearchOptions, TEXT_LABEL_INDEX, TEXT_NUMBER_FORMATTER, TEXT_OUTLINE_OPACITY, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type Tilejson, type TilejsonResult, type TilesetSourceOptions, type Tilestats, type TimeSeriesRequestOptions, type TimeSeriesResponse, type TrajectoryQuerySourceOptions, type TrajectoryQuerySourceResponse, type TrajectoryTableSourceOptions, type TrajectoryTableSourceResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, ErrorCode as _ErrorCode, type VecExprResult as _VecExprResult, applyLayerGroupFilters as _applyLayerGroupFilters, _buildFeatureFilter, createVecExprEvaluator as _createVecExprEvaluator, domainFromValues as _domainFromValues, evaluateVecExpr as _evaluateVecExpr, fillInMapDatasets as _fillInMapDatasets, fillInTileStats as _fillInTileStats, _getHexagonResolution, getLog10ScaleSteps as _getLog10ScaleSteps, getRasterTileLayerStyleProps as _getRasterTileLayerStyleProps, validateVecExprSyntax as _validateVecExprSyntax, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, calculateClusterRadius, calculateClusterTextFontSize, calculateLayerScale, clearDefaultRequestCache, clearFilters, compileCustomAggregation, configureSource, createColorScale, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getApplicableFilters, getClient, getColorAccessor, getColumnNameFromGeoColumn, getDataFilterExtensionProps, getDefaultAggregationExpColumnAliasForLayerType, getFilter, getIconUrlAccessor, getLayerDescriptor, getLayerProps, getMaxMarkerSize, getSizeAccessor, getSorter, getSpatialIndexFromGeoColumn, getTextAccessor, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, isSpatialIndexFilter, makeIntervalComplete, negateAccessor, opacityToAlpha, parseMap, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scaleAggregationResLevel, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, trajectoryQuerySource, trajectoryTableSource, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
@@ -184,8 +184,30 @@ type AggregationType = 'count' | 'avg' | 'min' | 'max' | 'sum' | 'custom';
184
184
  /******************************************************************************
185
185
  * FILTERS
186
186
  */
187
+ /** A spatial filter expressed as a GeoJSON polygon, applied client- or server-side. */
188
+ type GeometrySpatialFilter = Polygon | MultiPolygon;
189
+ /**
190
+ * Filter restricting a widget query to a set of spatial-index cells (H3 or
191
+ * Quadbin). Used for point-and-click selection on cell-rendered layers. Sent to
192
+ * the server-side model API only; maps-api chooses the SQL strategy from
193
+ * `spatialDataType`, so the same payload works for both natively-indexed
194
+ * sources and point/geometry sources dynamically aggregated into cells.
195
+ *
196
+ * @privateRemarks Source: @carto/query-builder (SpatialIndexFilter)
197
+ */
198
+ interface SpatialIndexFilter {
199
+ /**
200
+ * Selected cell ids. h3 = hex string; h3int = `BigInt(\`0x${id}\`)`; quadbin
201
+ * = decimal or `0x`-hex string.
202
+ */
203
+ indexes: string[];
204
+ /** Must match the column type; `h3` and `h3int` are interchangeable. */
205
+ type: 'h3' | 'h3int' | 'quadbin';
206
+ }
187
207
  /** @privateRemarks Source: @carto/react-api */
188
- type SpatialFilter = Polygon | MultiPolygon;
208
+ type SpatialFilter = GeometrySpatialFilter | SpatialIndexFilter;
209
+ /** True when a {@link SpatialFilter} selects spatial-index cells rather than a polygon. */
210
+ declare function isSpatialIndexFilter(spatialFilter: SpatialFilter): spatialFilter is SpatialIndexFilter;
189
211
  /** @privateRemarks Source: @deck.gl/carto */
190
212
  interface Filters {
191
213
  [column: string]: Filter;
@@ -1040,6 +1062,7 @@ type Dataset = {
1040
1062
  name?: string | null;
1041
1063
  spatialIndex?: string | null;
1042
1064
  exportToBucketAvailable?: boolean;
1065
+ featureBbox?: boolean;
1043
1066
  };
1044
1067
 
1045
1068
  type StyleLayerGroupSlug = 'label' | 'road' | 'border' | 'building' | 'water' | 'land';
@@ -1760,7 +1783,7 @@ declare const filterFunctions: Record<FilterType, FilterFunction>;
1760
1783
 
1761
1784
  declare function geojsonFeatures({ geojson, spatialFilter, uniqueIdProperty, }: {
1762
1785
  geojson: FeatureCollection;
1763
- spatialFilter: SpatialFilter;
1786
+ spatialFilter: GeometrySpatialFilter;
1764
1787
  uniqueIdProperty?: string;
1765
1788
  }): FeatureData[];
1766
1789
 
@@ -1770,7 +1793,7 @@ type TileFeatures = {
1770
1793
  tileFormat: TileFormat;
1771
1794
  spatialDataType: SpatialDataType;
1772
1795
  spatialDataColumn?: string;
1773
- spatialFilter?: SpatialFilter;
1796
+ spatialFilter?: GeometrySpatialFilter;
1774
1797
  uniqueIdProperty?: string;
1775
1798
  rasterMetadata?: RasterMetadata;
1776
1799
  storeGeometry?: boolean;
@@ -1792,14 +1815,14 @@ type GeometryExtractOptions = {
1792
1815
  declare function tileFeaturesGeometries({ tiles, tileFormat, spatialFilter, uniqueIdProperty, options, }: {
1793
1816
  tiles: Tile[];
1794
1817
  tileFormat?: TileFormat;
1795
- spatialFilter?: SpatialFilter;
1818
+ spatialFilter?: GeometrySpatialFilter;
1796
1819
  uniqueIdProperty?: string;
1797
1820
  options?: GeometryExtractOptions;
1798
1821
  }): FeatureData[];
1799
1822
 
1800
1823
  type TileFeaturesSpatialIndexOptions = {
1801
1824
  tiles: SpatialIndexTile[];
1802
- spatialFilter?: SpatialFilter;
1825
+ spatialFilter?: GeometrySpatialFilter;
1803
1826
  spatialDataColumn: string;
1804
1827
  spatialDataType: SpatialDataType;
1805
1828
  };
@@ -1846,7 +1869,7 @@ declare class WidgetTilesetSourceImpl extends WidgetSource<WidgetTilesetSourcePr
1846
1869
  */
1847
1870
  loadGeoJSON({ geojson, spatialFilter, }: {
1848
1871
  geojson: FeatureCollection;
1849
- spatialFilter: SpatialFilter;
1872
+ spatialFilter: GeometrySpatialFilter;
1850
1873
  }): void;
1851
1874
  getFeatures(): Promise<FeaturesResponse>;
1852
1875
  getFormula({ column, operation, joinOperation, filters, filterOwner, spatialFilter, }: FormulaRequestOptions): Promise<FormulaResponse>;
@@ -1927,7 +1950,7 @@ declare class WidgetTilesetSource<Props extends WidgetTilesetSourceProps = Widge
1927
1950
  */
1928
1951
  loadGeoJSON({ geojson, spatialFilter, }: {
1929
1952
  geojson: FeatureCollection;
1930
- spatialFilter: SpatialFilter;
1953
+ spatialFilter: GeometrySpatialFilter;
1931
1954
  }): void;
1932
1955
  getFeatures(): Promise<FeaturesResponse>;
1933
1956
  getFormula({ signal, ...options }: FormulaRequestOptions): Promise<FormulaResponse>;
@@ -1993,11 +2016,27 @@ type VectorTilesetSourceOptions = SourceOptions & TilesetSourceOptions;
1993
2016
  type VectorTilesetSourceResponse = TilejsonResult & WidgetTilesetSourceResult;
1994
2017
  declare const vectorTilesetSource: (options: VectorTilesetSourceOptions) => Promise<VectorTilesetSourceResponse>;
1995
2018
 
1996
- type VectorTableSourceOptions = SourceOptions & TableSourceOptions & FilterOptions & ColumnsOption;
2019
+ type VectorTableSourceOptions = SourceOptions & TableSourceOptions & FilterOptions & ColumnsOption & {
2020
+ /**
2021
+ * If `true`, the server includes a `_carto_bbox` property on each polygon
2022
+ * feature, containing the bounding box of the full (unclipped) geometry as
2023
+ * a `"west,south,east,north"` string in WGS84. Used by clients to compute
2024
+ * stable label positions for polygons that span multiple tiles.
2025
+ */
2026
+ featureBbox?: boolean;
2027
+ };
1997
2028
  type VectorTableSourceResponse = TilejsonResult & WidgetTableSourceResult;
1998
2029
  declare const vectorTableSource: (options: VectorTableSourceOptions) => Promise<VectorTableSourceResponse>;
1999
2030
 
2000
- type VectorQuerySourceOptions = SourceOptions & QuerySourceOptions & FilterOptions & ColumnsOption;
2031
+ type VectorQuerySourceOptions = SourceOptions & QuerySourceOptions & FilterOptions & ColumnsOption & {
2032
+ /**
2033
+ * If `true`, the server includes a `_carto_bbox` property on each polygon
2034
+ * feature, containing the bounding box of the full (unclipped) geometry as
2035
+ * a `"west,south,east,north"` string in WGS84. Used by clients to compute
2036
+ * stable label positions for polygons that span multiple tiles.
2037
+ */
2038
+ featureBbox?: boolean;
2039
+ };
2001
2040
  type VectorQuerySourceResponse = TilejsonResult & WidgetQuerySourceResult;
2002
2041
  declare const vectorQuerySource: (options: VectorQuerySourceOptions) => Promise<VectorQuerySourceResponse>;
2003
2042
 
@@ -2238,4 +2277,4 @@ declare function getColumnNameFromGeoColumn(geoColumn: string | null | undefined
2238
2277
  */
2239
2278
  declare function getSpatialIndexFromGeoColumn(geoColumn: string): SpatialIndex | null;
2240
2279
 
2241
- export { type APIErrorContext, type APIRequestType, AUDIT_TAGS, type AddFilterOptions, type AggregationFunction, type AggregationType, AggregationTypes, type AggregationsRequestOptions, type AggregationsResponse, ApiVersion, type Attribute, _default as BASEMAP, type BaseRequestOptions, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CARTO_SOURCES, CartoAPIError, type CategoryOrderBy, type CategoryRequestOptions, type CategoryResponse, type CategoryResponseEntry, type CategoryResponseRaw, CellSet, type ColumnsOption, type D3Scale, DEFAULT_API_BASE_URL, type ExtentRequestOptions, type ExtentResponse, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type FetchMapOptions, type FetchMapResult, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, type FilterOptions, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GetFilterOptions, type GoogleBasemap, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type KeplerMapConfig, type Layer, type LayerDescriptor, type LayerType, type MapLibreBasemap, type MapType, type NamedQueryParameter, OPACITY_MAP, OTHERS_CATEGORY_NAME, type ParseMapResult, type PositionalQueryParameter, Provider, type ProviderType, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterBandType, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RasterTile, type RemoveFilterOptions, SOURCE_DEFAULTS, type Scale, type ScaleKey, type ScaleType, type Scales, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SchemaField, SchemaFieldType, type SortColumnType, type SortDirection, type SourceOptionalOptions, type SourceOptions, type SourceRequiredOptions, type SpatialDataType, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, SpatialIndexColumn, type SpatialIndexTile, type StringSearchOptions, TEXT_LABEL_INDEX, TEXT_NUMBER_FORMATTER, TEXT_OUTLINE_OPACITY, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type Tilejson, type TilejsonResult, type TilesetSourceOptions, type Tilestats, type TimeSeriesRequestOptions, type TimeSeriesResponse, type TrajectoryQuerySourceOptions, type TrajectoryQuerySourceResponse, type TrajectoryTableSourceOptions, type TrajectoryTableSourceResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, ErrorCode as _ErrorCode, type VecExprResult as _VecExprResult, applyLayerGroupFilters as _applyLayerGroupFilters, _buildFeatureFilter, createVecExprEvaluator as _createVecExprEvaluator, domainFromValues as _domainFromValues, evaluateVecExpr as _evaluateVecExpr, fillInMapDatasets as _fillInMapDatasets, fillInTileStats as _fillInTileStats, _getHexagonResolution, getLog10ScaleSteps as _getLog10ScaleSteps, getRasterTileLayerStyleProps as _getRasterTileLayerStyleProps, validateVecExprSyntax as _validateVecExprSyntax, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, calculateClusterRadius, calculateClusterTextFontSize, calculateLayerScale, clearDefaultRequestCache, clearFilters, compileCustomAggregation, configureSource, createColorScale, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getApplicableFilters, getClient, getColorAccessor, getColumnNameFromGeoColumn, getDataFilterExtensionProps, getDefaultAggregationExpColumnAliasForLayerType, getFilter, getIconUrlAccessor, getLayerDescriptor, getLayerProps, getMaxMarkerSize, getSizeAccessor, getSorter, getSpatialIndexFromGeoColumn, getTextAccessor, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, negateAccessor, opacityToAlpha, parseMap, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scaleAggregationResLevel, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, trajectoryQuerySource, trajectoryTableSource, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
2280
+ export { type APIErrorContext, type APIRequestType, AUDIT_TAGS, type AddFilterOptions, type AggregationFunction, type AggregationType, AggregationTypes, type AggregationsRequestOptions, type AggregationsResponse, ApiVersion, type Attribute, _default as BASEMAP, type BaseRequestOptions, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CARTO_SOURCES, CartoAPIError, type CategoryOrderBy, type CategoryRequestOptions, type CategoryResponse, type CategoryResponseEntry, type CategoryResponseRaw, CellSet, type ColumnsOption, type D3Scale, DEFAULT_API_BASE_URL, type ExtentRequestOptions, type ExtentResponse, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type FetchMapOptions, type FetchMapResult, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, type FilterOptions, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GeometrySpatialFilter, type GetFilterOptions, type GoogleBasemap, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type KeplerMapConfig, type Layer, type LayerDescriptor, type LayerType, type MapLibreBasemap, type MapType, type NamedQueryParameter, OPACITY_MAP, OTHERS_CATEGORY_NAME, type ParseMapResult, type PositionalQueryParameter, Provider, type ProviderType, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterBandType, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RasterTile, type RemoveFilterOptions, SOURCE_DEFAULTS, type Scale, type ScaleKey, type ScaleType, type Scales, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SchemaField, SchemaFieldType, type SortColumnType, type SortDirection, type SourceOptionalOptions, type SourceOptions, type SourceRequiredOptions, type SpatialDataType, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, SpatialIndexColumn, type SpatialIndexFilter, type SpatialIndexTile, type StringSearchOptions, TEXT_LABEL_INDEX, TEXT_NUMBER_FORMATTER, TEXT_OUTLINE_OPACITY, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type Tilejson, type TilejsonResult, type TilesetSourceOptions, type Tilestats, type TimeSeriesRequestOptions, type TimeSeriesResponse, type TrajectoryQuerySourceOptions, type TrajectoryQuerySourceResponse, type TrajectoryTableSourceOptions, type TrajectoryTableSourceResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, ErrorCode as _ErrorCode, type VecExprResult as _VecExprResult, applyLayerGroupFilters as _applyLayerGroupFilters, _buildFeatureFilter, createVecExprEvaluator as _createVecExprEvaluator, domainFromValues as _domainFromValues, evaluateVecExpr as _evaluateVecExpr, fillInMapDatasets as _fillInMapDatasets, fillInTileStats as _fillInTileStats, _getHexagonResolution, getLog10ScaleSteps as _getLog10ScaleSteps, getRasterTileLayerStyleProps as _getRasterTileLayerStyleProps, validateVecExprSyntax as _validateVecExprSyntax, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, calculateClusterRadius, calculateClusterTextFontSize, calculateLayerScale, clearDefaultRequestCache, clearFilters, compileCustomAggregation, configureSource, createColorScale, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getApplicableFilters, getClient, getColorAccessor, getColumnNameFromGeoColumn, getDataFilterExtensionProps, getDefaultAggregationExpColumnAliasForLayerType, getFilter, getIconUrlAccessor, getLayerDescriptor, getLayerProps, getMaxMarkerSize, getSizeAccessor, getSorter, getSpatialIndexFromGeoColumn, getTextAccessor, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, isSpatialIndexFilter, makeIntervalComplete, negateAccessor, opacityToAlpha, parseMap, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scaleAggregationResLevel, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, trajectoryQuerySource, trajectoryTableSource, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
@@ -5559,6 +5559,9 @@ var SchemaFieldType = /* @__PURE__ */ ((SchemaFieldType2) => {
5559
5559
  SchemaFieldType2["Unknown"] = "unknown";
5560
5560
  return SchemaFieldType2;
5561
5561
  })(SchemaFieldType || {});
5562
+ function isSpatialIndexFilter(spatialFilter) {
5563
+ return Array.isArray(spatialFilter.indexes);
5564
+ }
5562
5565
 
5563
5566
  // src/utils.ts
5564
5567
  var FILTER_TYPES = new Set(Object.values(FilterType));
@@ -7357,16 +7360,17 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
7357
7360
  this._features.length = 0;
7358
7361
  }
7359
7362
  _extractTileFeatures(spatialFilter) {
7363
+ const geometryFilter = spatialFilter && !isSpatialIndexFilter(spatialFilter) ? spatialFilter : void 0;
7360
7364
  const prevInputs = this._tileFeatureExtractPreviousInputs;
7361
- if (this._features.length && spatialFilterEquals(prevInputs.spatialFilter, spatialFilter)) {
7365
+ if (this._features.length && spatialFilterEquals(prevInputs.spatialFilter, geometryFilter)) {
7362
7366
  return;
7363
7367
  }
7364
7368
  this._features = tileFeatures({
7365
7369
  ...assignOptional({}, this.props, this._tileFeatureExtractOptions),
7366
7370
  tiles: this._tiles,
7367
- spatialFilter
7371
+ spatialFilter: geometryFilter
7368
7372
  });
7369
- prevInputs.spatialFilter = spatialFilter;
7373
+ prevInputs.spatialFilter = geometryFilter;
7370
7374
  }
7371
7375
  /**
7372
7376
  * Loads features as GeoJSON (used for testing).
@@ -8242,7 +8246,8 @@ var vectorQuerySource = async function(options) {
8242
8246
  sqlQuery,
8243
8247
  tileResolution = DEFAULT_TILE_RESOLUTION,
8244
8248
  queryParameters,
8245
- aggregationExp
8249
+ aggregationExp,
8250
+ featureBbox
8246
8251
  } = options;
8247
8252
  const spatialDataType = "geo";
8248
8253
  const urlParameters = {
@@ -8263,6 +8268,9 @@ var vectorQuerySource = async function(options) {
8263
8268
  if (aggregationExp) {
8264
8269
  urlParameters.aggregationExp = aggregationExp;
8265
8270
  }
8271
+ if (featureBbox) {
8272
+ urlParameters.featureBbox = true;
8273
+ }
8266
8274
  return baseSource("query", options, urlParameters).then(
8267
8275
  (result) => ({
8268
8276
  ...result,
@@ -8285,7 +8293,8 @@ var vectorTableSource = async function(options) {
8285
8293
  spatialDataColumn = DEFAULT_GEO_COLUMN,
8286
8294
  tableName,
8287
8295
  tileResolution = DEFAULT_TILE_RESOLUTION,
8288
- aggregationExp
8296
+ aggregationExp,
8297
+ featureBbox
8289
8298
  } = options;
8290
8299
  const spatialDataType = "geo";
8291
8300
  const urlParameters = {
@@ -8303,6 +8312,9 @@ var vectorTableSource = async function(options) {
8303
8312
  if (aggregationExp) {
8304
8313
  urlParameters.aggregationExp = aggregationExp;
8305
8314
  }
8315
+ if (featureBbox) {
8316
+ urlParameters.featureBbox = true;
8317
+ }
8306
8318
  return baseSource("table", options, urlParameters).then(
8307
8319
  (result) => ({
8308
8320
  ...result,
@@ -10862,11 +10874,13 @@ function configureSource({
10862
10874
  tileResolution,
10863
10875
  ...queryParameters && { queryParameters }
10864
10876
  };
10877
+ const { featureBbox } = dataset;
10865
10878
  const vectorOptions = {
10866
10879
  spatialDataColumn,
10867
10880
  ...columns && { columns },
10868
10881
  ...filters && { filters },
10869
- ...aggregationExp && { aggregationExp }
10882
+ ...aggregationExp && { aggregationExp },
10883
+ ...featureBbox && { featureBbox }
10870
10884
  };
10871
10885
  if (type === "raster") {
10872
10886
  return rasterSource({
@@ -11150,6 +11164,21 @@ async function fetchMap({
11150
11164
  }
11151
11165
  }
11152
11166
  });
11167
+ const layers = map.keplerMapConfig.config.visState.layers;
11168
+ const datasetsWithLabels = /* @__PURE__ */ new Set();
11169
+ for (const layer of layers) {
11170
+ const hasTextLabel = layer.config?.textLabel?.some(
11171
+ (t) => t.field?.name
11172
+ );
11173
+ if (hasTextLabel) {
11174
+ datasetsWithLabels.add(layer.config.dataId);
11175
+ }
11176
+ }
11177
+ map.datasets.forEach((dataset) => {
11178
+ if (datasetsWithLabels.has(dataset.id) && (dataset.type === "table" || dataset.type === "query")) {
11179
+ dataset.featureBbox = true;
11180
+ }
11181
+ });
11153
11182
  const [basemap] = await Promise.all([
11154
11183
  fetchBasemapProps({ config: map.keplerMapConfig.config, errorContext }),
11155
11184
  // Mutates map.datasets so that dataset.data contains data
@@ -11449,6 +11478,7 @@ export {
11449
11478
  h3TilesetSource,
11450
11479
  hasFilter,
11451
11480
  histogram,
11481
+ isSpatialIndexFilter,
11452
11482
  makeIntervalComplete,
11453
11483
  negateAccessor,
11454
11484
  opacityToAlpha,