Generated with the help of an LLM.
Problem/Motivation
The module can read spatial files through GDAL and offers an upload widget for Geofield, but a file can only be loaded into one field at a time, by hand. Sites that import many features (boundaries, roads, address points) have no way to map a file's attributes and geometry to entities, to update existing entities on re-import, or to run the import on a schedule.
Feeds is the usual answer for this in Drupal, but it has no parser for formats like Shapefile, GeoPackage, KML or GeoJSON with their attribute tables. Sites end up converting files to CSV with WKT by hand, which loses the CRS handling and encoding detection the module already does.
Steps to reproduce
- Install Spatial Tools and Feeds.
- Create a feed type and look for a parser that accepts a Shapefile or GeoPackage.
- None is available. The only route is a manual CSV/WKT conversion outside Drupal.
Proposed resolution
After the #2924446: Port Spatial Tools to Drupal 11 and Drupal 12 is fixed, add an optional submodule (for example spatial_feeds) that depends on Feeds and provides:
- A Feeds parser plugin that reads any format supported by the existing
spatial.file_readerservice, one feature per Feeds item. - Mapping sources for each attribute column, plus the geometry as WKT, so it can be mapped to a Geofield target with the stock Feeds mapping UI.
- Source CRS handling and reprojection to EPSG:4326 using the module's existing settings.
- Batch-friendly reading, so large files are processed in chunks across Feeds' import batches.
Fetching and processing stay with Feeds (upload, directory or HTTP fetcher, entity processors, unique targets for updates), so the submodule only adds the parser.
Remaining tasks
- Agree on the approach and submodule name with the maintainers.
- Implement the parser plugin and its configuration form.
- Add Kernel tests with small Shapefile, GeoJSON and GeoPackage fixtures.
- Document the feature in the README.
User interface changes
A new parser option on the Feeds feed type form, with a small configuration form (layer name, source CRS override). No change for sites that do not enable the submodule.
API changes
None to existing APIs. The submodule adds a Feeds parser plugin.
Data model changes
None.
Comments