vecorel-cli 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vecorel_cli-0.1.0/LICENSE +201 -0
- vecorel_cli-0.1.0/PKG-INFO +268 -0
- vecorel_cli-0.1.0/README.md +231 -0
- vecorel_cli-0.1.0/pyproject.toml +178 -0
- vecorel_cli-0.1.0/setup.cfg +4 -0
- vecorel_cli-0.1.0/tests/test_convert.py +76 -0
- vecorel_cli-0.1.0/tests/test_converters.py +75 -0
- vecorel_cli-0.1.0/tests/test_create_geojson.py +62 -0
- vecorel_cli-0.1.0/tests/test_create_geoparquet.py +40 -0
- vecorel_cli-0.1.0/tests/test_create_stac.py +35 -0
- vecorel_cli-0.1.0/tests/test_describe.py +92 -0
- vecorel_cli-0.1.0/tests/test_encoding_auto.py +34 -0
- vecorel_cli-0.1.0/tests/test_encoding_geojson.py +57 -0
- vecorel_cli-0.1.0/tests/test_encoding_geoparquet.py +48 -0
- vecorel_cli-0.1.0/tests/test_improve.py +57 -0
- vecorel_cli-0.1.0/tests/test_jsonschema.py +137 -0
- vecorel_cli-0.1.0/tests/test_merge.py +56 -0
- vecorel_cli-0.1.0/tests/test_ops.py +57 -0
- vecorel_cli-0.1.0/tests/test_rename_extension.py +65 -0
- vecorel_cli-0.1.0/tests/test_validate.py +75 -0
- vecorel_cli-0.1.0/tests/test_validate_schema.py +22 -0
- vecorel_cli-0.1.0/vecorel_cli/__init__.py +22 -0
- vecorel_cli-0.1.0/vecorel_cli/basecommand.py +83 -0
- vecorel_cli-0.1.0/vecorel_cli/cli/__init__.py +0 -0
- vecorel_cli-0.1.0/vecorel_cli/cli/logger.py +137 -0
- vecorel_cli-0.1.0/vecorel_cli/cli/options.py +105 -0
- vecorel_cli-0.1.0/vecorel_cli/cli/path_url.py +74 -0
- vecorel_cli-0.1.0/vecorel_cli/cli/util.py +70 -0
- vecorel_cli-0.1.0/vecorel_cli/const.py +6 -0
- vecorel_cli-0.1.0/vecorel_cli/conversion/__init__.py +0 -0
- vecorel_cli-0.1.0/vecorel_cli/conversion/admin.py +31 -0
- vecorel_cli-0.1.0/vecorel_cli/conversion/base.py +437 -0
- vecorel_cli-0.1.0/vecorel_cli/convert.py +109 -0
- vecorel_cli-0.1.0/vecorel_cli/converters.py +147 -0
- vecorel_cli-0.1.0/vecorel_cli/create_geojson.py +89 -0
- vecorel_cli-0.1.0/vecorel_cli/create_geoparquet.py +75 -0
- vecorel_cli-0.1.0/vecorel_cli/create_jsonschema.py +138 -0
- vecorel_cli-0.1.0/vecorel_cli/create_stac.py +224 -0
- vecorel_cli-0.1.0/vecorel_cli/datasets/__init__.py +0 -0
- vecorel_cli-0.1.0/vecorel_cli/datasets/template.py +117 -0
- vecorel_cli-0.1.0/vecorel_cli/describe.py +159 -0
- vecorel_cli-0.1.0/vecorel_cli/encoding/__init__.py +0 -0
- vecorel_cli-0.1.0/vecorel_cli/encoding/auto.py +26 -0
- vecorel_cli-0.1.0/vecorel_cli/encoding/base.py +152 -0
- vecorel_cli-0.1.0/vecorel_cli/encoding/geojson.py +341 -0
- vecorel_cli-0.1.0/vecorel_cli/encoding/geoparquet.py +305 -0
- vecorel_cli-0.1.0/vecorel_cli/improve.py +195 -0
- vecorel_cli-0.1.0/vecorel_cli/jsonschema/__init__.py +0 -0
- vecorel_cli-0.1.0/vecorel_cli/jsonschema/template.py +153 -0
- vecorel_cli-0.1.0/vecorel_cli/merge.py +86 -0
- vecorel_cli-0.1.0/vecorel_cli/parquet/__init__.py +0 -0
- vecorel_cli-0.1.0/vecorel_cli/parquet/geopandas.py +119 -0
- vecorel_cli-0.1.0/vecorel_cli/parquet/types.py +261 -0
- vecorel_cli-0.1.0/vecorel_cli/registry.py +98 -0
- vecorel_cli-0.1.0/vecorel_cli/rename_extension.py +210 -0
- vecorel_cli-0.1.0/vecorel_cli/validate.py +105 -0
- vecorel_cli-0.1.0/vecorel_cli/validate_schema.py +132 -0
- vecorel_cli-0.1.0/vecorel_cli/validation/__init__.py +0 -0
- vecorel_cli-0.1.0/vecorel_cli/validation/base.py +88 -0
- vecorel_cli-0.1.0/vecorel_cli/validation/data.py +176 -0
- vecorel_cli-0.1.0/vecorel_cli/validation/geojson.py +99 -0
- vecorel_cli-0.1.0/vecorel_cli/validation/geoparquet.py +167 -0
- vecorel_cli-0.1.0/vecorel_cli/vecorel/__init__.py +0 -0
- vecorel_cli-0.1.0/vecorel_cli/vecorel/collection.py +80 -0
- vecorel_cli-0.1.0/vecorel_cli/vecorel/ops.py +66 -0
- vecorel_cli-0.1.0/vecorel_cli/vecorel/schemas.py +246 -0
- vecorel_cli-0.1.0/vecorel_cli/vecorel/typing.py +14 -0
- vecorel_cli-0.1.0/vecorel_cli/vecorel/util.py +110 -0
- vecorel_cli-0.1.0/vecorel_cli/vecorel/version.py +31 -0
- vecorel_cli-0.1.0/vecorel_cli.egg-info/PKG-INFO +268 -0
- vecorel_cli-0.1.0/vecorel_cli.egg-info/SOURCES.txt +73 -0
- vecorel_cli-0.1.0/vecorel_cli.egg-info/dependency_links.txt +1 -0
- vecorel_cli-0.1.0/vecorel_cli.egg-info/entry_points.txt +2 -0
- vecorel_cli-0.1.0/vecorel_cli.egg-info/requires.txt +17 -0
- vecorel_cli-0.1.0/vecorel_cli.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vecorel-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: CLI tools such as validation and file format conversion for vecorel.
|
|
5
|
+
Author: Matthias Mohr
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/vecorel/cli
|
|
8
|
+
Project-URL: Bug Reports, https://github.com/vecorel/cli/issues
|
|
9
|
+
Project-URL: Source, https://github.com/vecorel/cli
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: pyyaml<7.0,>=6.0
|
|
20
|
+
Requires-Dist: click<9.0,>=8.1
|
|
21
|
+
Requires-Dist: geopandas<2.0,>=1.0.0
|
|
22
|
+
Requires-Dist: requests<3.0,>=2.30
|
|
23
|
+
Requires-Dist: shapely<3.0,>=2.1
|
|
24
|
+
Requires-Dist: numpy<2.2,>=2.0
|
|
25
|
+
Requires-Dist: pyarrow<22.0,>=21.0
|
|
26
|
+
Requires-Dist: py7zr<2.0,>=1.0
|
|
27
|
+
Requires-Dist: fsspec==2025.7.0
|
|
28
|
+
Requires-Dist: jsonschema[format]<5.0,>=4.20
|
|
29
|
+
Requires-Dist: aiohttp<4.0,>=3.9
|
|
30
|
+
Requires-Dist: yarl<2.0,>=1.20
|
|
31
|
+
Requires-Dist: rarfile<5.0,>=4.0
|
|
32
|
+
Requires-Dist: semantic-version<3.0,>=2.10.0
|
|
33
|
+
Requires-Dist: json-stream<3.0,>=2.3.0
|
|
34
|
+
Requires-Dist: flatdict<5.0,>=4.0
|
|
35
|
+
Requires-Dist: loguru==0.7.3
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
|
|
38
|
+
# Vecorel CLI
|
|
39
|
+
|
|
40
|
+
A command-line interface (CLI) for working with Vecorel files.
|
|
41
|
+
|
|
42
|
+
- [Getting Started](#getting-started)
|
|
43
|
+
- [Documentation / Commands](#commands)
|
|
44
|
+
- [Development](#development)
|
|
45
|
+
|
|
46
|
+
## Getting Started
|
|
47
|
+
|
|
48
|
+
In order to make working with Vecorel easier we have developed command-line interface (CLI) tools such as
|
|
49
|
+
inspection, validation and file format conversions.
|
|
50
|
+
|
|
51
|
+
### Installation
|
|
52
|
+
|
|
53
|
+
#### Using Pixi (Recommended)
|
|
54
|
+
|
|
55
|
+
This project uses [Pixi](https://pixi.sh/) for dependency management. Install Pixi first, then:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Clone the repository and navigate to it
|
|
59
|
+
git clone https://github.com/vecorel/cli.git
|
|
60
|
+
cd cli
|
|
61
|
+
|
|
62
|
+
# Install all dependencies
|
|
63
|
+
pixi install
|
|
64
|
+
|
|
65
|
+
# Run the CLI
|
|
66
|
+
pixi run vec
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
> **Note**: This project recently migrated to Pixi. If you were using the old pip-based workflow, see [MIGRATION.md](MIGRATION.md) for details.
|
|
70
|
+
|
|
71
|
+
#### Using pip
|
|
72
|
+
|
|
73
|
+
Alternatively, you can install from PyPI with **Python 3.10** or any later version:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pip install vecorel-cli
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Execute a command
|
|
80
|
+
|
|
81
|
+
After the installation you should be able to run the following command: `vec` (or `pixi run vec` if using Pixi)
|
|
82
|
+
|
|
83
|
+
You should see usage instructions and [available commands](#commands) for the CLI.
|
|
84
|
+
|
|
85
|
+
Vecorel CLI supports various commands to work with the files:
|
|
86
|
+
|
|
87
|
+
- [Vecorel CLI](#vecorel-cli)
|
|
88
|
+
- [Getting Started](#getting-started)
|
|
89
|
+
- [Installation](#installation)
|
|
90
|
+
- [Using Pixi (Recommended)](#using-pixi-recommended)
|
|
91
|
+
- [Using pip](#using-pip)
|
|
92
|
+
- [Execute a command](#execute-a-command)
|
|
93
|
+
- [Commands](#commands)
|
|
94
|
+
- [Validation](#validation)
|
|
95
|
+
- [Create Vecorel GeoParquet from GeoJSON](#create-vecorel-geoparquet-from-geojson)
|
|
96
|
+
- [Create Vecorel GeoJSON from GeoParquet](#create-vecorel-geojson-from-geoparquet)
|
|
97
|
+
- [Inspect Vecorel GeoParquet file](#inspect-vecorel-geoparquet-file)
|
|
98
|
+
- [Merge Vecorel GeoParquet files](#merge-vecorel-geoparquet-files)
|
|
99
|
+
- [Create JSON Schema from Vecorel Schema](#create-json-schema-from-vecorel-schema)
|
|
100
|
+
- [Validate a Vecorel Schema](#validate-a-vecorel-schema)
|
|
101
|
+
- [Improve a Vecorel Parquet file](#improve-a-vecorel-parquet-file)
|
|
102
|
+
- [Update an extension template with new names](#update-an-extension-template-with-new-names)
|
|
103
|
+
- [Converter for existing datasets](#converter-for-existing-datasets)
|
|
104
|
+
- [Development](#development)
|
|
105
|
+
- [Implement a converter](#implement-a-converter)
|
|
106
|
+
|
|
107
|
+
## Commands
|
|
108
|
+
|
|
109
|
+
### Validation
|
|
110
|
+
|
|
111
|
+
To validate a Vecorel GeoParquet or GeoJSON file, you can for example run:
|
|
112
|
+
|
|
113
|
+
- GeoJSON: `vec validate example.json --collection collection.json`
|
|
114
|
+
- GeoParquet: `vec validate example.parquet --data`
|
|
115
|
+
|
|
116
|
+
Check `vec validate --help` for more details.
|
|
117
|
+
|
|
118
|
+
The validator also supports remote files.
|
|
119
|
+
|
|
120
|
+
- `http://` or `https://`: no further configuration is needed.
|
|
121
|
+
- `s3://`: With Pixi, run `pixi install -e s3` or with pip, run `pip install vecorel-cli[s3]` and you may need to set environment variables.
|
|
122
|
+
Refer to the [s3fs credentials documentation](https://s3fs.readthedocs.io/en/latest/#credentials) for how to define credentials.
|
|
123
|
+
- `gs://`: With Pixi, run `pixi install -e gcs` or with pip, run `pip install vecorel-cli[gcs]`.
|
|
124
|
+
By default, `gcsfs` will attempt to use your default gcloud credentials or, attempt to get credentials from the google metadata service, or fall back to anonymous access.
|
|
125
|
+
|
|
126
|
+
### Create Vecorel GeoParquet from GeoJSON
|
|
127
|
+
|
|
128
|
+
To create a Vecorel-compliant GeoParquet for a Vecorel-compliant set of GeoJSON files containing Features or FeatureCollections,
|
|
129
|
+
you can for example run:
|
|
130
|
+
|
|
131
|
+
- `vec create-geoparquet geojson/example.json -o example.parquet -c geojson/collection.json`
|
|
132
|
+
|
|
133
|
+
Check `vec create-geoparquet --help` for more details.
|
|
134
|
+
|
|
135
|
+
### Create Vecorel GeoJSON from GeoParquet
|
|
136
|
+
|
|
137
|
+
To create one or multiple Vecorel-compliant GeoJSON file(s) for a Vecorel-compliant GeoParquet file,
|
|
138
|
+
you can for example run:
|
|
139
|
+
|
|
140
|
+
- GeoJSON FeatureCollection:
|
|
141
|
+
`vec create-geojson example.parquet -o dest-folder`
|
|
142
|
+
- GeoJSON Features (with indentation and max. 100 features):
|
|
143
|
+
`vec create-geojson example.parquet -o dest-folder -n 100 -i 2 -f`
|
|
144
|
+
|
|
145
|
+
`vec create-geojson example.parquet -o dest-folder -n 100 -i 2 -f`
|
|
146
|
+
|
|
147
|
+
Check `vec create-geojson --help` for more details.
|
|
148
|
+
|
|
149
|
+
### Inspect Vecorel GeoParquet file
|
|
150
|
+
|
|
151
|
+
To look into a Vecorel GeoParquet file to get a rough understanding of the content, the following can be executed:
|
|
152
|
+
|
|
153
|
+
- `vec describe example.parquet`
|
|
154
|
+
|
|
155
|
+
Check `vec describe --help` for more details.
|
|
156
|
+
|
|
157
|
+
### Merge Vecorel GeoParquet files
|
|
158
|
+
|
|
159
|
+
Merges multiple Vecorel datasets to a combined Vecorel dataset:
|
|
160
|
+
|
|
161
|
+
- `vec merge ec_ee.parquet ec_lv.parquet -o merged.parquet -e https://vecorel.github.io/hcat-extension/v0.1.0/schema.yaml -i ec:hcat_name -i ec:hcat_code -i ec:translated_name`
|
|
162
|
+
|
|
163
|
+
Check `vec merge --help` for more details.
|
|
164
|
+
|
|
165
|
+
### Create JSON Schema from Vecorel Schema
|
|
166
|
+
|
|
167
|
+
To create a JSON Schema for a Vecorel Schema YAML file, you can for example run:
|
|
168
|
+
|
|
169
|
+
- `vec jsonschema example.json --id=https://vecorel.github.io/specification/v0.1.0/geojson/schema.json -o schema.json`
|
|
170
|
+
|
|
171
|
+
Check `vec jsonschema --help` for more details.
|
|
172
|
+
|
|
173
|
+
### Validate a Vecorel Schema
|
|
174
|
+
|
|
175
|
+
To validate a Vecorel Schema YAML file, you can for example run:
|
|
176
|
+
|
|
177
|
+
- `vec validate-schema schema/schema.yaml`
|
|
178
|
+
|
|
179
|
+
Check `vec validate-schema --help` for more details.
|
|
180
|
+
|
|
181
|
+
### Improve a Vecorel Parquet file
|
|
182
|
+
|
|
183
|
+
Various "improvements" can be applied to a Vecorel GeoParquet file.
|
|
184
|
+
The commands allows to
|
|
185
|
+
|
|
186
|
+
- change the CRS (`--crs`)
|
|
187
|
+
- change the GeoParquet version (`-gp1`) and compression (`-pc`)
|
|
188
|
+
- add/fill missing perimeter/area values (`-sz`)
|
|
189
|
+
- fix invalid geometries (`-g`)
|
|
190
|
+
- rename columns (`-r`)
|
|
191
|
+
|
|
192
|
+
Example:
|
|
193
|
+
|
|
194
|
+
- `vec improve file.parquet -o file2.parquet -g -sz -r old=new -pc zstd`
|
|
195
|
+
|
|
196
|
+
Check `vec improve --help` for more details.
|
|
197
|
+
|
|
198
|
+
### Update an extension template with new names
|
|
199
|
+
|
|
200
|
+
Once you've created and git cloned a new extension, you can use the CLI
|
|
201
|
+
to update all template placeholders with proper names.
|
|
202
|
+
|
|
203
|
+
For example, if your extension is meant to have
|
|
204
|
+
|
|
205
|
+
- the title "Administrative Division Extension",
|
|
206
|
+
- the prefix `admin` (e.g. field `admin:country_code` or `admin:subdivision_code`),
|
|
207
|
+
- is hosted at `https://github.io/vecorel/administrative-division-extension`
|
|
208
|
+
(organization: `vecorel`, repository `/administrative-division-extension`),
|
|
209
|
+
- and you run Vecorel in the folder of the extension.
|
|
210
|
+
|
|
211
|
+
Then the following command could be used:
|
|
212
|
+
|
|
213
|
+
- `vec rename-extension . -t "Administrative Division" -p admin -s administrative-division-extension -o vecorel`
|
|
214
|
+
|
|
215
|
+
Check `vec rename-extension --help` for more details.
|
|
216
|
+
|
|
217
|
+
### Converter for existing datasets
|
|
218
|
+
|
|
219
|
+
The CLI ships various converters for existing datasets.
|
|
220
|
+
|
|
221
|
+
To get a list of available converters/datasets with title, license, etc. run:
|
|
222
|
+
|
|
223
|
+
- `vec converters`
|
|
224
|
+
|
|
225
|
+
Use any of the IDs from the list to convert an existing dataset to Vecorel:
|
|
226
|
+
|
|
227
|
+
- `vec convert de_nrw`
|
|
228
|
+
|
|
229
|
+
See [Implement a converter](#implement-a-converter) for details about how to
|
|
230
|
+
|
|
231
|
+
## Development
|
|
232
|
+
|
|
233
|
+
This project uses [Pixi](https://pixi.sh/) for dependency management and development workflows.
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
# Install all dependencies including development tools
|
|
237
|
+
pixi install -e dev
|
|
238
|
+
|
|
239
|
+
# Install the package in editable mode
|
|
240
|
+
pixi run install-dev
|
|
241
|
+
|
|
242
|
+
# Run tests
|
|
243
|
+
pixi run test
|
|
244
|
+
|
|
245
|
+
# Format and lint code
|
|
246
|
+
pixi run format
|
|
247
|
+
pixi run lint
|
|
248
|
+
|
|
249
|
+
# Run all checks (lint, format, test)
|
|
250
|
+
pixi run check
|
|
251
|
+
|
|
252
|
+
# Install and run pre-commit
|
|
253
|
+
pixi run pre-commit-install
|
|
254
|
+
pixi run pre-commit-run
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Implement a converter
|
|
258
|
+
|
|
259
|
+
The following high-level description gives an idea how to implement a converter in Vecorel CLI:
|
|
260
|
+
|
|
261
|
+
1. Create a new file in `vecorel_cli/datasets` based on the `template.py`
|
|
262
|
+
2. Fill in the required variables / test it / run it
|
|
263
|
+
3. Add missing dependencies into the appropriate feature group in `pixi.toml` (or `setup.py` for pip users)
|
|
264
|
+
4. Add the converter to the list above
|
|
265
|
+
5. Create a PR to submit your converter for review
|
|
266
|
+
|
|
267
|
+
An in-depth guide how to create a cloud-native Vecorel dataset using Vecorel CLI is available at:
|
|
268
|
+
<https://github.com/vecorel/data/blob/main/HOWTO.md>
|