pygiskit 0.1.0.dev0__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.
Files changed (50) hide show
  1. pygiskit-0.1.0.dev0/LICENSE +21 -0
  2. pygiskit-0.1.0.dev0/PKG-INFO +434 -0
  3. pygiskit-0.1.0.dev0/README.md +398 -0
  4. pygiskit-0.1.0.dev0/giskit/__init__.py +8 -0
  5. pygiskit-0.1.0.dev0/giskit/cli/__init__.py +0 -0
  6. pygiskit-0.1.0.dev0/giskit/cli/main.py +659 -0
  7. pygiskit-0.1.0.dev0/giskit/config/__init__.py +26 -0
  8. pygiskit-0.1.0.dev0/giskit/config/export/colors.yml +67 -0
  9. pygiskit-0.1.0.dev0/giskit/config/export/layer_mappings.yml +171 -0
  10. pygiskit-0.1.0.dev0/giskit/config/loader.py +459 -0
  11. pygiskit-0.1.0.dev0/giskit/config/quirks/formats.yml +18 -0
  12. pygiskit-0.1.0.dev0/giskit/config/quirks/providers.yml +8 -0
  13. pygiskit-0.1.0.dev0/giskit/config/quirks/services.yml +17 -0
  14. pygiskit-0.1.0.dev0/giskit/config/services/pdok-wcs.yml +50 -0
  15. pygiskit-0.1.0.dev0/giskit/config/services/pdok-wmts.yml +78 -0
  16. pygiskit-0.1.0.dev0/giskit/config/services/pdok.yml +540 -0
  17. pygiskit-0.1.0.dev0/giskit/config/services/test-wms.yml +17 -0
  18. pygiskit-0.1.0.dev0/giskit/config/services/testprovider.yml +26 -0
  19. pygiskit-0.1.0.dev0/giskit/core/__init__.py +0 -0
  20. pygiskit-0.1.0.dev0/giskit/core/geocoding.py +160 -0
  21. pygiskit-0.1.0.dev0/giskit/core/recipe.py +275 -0
  22. pygiskit-0.1.0.dev0/giskit/core/spatial.py +303 -0
  23. pygiskit-0.1.0.dev0/giskit/exporters/__init__.py +11 -0
  24. pygiskit-0.1.0.dev0/giskit/exporters/glb_exporter.py +229 -0
  25. pygiskit-0.1.0.dev0/giskit/exporters/ifc/__init__.py +8 -0
  26. pygiskit-0.1.0.dev0/giskit/exporters/ifc/exporter.py +297 -0
  27. pygiskit-0.1.0.dev0/giskit/exporters/ifc/geometry.py +243 -0
  28. pygiskit-0.1.0.dev0/giskit/exporters/ifc/layer_exporter.py +364 -0
  29. pygiskit-0.1.0.dev0/giskit/exporters/ifc/materials.py +192 -0
  30. pygiskit-0.1.0.dev0/giskit/exporters/ifc/schema_adapter.py +125 -0
  31. pygiskit-0.1.0.dev0/giskit/indexer/README.md +207 -0
  32. pygiskit-0.1.0.dev0/giskit/indexer/__init__.py +33 -0
  33. pygiskit-0.1.0.dev0/giskit/indexer/__main__.py +203 -0
  34. pygiskit-0.1.0.dev0/giskit/indexer/monitor.py +388 -0
  35. pygiskit-0.1.0.dev0/giskit/protocols/__init__.py +23 -0
  36. pygiskit-0.1.0.dev0/giskit/protocols/base.py +145 -0
  37. pygiskit-0.1.0.dev0/giskit/protocols/cityjson.py +260 -0
  38. pygiskit-0.1.0.dev0/giskit/protocols/ogc_features.py +301 -0
  39. pygiskit-0.1.0.dev0/giskit/protocols/quirks.py +328 -0
  40. pygiskit-0.1.0.dev0/giskit/protocols/quirks_monitor.py +232 -0
  41. pygiskit-0.1.0.dev0/giskit/protocols/wcs.py +357 -0
  42. pygiskit-0.1.0.dev0/giskit/protocols/wfs.py +167 -0
  43. pygiskit-0.1.0.dev0/giskit/protocols/wmts.py +373 -0
  44. pygiskit-0.1.0.dev0/giskit/providers/__init__.py +0 -0
  45. pygiskit-0.1.0.dev0/giskit/providers/base.py +219 -0
  46. pygiskit-0.1.0.dev0/giskit/providers/ogc_features.py +257 -0
  47. pygiskit-0.1.0.dev0/giskit/providers/pdok.py +719 -0
  48. pygiskit-0.1.0.dev0/giskit/providers/wcs.py +315 -0
  49. pygiskit-0.1.0.dev0/giskit/providers/wmts.py +287 -0
  50. pygiskit-0.1.0.dev0/pyproject.toml +129 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 A190
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,434 @@
1
+ Metadata-Version: 2.1
2
+ Name: pygiskit
3
+ Version: 0.1.0.dev0
4
+ Summary: Recipe-driven spatial data downloader for Dutch geo-data
5
+ Home-page: https://github.com/sanderboer/py-giskit
6
+ License: MIT
7
+ Keywords: gis,spatial,ogc,wfs,wmts,geodata,recipe,openstreetmap,pdok
8
+ Author: A190
9
+ Author-email: info@a190.nl
10
+ Requires-Python: >=3.10,<3.13
11
+ Classifier: Development Status :: 2 - Pre-Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Scientific/Engineering :: GIS
20
+ Provides-Extra: all
21
+ Provides-Extra: ifc
22
+ Requires-Dist: fiona (>=1.9.0,<2.0.0)
23
+ Requires-Dist: geopandas (>=0.14.0,<0.15.0)
24
+ Requires-Dist: httpx (>=0.27.0,<0.28.0)
25
+ Requires-Dist: ifcopenshell (>=0.8.0,<0.9.0) ; extra == "ifc" or extra == "all"
26
+ Requires-Dist: jsonschema (>=4.20.0,<5.0.0)
27
+ Requires-Dist: pydantic (>=2.5.0,<3.0.0)
28
+ Requires-Dist: pyproj (>=3.6.0,<4.0.0)
29
+ Requires-Dist: pyyaml (>=6.0,<7.0)
30
+ Requires-Dist: rich (>=13.7.0,<14.0.0)
31
+ Requires-Dist: shapely (>=2.0.0,<3.0.0)
32
+ Requires-Dist: typer[all] (>=0.9.0,<0.10.0)
33
+ Project-URL: Repository, https://github.com/sanderboer/py-giskit
34
+ Description-Content-Type: text/markdown
35
+
36
+ # GISKit
37
+
38
+ **Recipe-driven spatial data downloader for Netherlands geo-data**
39
+
40
+ [![Python 3.10-3.12](https://img.shields.io/badge/python-3.10--3.12-blue.svg)](https://www.python.org/downloads/)
41
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
42
+ [![Tests](https://img.shields.io/badge/tests-110%20passing-brightgreen.svg)](tests/)
43
+
44
+ ---
45
+
46
+ ## What is GISKit?
47
+
48
+ GISKit is a Python tool for downloading Dutch spatial data using simple JSON "recipes". Define what data you need and where you need it - GISKit handles the downloads and combines everything into a single GeoPackage.
49
+
50
+ **Perfect for:**
51
+ - Creating project underlays for construction/infrastructure projects
52
+ - Downloading base maps for GIS analysis
53
+ - Collecting spatial context data for locations
54
+ - Automating repetitive spatial data downloads
55
+
56
+ ### Key Features
57
+
58
+ - **Recipe-Driven**: Define your data needs in simple JSON
59
+ - **PDOK Integration**: Access to 50+ Dutch government spatial datasets
60
+ - **Smart Downloads**: Automatic bbox calculation from addresses
61
+ - **Single Output**: Everything combined in one GeoPackage
62
+ - **CRS Handling**: Automatic coordinate transformation
63
+ - **Export Options**: GeoPackage, GeoJSON, CityJSON, optional IFC/GLB
64
+
65
+
66
+ ## Quick Start
67
+
68
+ ### Installation
69
+
70
+ **From PyPI (recommended):**
71
+ ```bash
72
+ pip install pygiskit
73
+
74
+ # With IFC export support (Python 3.10-3.12 only)
75
+ pip install pygiskit[ifc]
76
+ ```
77
+
78
+ **From source:**
79
+ ```bash
80
+ git clone https://github.com/sanderboer/py-giskit.git
81
+ cd py-giskit
82
+ pip install -e .
83
+ ```
84
+
85
+ ### Your First Recipe
86
+
87
+ Create `dam_square.json`:
88
+
89
+ ```json
90
+ {
91
+ "name": "Dam Square Buildings",
92
+ "location": {
93
+ "type": "address",
94
+ "value": "Dam 1, Amsterdam",
95
+ "radius": 500
96
+ },
97
+ "datasets": [
98
+ {
99
+ "provider": "pdok",
100
+ "service": "bgt",
101
+ "layers": ["pand", "wegdeel"]
102
+ }
103
+ ],
104
+ "output": {
105
+ "path": "./dam_square.gpkg",
106
+ "crs": "EPSG:28992"
107
+ }
108
+ }
109
+ ```
110
+
111
+ Run it:
112
+
113
+ ```bash
114
+ giskit run dam_square.json
115
+ ```
116
+
117
+ Result: `dam_square.gpkg` with buildings and roads around Dam Square!
118
+
119
+
120
+ ## Recipe Examples
121
+
122
+ All examples are in the `recipes/` directory. Try them out:
123
+
124
+ ```bash
125
+ # Download buildings and infrastructure around Curieweg, Spijkenisse
126
+ giskit run recipes/curieweg_multi_service.json
127
+
128
+ # Amsterdam Dam Square with buildings
129
+ giskit run recipes/amsterdam_dam_square.json
130
+
131
+ # Simple bbox example
132
+ giskit run recipes/bbox_simple.json
133
+ ```
134
+
135
+ ### Urban Planning Dataset
136
+
137
+ Comprehensive data for a project location:
138
+
139
+ ```json
140
+ {
141
+ "name": "Curieweg Project Underlay",
142
+ "location": {
143
+ "type": "address",
144
+ "value": "Curieweg 7a, Spijkenisse",
145
+ "radius": 1000
146
+ },
147
+ "datasets": [
148
+ {"provider": "pdok", "service": "bgt", "layers": ["pand", "wegdeel", "waterdeel"]},
149
+ {"provider": "pdok", "service": "bag", "layers": ["pand", "verblijfsobject"]},
150
+ {"provider": "pdok", "service": "cbs-wijken-buurten-2024", "layers": ["buurten"]},
151
+ {"provider": "pdok", "service": "bestuurlijkegebieden", "layers": ["gemeenten"]}
152
+ ],
153
+ "output": {
154
+ "path": "./curieweg.gpkg",
155
+ "crs": "EPSG:28992"
156
+ }
157
+ }
158
+ ```
159
+
160
+ ### Location Types
161
+
162
+ **Address with buffer:**
163
+ ```json
164
+ {
165
+ "location": {
166
+ "type": "address",
167
+ "value": "Curieweg 7a, Spijkenisse",
168
+ "radius": 1000
169
+ }
170
+ }
171
+ ```
172
+
173
+ **Point coordinates:**
174
+ ```json
175
+ {
176
+ "location": {
177
+ "type": "point",
178
+ "value": [4.89, 52.37],
179
+ "crs": "EPSG:4326",
180
+ "radius": 500
181
+ }
182
+ }
183
+ ```
184
+
185
+ **Bounding box:**
186
+ ```json
187
+ {
188
+ "location": {
189
+ "type": "bbox",
190
+ "value": [120700, 487000, 120950, 487250],
191
+ "crs": "EPSG:28992"
192
+ }
193
+ }
194
+ ```
195
+
196
+
197
+ ## Available Data Sources
198
+
199
+ ### PDOK (Platform Digitale Overheid - Netherlands)
200
+
201
+ GISKit provides access to **50+ Dutch government datasets** via PDOK's OGC API Features:
202
+
203
+ **Base Registries (Basisregistraties):**
204
+ - **BGT** - Large Scale Topography (54 layers: buildings, roads, water, terrain, etc.)
205
+ - **BAG** - Buildings and Addresses (buildings, addresses, residence objects)
206
+ - **BAG3D** - 3D Building Models (LoD 1.2, 1.3, 2.2 in CityJSON format)
207
+ - **BRK** - Cadastral Parcels
208
+
209
+ **Infrastructure:**
210
+ - **NWB Roads** - National Road Database (road segments, junctions)
211
+ - **NWB Waterways** - Waterway network
212
+
213
+ **Statistics & Administration:**
214
+ - **CBS Neighborhoods 2024** - Statistical areas (neighborhoods, districts, municipalities)
215
+ - **Administrative Boundaries** - Municipalities, provinces, water boards
216
+
217
+ **Environment:**
218
+ - **Protected Areas** - Nature reserves, Natura 2000
219
+ - **Soil Data** - Soil types, contamination
220
+
221
+ See [docs/PDOK_SERVICES.md](docs/PDOK_SERVICES.md) for complete catalog with all layers.
222
+
223
+ ### Planned Providers
224
+
225
+ - **OpenStreetMap** - Global POI, buildings, roads via Overpass API
226
+ - **AHN Elevation** - Dutch elevation data via WCS
227
+ - **Aerial Imagery** - Luchtfoto via WMTS
228
+
229
+
230
+ ## CLI Commands
231
+
232
+ **Run recipes:**
233
+ ```bash
234
+ # Execute a recipe
235
+ giskit run recipe.json
236
+
237
+ # Validate recipe syntax
238
+ giskit recipe validate recipe.json
239
+ ```
240
+
241
+ **Explore providers:**
242
+ ```bash
243
+ # List available providers and services
244
+ giskit providers list
245
+
246
+ # Show PDOK service details
247
+ giskit providers info pdok
248
+
249
+ # Search for specific data
250
+ giskit search "buildings"
251
+ ```
252
+
253
+ **Monitor API quirks:**
254
+ ```bash
255
+ # Show known API quirks for providers
256
+ giskit quirks list
257
+
258
+ # Show details for specific provider
259
+ giskit quirks show pdok ogc-features
260
+
261
+ # Monitor which quirks are being applied
262
+ giskit quirks monitor
263
+ ```
264
+
265
+ ## Export Formats
266
+
267
+ **Built-in formats:**
268
+ - GeoPackage (`.gpkg`) - default, recommended
269
+ - GeoJSON (`.geojson`)
270
+ - Shapefile (`.shp`)
271
+ - CityJSON (`.json`) - for 3D data
272
+
273
+ **Optional IFC/GLB export:**
274
+
275
+ Requires `pip install giskit[ifc]` (Python 3.10-3.12 only)
276
+
277
+ ```bash
278
+ # Export GeoPackage to IFC
279
+ giskit export ifc data.gpkg output.ifc
280
+
281
+ # Convert IFC to GLB (for web viewers)
282
+ giskit export glb data.ifc output.glb
283
+ ```
284
+
285
+ See [notes/EXPORT_GUIDE.md](notes/EXPORT_GUIDE.md) for details.
286
+
287
+
288
+ ## How It Works
289
+
290
+ 1. **Define** - Write a JSON recipe with location and datasets
291
+ 2. **Geocode** - GISKit converts addresses to coordinates
292
+ 3. **Download** - Fetches data from PDOK OGC API Features
293
+ 4. **Transform** - Converts to target CRS if needed
294
+ 5. **Combine** - Merges all layers into single GeoPackage
295
+
296
+ ```
297
+ ┌──────────────┐
298
+ │ JSON Recipe │
299
+ └──────┬───────┘
300
+
301
+
302
+ ┌──────────────┐ ┌─────────────┐
303
+ │ Geocoding │─────▶│ PDOK Lookup │
304
+ └──────┬───────┘ └─────────────┘
305
+
306
+
307
+ ┌──────────────┐
308
+ │ Download │──────┬────────────────┐
309
+ └──────┬───────┘ │ │
310
+ │ ┌────▼────┐ ┌────▼────┐
311
+ │ │ BGT │ │ BAG │
312
+ │ │ (54 lyr)│ │ (3 lyr) │
313
+ │ └────┬────┘ └────┬────┘
314
+ ▼ │ │
315
+ ┌──────────────┐ │ │
316
+ │ Transform │◀─────┴────────────────┘
317
+ └──────┬───────┘
318
+
319
+
320
+ ┌──────────────┐
321
+ │ GeoPackage │
322
+ │ (.gpkg) │
323
+ └──────────────┘
324
+ ```
325
+
326
+ ## Project Structure
327
+
328
+ ```
329
+ giskit/
330
+ ├── cli/ # Command-line interface
331
+ ├── core/ # Recipe parsing, geocoding, spatial ops
332
+ ├── protocols/ # OGC Features, WMTS, WCS protocols
333
+ ├── providers/ # PDOK, OSM provider implementations
334
+ ├── exporters/ # IFC/GLB export (optional)
335
+ └── config/ # YAML configurations for services
336
+
337
+ recipes/ # Example recipes ready to use
338
+ tests/ # 110+ unit and integration tests
339
+ ```
340
+
341
+
342
+ ## Development
343
+
344
+ ### Running Tests
345
+
346
+ ```bash
347
+ # All tests (110 passing)
348
+ pytest
349
+
350
+ # With coverage report
351
+ pytest --cov=giskit --cov-report=html
352
+
353
+ # Specific test suites
354
+ pytest tests/unit/
355
+ pytest tests/integration/
356
+ ```
357
+
358
+ ### Code Quality
359
+
360
+ ```bash
361
+ # Lint code
362
+ ruff check .
363
+
364
+ # Format code
365
+ ruff format .
366
+ ```
367
+
368
+ ## Documentation
369
+
370
+ - **[docs/PDOK_SERVICES.md](docs/PDOK_SERVICES.md)** - Complete PDOK service catalog
371
+ - **[notes/EXPORT_GUIDE.md](notes/EXPORT_GUIDE.md)** - IFC/GLB export instructions
372
+ - **[notes/QUIRKS_SYSTEM.md](notes/QUIRKS_SYSTEM.md)** - API compatibility handling
373
+ - **[notes/BAG3D_ARCHITECTURE.md](notes/BAG3D_ARCHITECTURE.md)** - 3D data handling
374
+ - **[CHANGELOG.md](CHANGELOG.md)** - Version history
375
+
376
+ ### For Contributors
377
+
378
+ - **[docs/publishing/](docs/publishing/)** - PyPI publication guides
379
+ - **[notes/](notes/)** - Technical implementation notes
380
+
381
+ ## Use Cases
382
+
383
+ **Urban Planning:**
384
+ - Project site context data (buildings, infrastructure, parcels)
385
+ - Statistical area boundaries for reports
386
+ - Base maps for presentations
387
+
388
+ **Construction:**
389
+ - Site underlay generation
390
+ - Existing infrastructure mapping
391
+ - Environmental constraints (protected areas, water)
392
+
393
+ **GIS Analysis:**
394
+ - Batch download base data for multiple locations
395
+ - Standardized data collection workflows
396
+ - Automated updates of project data
397
+
398
+ **Research:**
399
+ - Reproducible spatial data downloads
400
+ - Consistent data collection methodology
401
+ - Share data requirements via recipes
402
+
403
+
404
+ ## Contributing
405
+
406
+ Contributions welcome! This project is in active development.
407
+
408
+ 1. Check [PLAN.md](PLAN.md) for current priorities
409
+ 2. Create an issue for discussion
410
+ 3. Submit a pull request
411
+
412
+ ## Credits
413
+
414
+ **Built with:**
415
+ - [GeoPandas](https://geopandas.org/) - Spatial data handling
416
+ - [Shapely](https://shapely.readthedocs.io/) - Geometry operations
417
+ - [httpx](https://www.python-httpx.org/) - Async HTTP client
418
+ - [Typer](https://typer.tiangolo.com/) - CLI framework
419
+ - [Pydantic](https://docs.pydantic.dev/) - Data validation
420
+
421
+ **Data sources:**
422
+ - [PDOK](https://www.pdok.nl/) - Dutch government spatial data platform
423
+ - [Nominatim](https://nominatim.org/) - OpenStreetMap geocoding
424
+
425
+ ## License
426
+
427
+ MIT License - See [LICENSE](LICENSE)
428
+
429
+ ---
430
+
431
+ **Made by A190**
432
+
433
+ *Simple recipes for Dutch spatial data*
434
+