Skip to content

Commit 38953e2

Browse files
committed
v0.3.0
1 parent 96e4e1a commit 38953e2

File tree

8 files changed

+57
-26
lines changed

8 files changed

+57
-26
lines changed

CHANGELOG.md

+26-9
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99

1010
### Added
1111

12-
- Command to validate the fiboa schemas (`fiboa validate-schema`)
13-
- Command to create GeoJSON from GeoParquet (`fiboa create-geojson`)
14-
- Converter for Schleswig Holstein, Germany (`de_sh`)
15-
- Converter for Lower Saxony, Germany (`de_nds`)
12+
- ...
1613

1714
### Changed
1815

19-
- Renamed `fiboa create` to `fiboa create-geoparquet`
20-
- The `--collection` parameter is not needed anylonger if the collection can be
21-
read directly from the GeoJSON files
22-
(`fiboa` property or link with relation type `collection`)
16+
- ...
2317

2418
### Deprecated
2519

@@ -31,6 +25,28 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3125

3226
### Fixed
3327

28+
- ...
29+
30+
## [v0.3.0] - 2024-04-10
31+
32+
### Added
33+
34+
- Command to validate the fiboa schemas (`fiboa validate-schema`)
35+
- Command to create GeoJSON from GeoParquet (`fiboa create-geojson`)
36+
- Converter for Austria (`at`)
37+
- Converter for Berlin/Brandenburg, Germany (`de_bb`)
38+
- Converter for Schleswig Holstein, Germany (`de_sh`)
39+
- Converter for Lower Saxony, Germany (`de_nds`)
40+
41+
### Changed
42+
43+
- Renamed `fiboa create` to `fiboa create-geoparquet`
44+
- The `--collection` parameter is not needed anylonger if the collection can be
45+
read directly from the GeoJSON files
46+
(`fiboa` property or link with relation type `collection`)
47+
48+
### Fixed
49+
3450
- Several minor improvements for the conversion process
3551

3652
## [v0.2.1] - 2024-04-02
@@ -100,7 +116,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
100116

101117
- First release
102118

103-
[Unreleased]: <https://github.com/radiantearth/stac-spec/compare/v0.2.1...main>
119+
[Unreleased]: <https://github.com/radiantearth/stac-spec/compare/v0.3.0...main>
120+
[v0.3.0]: <https://github.com/radiantearth/stac-spec/compare/v0.2.1...v0.3.0>
104121
[v0.2.1]: <https://github.com/radiantearth/stac-spec/compare/v0.2.0...v0.2.1>
105122
[v0.2.0]: <https://github.com/radiantearth/stac-spec/compare/v0.1.1...v0.2.0>
106123
[v0.1.1]: <https://github.com/radiantearth/stac-spec/compare/v0.1.0...v0.1.1>

README.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ Run `pip install fiboa-cli` to install the validator.
1010
To install additional dependencies for specific [converters](#converter-for-existing-datasets),
1111
you can for example run: `pip install fiboa-cli[xyz]` with xyz being the converter name.
1212

13+
## fiboa versions
14+
15+
- fiboa CLI >= 0.3.0 works with fiboa version > 0.2.0
16+
- fiboa CLI < 0.3.0 works with fiboa version = 0.1.0
17+
1318
## Validation
1419

1520
To validate a fiboa GeoParquet or GeoJSON file, you can for example run:
@@ -79,7 +84,11 @@ To convert an existing dataset to fiboa using the pre-defined converters:
7984
- `fiboa convert de_nrw`
8085

8186
Available converters:
82-
- `de_nrw` (Germany, NRW from Shapefile)
87+
- `at` (Austria)
88+
- `de_bb` (Berlin/Brandenburh, Germany)
89+
- `de_nds` (Lowe Saxony, Germany)
90+
- `de_nrw` (North Rhine-Westphalia, Germany)
91+
- `de_sh` (Schleswig-Holstein, Germany)
8392

8493
### Implement a converter
8594

fiboa_cli/const.py

+2
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,5 @@
106106
}
107107

108108
SUPPORTED_PROTOCOLS = ["http", "https", "s3", "gs"]
109+
110+
STAC_COLLECTION_SCHEMA = "http://schemas.stacspec.org/v1.0.0/collection-spec/json-schema/collection.json"

fiboa_cli/datasets/at.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
'FART_ID': 'fart_id',
3333
'GEO_DATERF': 'determination_datetime'
3434
}
35-
EXTENSIONS = ["https://fiboa.github.io/inspire-extension/v0.1.0/schema.yaml"]
35+
EXTENSIONS = ["https://fiboa.github.io/inspire-extension/v0.2.0/schema.yaml"]
3636
MISSING_SCHEMAS = {
3737
'ref_art': {
3838
'type': 'string'

fiboa_cli/datasets/de_nrw.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
PROVIDER_URL = "https://www.opengeodata.nrw.de/produkte/umwelt_klima/bodennutzung/landwirtschaft/"
99
# From http://osmtipps.lefty1963.de/2008/10/bundeslnder.html
1010
BBOX = [5.8659988131,50.3226989435,9.4476584861,52.5310351488]
11-
EXTENSIONS = ["https://fiboa.github.io/inspire-extension/v0.1.0/schema.yaml"]
11+
EXTENSIONS = ["https://fiboa.github.io/inspire-extension/v0.2.0/schema.yaml"]
1212
COLUMNS = {
1313
'geometry': 'geometry',
1414
'ID': 'id',

fiboa_cli/validate.py

+13-8
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
import pyarrow.types as pat
33

44
from jsonschema.validators import Draft7Validator
5-
from .const import PA_TYPE_CHECK
5+
from .const import PA_TYPE_CHECK, STAC_COLLECTION_SCHEMA
66
from .jsonschema import create_jsonschema
77
from .util import get_collection, log as log_, load_datatypes, load_file, load_fiboa_schema, load_parquet_data, load_parquet_schema, merge_schemas
88
from .validate_data import validate_column
99

10-
STAC_COLLECTION_SCHEMA = "http://schemas.stacspec.org/v1.0.0/collection-spec/json-schema/collection.json"
11-
1210
def log(text: str, status="info"):
1311
# Indent logs
1412
log_(" - " + str(text), status)
@@ -258,12 +256,19 @@ def validate_parquet(file, config):
258256

259257
# todo: use stac_validator instead of our own validation routine
260258
def validate_colletion_schema(obj):
261-
schema = load_file(STAC_COLLECTION_SCHEMA)
262-
errors = validate_json_schema(obj, schema)
263-
for error in errors:
264-
log(f"Collection: {error.path}: {error.message}", "error")
259+
if "stac_version" in obj:
260+
try:
261+
schema = load_file(STAC_COLLECTION_SCHEMA)
262+
errors = validate_json_schema(obj, schema)
263+
for error in errors:
264+
log(f"Collection: {error.path}: {error.message}", "error")
265+
266+
return len(errors) == 0
267+
except:
268+
log("Failed to validate STAC Collection", "warning")
269+
return False
265270

266-
return len(errors) == 0
271+
return True
267272

268273

269274
def validate_json_schema(obj, schema):

fiboa_cli/validate_schema.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
from jsonschema.validators import Draft202012Validator
22
from .util import log as log_, load_file
33

4-
STAC_COLLECTION_SCHEMA = "http://schemas.stacspec.org/v1.0.0/collection-spec/json-schema/collection.json"
5-
64
def log(text: str, status="info"):
75
# Indent logs
86
log_(" - " + str(text), status)
@@ -15,8 +13,8 @@ def validate_schema(file, config):
1513
return False
1614

1715
metaschema_uri = config.get("metaschema")
18-
if "schema" in schema:
19-
metaschema_uri = schema.get("schema", metaschema_uri)
16+
if "$schema" in schema:
17+
metaschema_uri = schema.get("$schema", metaschema_uri)
2018
if metaschema_uri is None:
2119
log("No metaschema provided", "error")
2220
return False

fiboa_cli/version.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "0.2.1"
2-
fiboa_version = "0.1.0"
1+
__version__ = "0.3.0"
2+
fiboa_version = "0.2.0"

0 commit comments

Comments
 (0)