Skip to content

Conversation

@MatthewDownsNR
Copy link

Overview

This PR enhances the ParquetProvider with critical geometry handling fixes and adds support for configurable geometry columns, including WKT format support.

Key improvements:

  • Fixed critical index mismatch bug that caused geometry to appear as null in individual item requests (/collections/.../items/[id])
  • Added support for configurable geometry columns via geometry_column parameter in provider configuration
  • Added WKT (Well-Known Text) geometry support alongside existing WKB support
  • Enhanced geometry source prioritization with proper fallback handling
  • Improved error handling and logging for geometry operations
  • Added backward compatibility for older pygeoapi versions without crs_transform

Bug fixes:

  • Resolved 'list' object attribute 'index' is read-only error in get() method
  • Fixed geometry index alignment issues in both query() and get() methods
  • Corrected bbox filtering logic for x/y field configurations

Related Issue / discussion

This PR addresses multiple issues reported by users:

  • Parquet files with existing geometry columns (WKT format) were not supported
  • Individual item requests returned null geometry despite having valid geometry data
  • Users experienced "identifier not found" errors due to geometry processing failures
  • The provider only supported x/y coordinate fields, not pre-existing geometry columns

These improvements make the ParquetProvider more robust and compatible with real-world geospatial parquet files that contain geometry in various formats.

Additional information

Testing performed:

  • All existing 12 ParquetProvider tests continue to pass
  • Added comprehensive testing for WKT geometry column support
  • Verified backward compatibility with x/y field configurations
  • Tested with both S3 and local file sources
  • Confirmed proper handling of missing geometry scenarios

Configuration examples:

# New geometry column support
providers:
  - type: feature
    name: Parquet
    data:
      source: s3://bucket/data.parquet
    geometry_column: wkt_geom  # Now supported!
    id_field: unique_id

# Existing x/y field support (unchanged)
providers:  
  - type: feature
    name: Parquet
    data:
      source: local_data.parquet
    x_field: longitude
    y_field: latitude
    id_field: id

Breaking changes: None - all changes are backward compatible.

Dependency policy (RFC2)

  • I have ensured that this PR meets RFC2 requirements

Updates to public demo

Note: No breaking changes were introduced, so no demo updates are required.

Contributions and licensing

(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)

  • I'd like to contribute bugfix and feature enhancements to pygeoapi. I confirm that my contributions to pygeoapi will be compatible with the pygeoapi license guidelines at the time of contribution
  • I have already previously agreed to the pygeoapi Contributions and Licensing Guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant