@carto/api-client 0.5.3 → 0.5.4-alpha.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.
@@ -5705,6 +5705,23 @@ function isValidBandValue(value, nodata) {
5705
5705
 
5706
5706
  // src/utils.ts
5707
5707
  init_cjs_shims();
5708
+
5709
+ // src/types.ts
5710
+ init_cjs_shims();
5711
+ var SchemaFieldType = /* @__PURE__ */ ((SchemaFieldType2) => {
5712
+ SchemaFieldType2["Number"] = "number";
5713
+ SchemaFieldType2["Bigint"] = "bigint";
5714
+ SchemaFieldType2["String"] = "string";
5715
+ SchemaFieldType2["Geometry"] = "geometry";
5716
+ SchemaFieldType2["Timestamp"] = "timestamp";
5717
+ SchemaFieldType2["Object"] = "object";
5718
+ SchemaFieldType2["Boolean"] = "boolean";
5719
+ SchemaFieldType2["Variant"] = "variant";
5720
+ SchemaFieldType2["Unknown"] = "unknown";
5721
+ return SchemaFieldType2;
5722
+ })(SchemaFieldType || {});
5723
+
5724
+ // src/utils.ts
5708
5725
  var FILTER_TYPES = new Set(Object.values(FilterType));
5709
5726
  function normalizeObjectKeys(el) {
5710
5727
  if (Array.isArray(el)) {
@@ -5754,6 +5771,13 @@ function assignOptional(target, ...sources) {
5754
5771
  }
5755
5772
  return target;
5756
5773
  }
5774
+ function getWidgetSpatialDataType(spatialDataType, spatialDataColumn, schema) {
5775
+ const field = schema.find((field2) => field2.name === spatialDataColumn);
5776
+ if (field && field.type === "geometry" /* Geometry */) {
5777
+ return "geo";
5778
+ }
5779
+ return spatialDataType;
5780
+ }
5757
5781
 
5758
5782
  // src/filters/tileFeatures.ts
5759
5783
  function tileFeatures({
@@ -5764,7 +5788,7 @@ function tileFeatures({
5764
5788
  spatialDataColumn = DEFAULT_GEO_COLUMN,
5765
5789
  spatialDataType,
5766
5790
  rasterMetadata,
5767
- options = {}
5791
+ storeGeometry = false
5768
5792
  }) {
5769
5793
  if (spatialDataType === "geo") {
5770
5794
  return tileFeaturesGeometries({
@@ -5772,7 +5796,7 @@ function tileFeatures({
5772
5796
  tileFormat,
5773
5797
  spatialFilter,
5774
5798
  uniqueIdProperty,
5775
- options
5799
+ options: { storeGeometry }
5776
5800
  });
5777
5801
  }
5778
5802
  if (tiles.some(isRasterTile)) {
@@ -7917,7 +7941,11 @@ var h3QuerySource = async function(options) {
7917
7941
  ...options,
7918
7942
  // NOTE: Parameters with default values above must be explicitly passed here.
7919
7943
  spatialDataColumn,
7920
- spatialDataType
7944
+ spatialDataType: getWidgetSpatialDataType(
7945
+ spatialDataType,
7946
+ spatialDataColumn,
7947
+ result.schema
7948
+ )
7921
7949
  })
7922
7950
  })
7923
7951
  );
@@ -7953,7 +7981,11 @@ var h3TableSource = async function(options) {
7953
7981
  ...options,
7954
7982
  // NOTE: Parameters with default values above must be explicitly passed here.
7955
7983
  spatialDataColumn,
7956
- spatialDataType
7984
+ spatialDataType: getWidgetSpatialDataType(
7985
+ spatialDataType,
7986
+ spatialDataColumn,
7987
+ result.schema
7988
+ )
7957
7989
  })
7958
7990
  })
7959
7991
  );
@@ -8042,7 +8074,11 @@ var quadbinQuerySource = async function(options) {
8042
8074
  ...options,
8043
8075
  // NOTE: Parameters with default values above must be explicitly passed here.
8044
8076
  spatialDataColumn,
8045
- spatialDataType
8077
+ spatialDataType: getWidgetSpatialDataType(
8078
+ spatialDataType,
8079
+ spatialDataColumn,
8080
+ result.schema
8081
+ )
8046
8082
  })
8047
8083
  })
8048
8084
  );
@@ -8078,7 +8114,11 @@ var quadbinTableSource = async function(options) {
8078
8114
  ...options,
8079
8115
  // NOTE: Parameters with default values above must be explicitly passed here.
8080
8116
  spatialDataColumn,
8081
- spatialDataType
8117
+ spatialDataType: getWidgetSpatialDataType(
8118
+ spatialDataType,
8119
+ spatialDataColumn,
8120
+ result.schema
8121
+ )
8082
8122
  })
8083
8123
  })
8084
8124
  );
@@ -10383,21 +10423,6 @@ function _isMultiPolygon(geometry) {
10383
10423
  return getType(geometry) === "MultiPolygon";
10384
10424
  }
10385
10425
 
10386
- // src/types.ts
10387
- init_cjs_shims();
10388
- var SchemaFieldType = /* @__PURE__ */ ((SchemaFieldType2) => {
10389
- SchemaFieldType2["Number"] = "number";
10390
- SchemaFieldType2["Bigint"] = "bigint";
10391
- SchemaFieldType2["String"] = "string";
10392
- SchemaFieldType2["Geometry"] = "geometry";
10393
- SchemaFieldType2["Timestamp"] = "timestamp";
10394
- SchemaFieldType2["Object"] = "object";
10395
- SchemaFieldType2["Boolean"] = "boolean";
10396
- SchemaFieldType2["Variant"] = "variant";
10397
- SchemaFieldType2["Unknown"] = "unknown";
10398
- return SchemaFieldType2;
10399
- })(SchemaFieldType || {});
10400
-
10401
10426
  // src/spatial-index.ts
10402
10427
  init_cjs_shims();
10403
10428
  var DEFAULT_TILE_SIZE = 512;