Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
f6d9436
Implement DuckDB-based converter
ivorbosloper Dec 8, 2025
6f52d97
Not sure if this is right
ivorbosloper Dec 8, 2025
0a854ad
Update project
ivorbosloper Dec 8, 2025
996cc38
Fix tests
ivorbosloper Dec 8, 2025
51bea87
Add collection to metadata
ivorbosloper Dec 9, 2025
2d3fc50
Add required to arrow definition
ivorbosloper Dec 9, 2025
852fb6a
Support for sources with different schemas
ivorbosloper Dec 10, 2025
3cf3b8d
Export collection and set compression
m-mohr Dec 10, 2025
c524142
Add caching and warnings
m-mohr Dec 10, 2025
0d5a9f9
Add todos
m-mohr Dec 10, 2025
07d7aac
Fix tests
m-mohr Dec 10, 2025
78fb00d
Implement rewrite to correct GeoParquet
ivorbosloper Dec 10, 2025
dd88ed0
Merge branch 'main' into duckdb_converter
m-mohr Feb 13, 2026
6017ef0
Update fiboa_cli/conversion/duckdb.py
ivorbosloper Feb 13, 2026
993824e
Merge branch 'main' into duckdb_converter
ivorbosloper Feb 16, 2026
920b39d
Update pixi.lock for duckdb
ivorbosloper Feb 16, 2026
5aad9cb
Update pixi
ivorbosloper May 15, 2026
892be96
PerFileBaseConverter: per-file migration and merging the result, decr…
ivorbosloper May 19, 2026
06e47ea
Update ES Provinces list
ivorbosloper May 20, 2026
13aa258
Fix hilbert-sort bug
ivorbosloper May 20, 2026
cf85e81
Fail early for debugging
ivorbosloper May 20, 2026
cea4333
Don't upload part files
ivorbosloper May 20, 2026
4ba30ca
Keep geo_parquet version in PerFileConverter
ivorbosloper May 20, 2026
e69174d
Simplify `fiboa publish` for catalog-driven publication
ivorbosloper Aug 21, 2026
f8944b4
NL: new PDOK download location, 2026 concept edition; DE-TH: INSPIRE …
ivorbosloper Aug 22, 2026
3b8d8f1
Declare beautifulsoup4 (used by es_pv, es_vc)
ivorbosloper Aug 22, 2026
d22b603
Drop rows without a required crop:code instead of failing the conversion
ivorbosloper Aug 22, 2026
b92251a
Look up the source column when dropping rows without a crop:code
ivorbosloper Aug 22, 2026
a4afe88
DE-BB: read the shapefile as cp1252
ivorbosloper Aug 22, 2026
53204af
CZ: find the shapefile in nested archive folders
ivorbosloper Aug 22, 2026
33d5ffd
ES-CAT: the 2024 download is a shapefile package
ivorbosloper Aug 22, 2026
4eeff30
SK: row index as id, KODKD block code as block_id
ivorbosloper Aug 22, 2026
077238e
ES-CAT: map the 34 crop names new in the 2024 edition
ivorbosloper Aug 22, 2026
c4466ce
ES-MD: find RECINTO.shp wherever the archive puts it
ivorbosloper Aug 22, 2026
a43baf5
EE: explicit cache names for the WFS responses
ivorbosloper Aug 22, 2026
d5287db
Guard the crop:code row drop (>1% is an error); Europe-LAND: crop_nam…
ivorbosloper Aug 22, 2026
74dd442
ES-CB: determination date from the variant year
ivorbosloper Aug 23, 2026
3a91027
ES-CM: use the year-named service; REST: never cache an error response
ivorbosloper Aug 23, 2026
c84dae8
ES-CM: the id field is OBJECTID_1 (case matters for the page cursor)
ivorbosloper Aug 23, 2026
4870271
ES-AR: per-municipality SIGPAC files listed from IDEAragon
ivorbosloper Aug 23, 2026
07ae56a
ES-AN: CD_USO is the land-use column; determination date from the var…
ivorbosloper Aug 23, 2026
bd45156
REST: drop a page whose download broke off instead of caching it
ivorbosloper Aug 23, 2026
5bfed06
ES-CM: uppercase REST field names, determination date from the varian…
ivorbosloper Aug 23, 2026
047dd0b
ES-CL: the ITACyL server is https-only now
ivorbosloper Aug 23, 2026
0fda9d4
ES-CL: find the shapefiles in the 2025 province subfolders; determina…
ivorbosloper Aug 23, 2026
2a5a3f7
ES-IB: the service now publishes one current-state layer with joined …
ivorbosloper Aug 23, 2026
376a3d7
FR: extract multi-volume 7z archives (py7zr via multivolumefile)
ivorbosloper Aug 23, 2026
da74504
HCAT: absolute ec_mapping_csv URLs also work via commons.ec.load_ec_m…
ivorbosloper Aug 24, 2026
3163614
publish: pass $TMPDIR to tippecanoe (-t), it does not honor the env var
ivorbosloper Aug 24, 2026
fe88bfb
FR: RPG 3.0 (2024) ships the parcels as RPG_Parcelles.gpkg; fix no-op…
ivorbosloper Aug 24, 2026
612ee1e
Merge remote-tracking branch 'origin/duckdb_converter' into publish-p…
ivorbosloper Aug 24, 2026
306dded
JP: default to the 2024 variant (test fixture last), per-feature dete…
ivorbosloper Aug 24, 2026
c1e58b5
Merge remote-tracking branch 'origin/ES2' into publish-portolan
ivorbosloper Aug 24, 2026
9fe304d
Fix es converter test wiring and metadata after ES2 merge
ivorbosloper Aug 24, 2026
b740a07
PerFileConverter: remove part files after a successful merge
ivorbosloper Aug 24, 2026
d26c300
PerFileConverter: vendor the Hilbert helpers missing from released ve…
ivorbosloper Aug 24, 2026
f25e683
FR: backfill-ready variants — 2024 first, explicit PARCELLES targets,…
ivorbosloper Aug 25, 2026
d0f950b
NZ: 2017 and 2020 editions as variants; resolve manual downloads from…
ivorbosloper Aug 25, 2026
8f8d2b4
US CSB: variants 2017-2024 from the single 2017-2024 archive; determi…
ivorbosloper Aug 25, 2026
7d603dd
BE-VLG: the 2026 archive is not named *_GPKG.zip; glob the gpkg inside
ivorbosloper Aug 25, 2026
e112c77
BE-VLG: map the 2026 agpa edition's English column names onto the cla…
ivorbosloper Aug 25, 2026
e117013
Tests for the per-file merge, Hilbert helpers, and command wrapper mo…
ivorbosloper Aug 28, 2026
10e174d
Windows/CI robustness: close parquet readers before delete/replace; l…
ivorbosloper Aug 28, 2026
5463f6c
NL: 2020 edition is a gpkg, and 2009 (zip) exists — fix the variant r…
ivorbosloper Aug 28, 2026
a2b91fc
NL: the 2009-2019 zips contain a FileGDB; extract and glob it
ivorbosloper Aug 28, 2026
a201a98
NL: map the 2009-2019 FileGDB column names; year from the variant
ivorbosloper Aug 28, 2026
b154cf4
Drop rows without an id like rows without a crop code (bounded at 1%)
ivorbosloper Aug 28, 2026
7d5d9aa
DK: the 2008/2009 editions have no crop columns; convert them as boun…
ivorbosloper Aug 28, 2026
10a8cbf
HCAT: skip mapping when an edition has no crop columns at all
ivorbosloper Aug 28, 2026
835cebd
Canonical Hilbert ordering for every output; publish repairs in place
ivorbosloper Aug 28, 2026
6bf0a66
Widen binary/string offsets before the in-place Hilbert take
ivorbosloper Aug 28, 2026
eeceb86
DuckDB converter: declare the appended bbox column as geo covering
ivorbosloper Aug 29, 2026
7243646
Merge branch 'main' into publish-portolan
m-mohr Aug 29, 2026
c5742c0
Adopt vecorel-cli 0.2.16: upstream Hilbert sorting, drop the vendored…
ivorbosloper Aug 29, 2026
4688a00
EE: the 2010-2015 WFS layers are published empty; offer 2016-2024
ivorbosloper Aug 30, 2026
bbee51e
Resort rewrite: preserve schema metadata via batch-wise narrow-schema…
ivorbosloper Aug 30, 2026
5ea3dc1
ES-CB: the REST service now also serves the 2025 SIGPAC layers
ivorbosloper Aug 30, 2026
32171c7
REST converter: discover the qualified key on joined layers; use orde…
ivorbosloper Aug 30, 2026
992f15b
Pre-warm all schema URIs with retries before converting
ivorbosloper Aug 30, 2026
c531e64
Merge branch 'main' into publish-portolan
m-mohr Aug 31, 2026
7147f9f
Fix pixi.lock
m-mohr Aug 31, 2026
6b5a373
REST converter: page by id windows instead of server-side sort
ivorbosloper Aug 31, 2026
db57660
ES-GA: editions 2014-2026, per-campaign column names, determination b…
ivorbosloper Sep 1, 2026
48fe60e
REST converter: key cached pages by service, not just layer id
ivorbosloper Sep 1, 2026
af3bbe8
ES-GA: keep only mapped columns per page
ivorbosloper Sep 1, 2026
b322fa3
Drop empty/missing geometries; widen schema prewarm retries
ivorbosloper Sep 2, 2026
3ce10ae
ES-GA: exclude PR (pasto arbustivo) before the 2023 campaign
ivorbosloper Sep 2, 2026
bb2e0bc
PT: add the 2025 edition, which changed shape
ivorbosloper Sep 3, 2026
f9b6d53
ES-GA, ES-CM: give both converters their region in short_name
ivorbosloper Sep 3, 2026
16fc5b3
ES-CB: name Cantabria as the provider
ivorbosloper Sep 3, 2026
715afa2
ES-IB: point the provider at the Balearic government, not Navarra's
ivorbosloper Sep 3, 2026
e6048e6
EC-EE: name the shapefile inside the archive
ivorbosloper Sep 3, 2026
6e78b99
EC-LV, EC-SI: stop requiring columns the source leaves empty
ivorbosloper Sep 3, 2026
c3f89ad
EC-EE: migrate the year column the dataset actually has
ivorbosloper Sep 3, 2026
2105e43
EC-SI, EC-EE: require only what every parcel actually has
ivorbosloper Sep 3, 2026
d15e0d1
AT: extract the archive instead of reading the GeoPackage through the…
ivorbosloper Sep 3, 2026
9d8a640
Hilbert order: fall back to the data's extent when the CRS has no are…
ivorbosloper Sep 3, 2026
e972a2d
DE-NDS: give the collection an id
ivorbosloper Sep 4, 2026
47a4033
DE-BB, SK: give both collections an id, and require one from every co…
ivorbosloper Sep 6, 2026
9e7dada
ES-CB: state Cantabria's own licence, not CC-BY-NC
ivorbosloper Sep 6, 2026
2e1393f
DE-BB: ref_ident is the field block (FLIK), not a farmer
ivorbosloper Sep 7, 2026
ed408b9
HR: keep ARKOD's parcel id, and require nothing the archives lack
ivorbosloper Sep 7, 2026
88194e3
Converters: refuse to declare both sources and variants
ivorbosloper Sep 7, 2026
6237d59
HR: declare the CRS the archives leave undefined
ivorbosloper Sep 7, 2026
7f33180
Converters: require `id` to identify a field, and fix the seven that …
ivorbosloper Sep 7, 2026
f6e3ab5
DK, ES-CL: the id check judged rows the conversion drops
ivorbosloper Sep 8, 2026
0637b5a
Tests for the REST paging and the tile step, which nothing covered
ivorbosloper Sep 8, 2026
87b64ec
DE-SH: bring the converter and its fixture up to main's version
Sep 9, 2026
06f02ae
BE-VLG: REF_ID references the parcel, not the field
ivorbosloper Sep 10, 2026
4ec1054
BE-VLG: glob for the GeoPackage inside the archive
ivorbosloper Sep 10, 2026
795b967
BE-VLG: read the 2020 GeoPackage as cp1252
ivorbosloper Sep 10, 2026
07710bf
BE-VLG: skip the QGIS styles table in the 2026 GeoPackage
ivorbosloper Sep 10, 2026
5955623
BE-VLG: declare the CRS the 2020 snapshot leaves undefined
ivorbosloper Sep 10, 2026
620f9d3
FI: one variant per year, not just 2023
ivorbosloper Sep 10, 2026
fd9ca81
SI: the archives go back to 2019, not 2021
ivorbosloper Sep 10, 2026
d5733d2
SI: find the shapefile when the archive nests it
ivorbosloper Sep 10, 2026
f8ccdb7
SI: the 2021 archive ships no .prj, so declare the grid
ivorbosloper Sep 10, 2026
e90b11f
LT: read Europe-LAND v1.3, which has 2025 beside 2024
ivorbosloper Sep 10, 2026
bb6c35a
SI: the 2019 campaign names its columns differently, and the id check…
ivorbosloper Sep 10, 2026
643b085
SI: pad the 2020 crop codes, which lost their leading zeros
ivorbosloper Sep 10, 2026
0262d3f
HCAT: let a converter name supplementary mapping tables, and use one …
ivorbosloper Sep 10, 2026
a98e8e6
FR: map the codes EuroCrops leaves out, from fiboa.org
ivorbosloper Sep 10, 2026
28f8e94
FR: RPG's parcel id repeats in 2024, so publish it beside a row number
ivorbosloper Sep 11, 2026
e4e5959
Get rid of rubish
ivorbosloper Sep 11, 2026
15419d4
BE-WAL: the crops were in the table all along, under their names
ivorbosloper Sep 11, 2026
47669ec
HCAT: strip the names on both sides of the fallback
ivorbosloper Sep 11, 2026
acdc5fd
EC-LT: the Lithuanian names, and the mapping that was guessed from them
ivorbosloper Sep 12, 2026
a4ae79c
CZ: read the 2019-2022 editions, which name their columns differently
ivorbosloper Sep 12, 2026
89b2e6a
CZ: recover the crop codes the 2020 edition leaves empty
ivorbosloper Sep 12, 2026
e5dc35a
CZ: map the crop codes EuroCrops does not carry
ivorbosloper Sep 12, 2026
93cee10
CZ: publish a declaration that straddles two land blocks once
ivorbosloper Sep 12, 2026
604af42
CZ: refresh the crop-code fixture with the post-2023 codes
ivorbosloper Sep 12, 2026
f3ce959
SK: the nine editions the portal publishes, and the space that hid th…
ivorbosloper Sep 12, 2026
a9852aa
REST converters: strip a join's table prefixes, and survive a tired s…
ivorbosloper Sep 12, 2026
cf37041
ES-IB: editions 2022-2026, from the two services that now hold them
ivorbosloper Sep 11, 2026
1f28b73
REST converters: retry the metadata and the probe too, not only the b…
ivorbosloper Sep 12, 2026
a1f4dda
REST converters: eight attempts, not five
ivorbosloper Sep 12, 2026
f8aea60
REST converters: read the key field from the layer, not from a row
ivorbosloper Sep 12, 2026
545ada0
REST converters: ask a refused page for again
ivorbosloper Sep 12, 2026
bba7d6e
DE-SH: bring the converter and its fixture up to main's version (#229)
ivorbosloper Sep 12, 2026
5e85b84
A field block collection says so in its title
ivorbosloper Sep 12, 2026
26c0800
SE and BG: the editions their services actually hold
ivorbosloper Sep 13, 2026
a8bce8a
BG: the 2021 and 2022 layers are a release of their own
ivorbosloper Sep 13, 2026
42ebd20
BG: PHBIDENT is the block, not the polygon
ivorbosloper Sep 13, 2026
98ef770
EE: publish the land use, the only classification the source has
ivorbosloper Sep 13, 2026
54dcb2f
EE: pollu_id repeats, so it is parcel_id
ivorbosloper Sep 13, 2026
9504ade
EE: a crop code, because the extension requires one
ivorbosloper Sep 13, 2026
a4ae1a7
Put the easting in x, whatever the source's CRS says
ivorbosloper Sep 13, 2026
3f29718
IE: an id that is unique, and an area at all
ivorbosloper Sep 13, 2026
e892364
LV: the yearly campaigns from data.gov.lv (#286)
ivorbosloper Sep 15, 2026
74269cb
EC-FR: the 2018 campaign, from EuroCrops (#288)
ivorbosloper Sep 15, 2026
5f080dd
EuroCrops: fetch from Zenodo with requests (#288)
ivorbosloper Sep 15, 2026
8ce3908
EC-FR: split the multi-part parcels, and share that split (#288, #286)
ivorbosloper Sep 15, 2026
c499e19
EC-FR: distinct ids for the parts of a multi-part parcel (#288)
ivorbosloper Sep 15, 2026
e3c7a48
DE-SL: the paged converters from main, so Saarland can be built
ivorbosloper Sep 16, 2026
fd097d7
Move the pin to vecorel-cli 0.2.18, so Saarland can be downloaded
ivorbosloper Sep 16, 2026
f66b9f5
DE-SL: an id that survives the geometry split
ivorbosloper Sep 16, 2026
f1118fc
ES-EX, ES-NC: the recintos FEGA publishes (#292)
ivorbosloper Sep 16, 2026
806cef7
ES-EX, ES-NC: an id that survives the geometry split (#292)
ivorbosloper Sep 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ __pycache__/
# Coverage
.coverage
.coverage.*
converage.json
coverage.xml
htmlcov/

Expand All @@ -27,3 +28,5 @@ htmlcov/
/tests/data-files/convert/*/extracted.*/
/tests/data-files/convert/**/*.gfs
*.tmp

build/
45 changes: 43 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,57 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

- Put the easting in x whatever the source's CRS says: a source that honours EPSG's axis order ships its coordinates northing first (Jordbruksverket's shapefile declares it), and GeoParquet stores x, y — so the tiles, the STAC bbox and the bbox covering all read such a file as (lat, lon)
- EE: mint a crop code — PRIA publishes the crop as free text and none of its own, and the crop extension requires `crop:code` and `crop:code_list` — and publish taotletud_maakasutus as `land_use` (arable, permanent grassland, restored grassland, permanent crops, black fallow) — the only classification the source has, since it publishes the crop as free text and no crop code at all; and keep pollu_id as `parcel_id`, because it repeats in a few rows of some editions (16 of the 165,244 in 2016); and a first test with a fixture
- SE: eleven editions, 2015-2025 — the campaign is a filter on one WFS layer, so every year the service holds is a variant (it answers 2015 through 2025), over https because the http URL redirects
- BG: the ministry's GeoServer publishes Agricultural_Land_<year> for 2021-2025, not the Arable_Land_2024 the converter asked for; the 2021 and 2022 layers are a different release again (block and usage in one ELGIDENT field, with an area column the later ones lack), PHBIDENT identifies the block rather than the polygon so it is published as block_id, and the Bulgarian names need UTF-8 forced because GeoServer writes the charset into a .cst file GDAL does not read
-
- SK: nine editions, 2018-2026, from the per-campaign datasets on data.slovensko.sk (the single edition was labelled by its download year and held the 2024 file); the crop names are matched with their no-break spaces normalised, which alone maps 102,835 grassland fields
- CZ: support the GPZ_DP schema of the 2019-2022 editions (renamed crop/area columns, no application date, ENTITA_ID is the block), recover the crop codes the 2020 edition leaves empty, map the 120 crop codes EuroCrops does not carry, and publish a declaration that straddles two land blocks once
- Add DuckDB BaseConverter for efficiently transforming large datasets
- Fix `use_variant_as_determination`: the determination:datetime column was dropped again because it was not listed in `columns` (affected DK, HR)
- Declare the beautifulsoup4 dependency that the ES-PV and ES-VC converters import
- EE: name the cached WFS responses (ee_gsaa_<year>.gml)
- ES-MD: the archive no longer nests RECINTO.shp in a folder
- SK: KODKD is the (non-unique, sometimes empty) LPIS block code, keep it as block_id and use the row index as id
- ES-CM: always read the year-named SIGPAC service (the unnamed one moved on to 2025 with a different id field)
- REST converters: do not keep an error response as a cached page
- ES-CB: determination date from the variant year (was an empty string, which broke the STAC temporal extent)
- ES-CAT: the 2024 download is a shapefile package, not a GeoPackage; 34 crop names new in 2024 added to the mapping
- CZ: find the shapefile in nested archive folders (2026)
- DE-BB: read the shapefile as cp1252 (its .cpg wrongly says UTF-8)
- NL: new PDOK download location (rvo/gewaspercelen/atom), add the 2026 concept edition
- DE-TH: note the INSPIRE download service
- Drop rows without a crop:code (required by the crop extension) with a warning instead of failing the conversion (BE-VLG 2023, ES-CN had one such row each); more than 1% missing is an error
- Europe-LAND converters: use crop_name as crop:code when the file's crop_code column is empty (LT 2024)
- BE-VLG: derive determination:datetime from the variant year instead of a constant date
- `fiboa publish` no longer uploads to S3 or generates README/LICENSE files. It creates GeoParquet, PMTiles and a STAC Collection with relative links, `file:size`/`file:checksum` and a web-map-links v1.3.0 `pmtiles` link. Publishing is done by catalogs such as the [harmonized field data catalog](https://github.com/fieldsoftheworld/harmonized-field-data-catalog).
- IE: the feature id is the id, because localId is the LPIS parcel reference and repeats where a parcel is declared twice (214 of the 1,027,438 rows of 2022); it is published as `parcel_id`, and the parcels get a `metrics:area` computed from their geometry, which the GML does not carry
- The nine converters that publish field blocks say so in their title: at_block, de_bb_block, de_mv, de_nds_block, de_nrw, de_sh, de_th, lu and nl_block read "Field blocks for ...", where five of them read "Field boundaries" like the crop-field collections

- Declare the beautifulsoup4 dependency the ES-PV and ES-VC converters import
- ES-CL: the ITACyL server is https-only, the 2025 shapefiles sit in province subfolders, and C_REFREC is the identifier
- A test refuses a fixture above 5 MB, committed or merely lying in the fixture folder, because a failing convert test downloads the real source there
- ES-MD: find RECINTO.shp wherever the archive puts it
- REST converters: a variant may name its own service (es_ib keeps its yearly editions in a second one), every request is retried, pages included, and a joined layer's table prefixes are stripped for every converter
- REST converters: page by id windows instead of server-side sorting, key cached pages by service as well as layer, discover the qualified key field on joined layers, and never keep an error response or a broken download as a cached page
- ES-IB: editions 2022-2026 (the yearly layers moved to the GOIB_SIGPAC_HISTORIC_IB service), the provider is the Balearic government, not Navarra's, and the joined field names are handled by the REST mixin
- Update vecorel-cli to v0.2.17:
- GeoJSON is read as UTF-8 as the format mandates, instead of the platform locale (cp1252 on Windows mangled umlauts)
- GeoJSON files with a byte order mark no longer fail to read
- Drop the per-converter UTF-8 workarounds in de_bw and de_he, now redundant
- Converter for Spain (whole), based on the FEGA 2025+ data
- Add Italy Tuscany (IT-1) basd on EuroCrops v2
- Suuport multiple years for CZ
- Multiple years for DE_sh
- Multiple year support for HR
- Introduce FiboaBaseConverter.use_variant_as_determination for setting proper determination_date
- Update years for DK (2025, 2026)
- Converter for Spain (whole), based on the FEGA 2025+ data
- Update fr-converter to support 2021/2022 files
- Converter for Bavaria, Germany LPIS field blocks (de_by_block)
- Converter for Hesse, Germany LPIS reference parcels
- PerFileBaseConverter: per-file migration and merging the result, decreasing memory requirements for large data sets
- Update vecorel-cli to v0.2.16:
- Converter output is sorted by Hilbert distance
- Commands exit with a non-zero exit code when they report a failure
Expand All @@ -32,7 +73,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fix the column additions of the determination fields in the AI4SF converter
- Add HCAT to datasets where possible
- Updated years & variants for at_crop, be_vlg, es_an, es_cl, es_pv, ie, pt, se
- Extend create_stac, include include fiboa data
- Extend create_stac, include fiboa data
- Publish command; skip hidden files, generate better texts
- Fix to vecorel: converter.license and provider should be string
- Added a Dockerfile to simplify working with fiboa
Expand Down
47 changes: 22 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fiboa CLI supports various commands to work with the files:
- [Improve a fiboa Parquet file](#improve-a-fiboa-parquet-file)
- [Update an extension template with new names](#update-an-extension-template-with-new-names)
- [Converter for existing datasets](#converter-for-existing-datasets)
- [Publish datasets to source coop or your own s3 repository](#publish-datasets-to-source-coop-or-your-own-s3-repository)
- [Publish datasets](#publish-datasets)
- [Development](#development)
- [Implement a converter](#implement-a-converter)
- [Run in Docker](#run-in-docker)
Expand Down Expand Up @@ -193,46 +193,43 @@ Use any of the IDs from the list to convert an existing dataset to fiboa:

See [Implement a converter](#implement-a-converter) for details about how to

### Publish datasets to source coop or your own s3 repository
### Publish datasets

`fiboa publish <dataset> -o <target>`

The publish converts and publishes a fiboa dataset to source coop or your own s3 repository. The target directory
will be filled with the following files:
Converts and validates a fiboa dataset and prepares everything that is needed to publish it
in a (STAC-based) catalog. The target directory will be filled with the following files:

```
<target>/
<dataset>.parquet
<dataset>.pmtiles # requires working ogr2ogr and tippecanoe
stac/collection.json
README.md # generated if --generate-meta/-gm flag is present
LICENSE.txt # generated if --generate-meta/-gm flag is present
<dataset>[-<variant>].parquet
<dataset>[-<variant>].pmtiles # requires working ogr2ogr and tippecanoe
collection.json # STAC Collection with relative links to the files above
```

This directory is synchronized to the s3 repository (default source.coop/fiboa/data).
The STAC Collection carries `file:size` and `file:checksum` for the files and a
`pmtiles` link (web-map-links extension). Existing files in the target directory are reused,
delete them to regenerate. Uploading to a bucket and catalog-specific metadata
(README, styles, thumbnails, ...) are the job of the catalog that publishes the data, e.g. the
[harmonized field data catalog](https://github.com/fieldsoftheworld/harmonized-field-data-catalog).

**Requirements**: Requires the [aws CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) to be installed,
and `AWS_ACCESS_KEY_ID` with `AWS_SECRET_ACCESS_KEY` environment variables. Also, for generating the pmtiles file,
it requires [ogr2ogr](https://gdal.org/programs/ogr2ogr.html) and [tippecanoe](https://github.com/mapbox/tippecanoe).
The command runs:

The command executes the following steps:

- `fiboa convert` to generate a fiboa parquet dataset. All convert parameters are passed to the converter.
- `fiboa validate` to validate the fiboa dataset
- creates a <dataset>.pmtiles from the parquet file. Uses ogr2ogr and tippecanoe
- `fiboa create-stac-collection` to create a STAC collection
- `fiboa publish` to publish the fiboa dataset to a source coop or your own s3 repository
- `fiboa convert` to create a `<dataset>[-<variant>].parquet` file
- `fiboa validate` to validate the GeoParquet file
- `ogr2ogr | tippecanoe` to create the PMTiles file
- `fiboa create-stac-collection` to create the STAC Collection

Examples:

- `fiboa publish at_crop -o data/at_crop`
- `fiboa publish -c /tmp/cache -gm br_conab -o data/br_conab`
- `fiboa publish at -o data/at`
- `fiboa publish -c /tmp/cache nl --variant 2025 -o data/nl/2025`

Relevant parameters:

- `--generate-meta/-gm` Generatse the README.md and LICENSE.txt files if absent, based on data-survey and converter properties.
- `--data-url` The URL to the data repository, used when generating the README
- `--s3-upload-path` The `aws s3 sync` target. Defaults to `s3://source.coop/fiboa/data` . Uploading requires the `aws` CLI, and `AWS_ACCESS_KEY_ID` with `AWS_SECRET_ACCESS_KEY` environment variables.
- `--variant` Choose the variant (e.g. year) of a dataset, defaults to the first variant.
- `--no-pmtiles` Skip PMTiles generation.
- `--tippecanoe-opts` Options passed to tippecanoe, defaults to `-zg --drop-densest-as-needed --extend-zooms-if-still-dropping`.

Check `fiboa publish --help` for more details.

Expand Down
Loading