duckdb / duckdb_spatial

MIT License
492 stars 41 forks source link

Not implemented Error: Unsupported type for OGR: UBIGINT #320

Open marklit opened 6 months ago

marklit commented 6 months ago

Any plans to support H3s in uint64 form? This is with v0.10.1 4a89d97db8.

$ aws s3 --no-sign-request cp s3://overturemaps-us-west-2/release/2024-05-16-beta.0/theme=base/type=land_use/part-00065* ./
COPY (
      SELECT geometry,
             subtype,
             SUBSTR(update_time, 1, 7) AS updated_at,
             version,
             JSON(bbox) AS bbox,
             cartography.min_zoom AS min_zoom,
             cartography.max_zoom AS max_zoom,
             h3_cell_to_parent(h3_string_to_h3(SUBSTR(id, 0, 17)), 2) AS h3_2
      FROM READ_PARQUET('part-00065*.parquet')
      WHERE h3_2 = h3_string_to_h3('82089ffffffffff')
         OR h3_2 = h3_string_to_h3('821137fffffffff')
         OR h3_2 = h3_string_to_h3('821f67fffffffff'))
  TO 'estonia_land_cover.gpkg'
  WITH (FORMAT GDAL,
        DRIVER 'GPKG',
        LAYER_CREATION_OPTIONS 'WRITE_BBOX=YES');
Not implemented Error: Unsupported type for OGR: UBIGINT
Maxxen commented 6 months ago

Sure, we should add support for all the unsigned type as well. But I think H3 should work with signed ints too, you might be able to work around this with a cast for now.

Maxxen commented 6 months ago

Actually, looks like GDAL doesn't support unsigned ints as OGR fields at all? But we should be able to do a try-cast internally (or error out) at least so that the user doesn't have to worry about this.