geovisio 2.7.0__py3-none-any.whl → 2.8.0__py3-none-any.whl

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 (64) hide show
  1. geovisio/__init__.py +11 -3
  2. geovisio/admin_cli/__init__.py +3 -1
  3. geovisio/admin_cli/cleanup.py +2 -2
  4. geovisio/admin_cli/user.py +75 -0
  5. geovisio/config_app.py +87 -4
  6. geovisio/templates/main.html +2 -2
  7. geovisio/templates/viewer.html +3 -3
  8. geovisio/translations/da/LC_MESSAGES/messages.mo +0 -0
  9. geovisio/translations/da/LC_MESSAGES/messages.po +850 -0
  10. geovisio/translations/de/LC_MESSAGES/messages.mo +0 -0
  11. geovisio/translations/de/LC_MESSAGES/messages.po +235 -2
  12. geovisio/translations/el/LC_MESSAGES/messages.mo +0 -0
  13. geovisio/translations/el/LC_MESSAGES/messages.po +685 -0
  14. geovisio/translations/en/LC_MESSAGES/messages.mo +0 -0
  15. geovisio/translations/en/LC_MESSAGES/messages.po +244 -153
  16. geovisio/translations/eo/LC_MESSAGES/messages.mo +0 -0
  17. geovisio/translations/eo/LC_MESSAGES/messages.po +790 -0
  18. geovisio/translations/es/LC_MESSAGES/messages.mo +0 -0
  19. geovisio/translations/fi/LC_MESSAGES/messages.mo +0 -0
  20. geovisio/translations/fr/LC_MESSAGES/messages.mo +0 -0
  21. geovisio/translations/fr/LC_MESSAGES/messages.po +40 -3
  22. geovisio/translations/hu/LC_MESSAGES/messages.mo +0 -0
  23. geovisio/translations/hu/LC_MESSAGES/messages.po +773 -0
  24. geovisio/translations/it/LC_MESSAGES/messages.mo +0 -0
  25. geovisio/translations/it/LC_MESSAGES/messages.po +875 -0
  26. geovisio/translations/ja/LC_MESSAGES/messages.mo +0 -0
  27. geovisio/translations/ja/LC_MESSAGES/messages.po +719 -0
  28. geovisio/translations/ko/LC_MESSAGES/messages.mo +0 -0
  29. geovisio/translations/messages.pot +225 -148
  30. geovisio/translations/nl/LC_MESSAGES/messages.mo +0 -0
  31. geovisio/translations/nl/LC_MESSAGES/messages.po +24 -16
  32. geovisio/translations/pl/LC_MESSAGES/messages.mo +0 -0
  33. geovisio/translations/pl/LC_MESSAGES/messages.po +727 -0
  34. geovisio/translations/zh_Hant/LC_MESSAGES/messages.mo +0 -0
  35. geovisio/translations/zh_Hant/LC_MESSAGES/messages.po +719 -0
  36. geovisio/utils/auth.py +80 -8
  37. geovisio/utils/link.py +3 -2
  38. geovisio/utils/model_query.py +55 -0
  39. geovisio/utils/pictures.py +29 -62
  40. geovisio/utils/semantics.py +120 -0
  41. geovisio/utils/sequences.py +30 -23
  42. geovisio/utils/tokens.py +5 -3
  43. geovisio/utils/upload_set.py +87 -64
  44. geovisio/utils/website.py +50 -0
  45. geovisio/web/annotations.py +17 -0
  46. geovisio/web/auth.py +9 -5
  47. geovisio/web/collections.py +235 -63
  48. geovisio/web/configuration.py +17 -1
  49. geovisio/web/docs.py +99 -54
  50. geovisio/web/items.py +233 -100
  51. geovisio/web/map.py +129 -31
  52. geovisio/web/pages.py +240 -0
  53. geovisio/web/params.py +17 -0
  54. geovisio/web/prepare.py +165 -0
  55. geovisio/web/stac.py +17 -4
  56. geovisio/web/tokens.py +14 -4
  57. geovisio/web/upload_set.py +19 -10
  58. geovisio/web/users.py +176 -44
  59. geovisio/workers/runner_pictures.py +75 -50
  60. {geovisio-2.7.0.dist-info → geovisio-2.8.0.dist-info}/METADATA +6 -5
  61. geovisio-2.8.0.dist-info/RECORD +89 -0
  62. {geovisio-2.7.0.dist-info → geovisio-2.8.0.dist-info}/WHEEL +1 -1
  63. geovisio-2.7.0.dist-info/RECORD +0 -66
  64. {geovisio-2.7.0.dist-info → geovisio-2.8.0.dist-info}/LICENSE +0 -0
geovisio/web/docs.py CHANGED
@@ -1,4 +1,4 @@
1
- from geovisio.web import utils, upload_set, reports, excluded_areas
1
+ from geovisio.web import annotations, collections, items, prepare, users, utils, upload_set, reports, excluded_areas, pages
2
2
  from geovisio.utils import upload_set as upload_set_utils, reports as reports_utils, excluded_areas as excluded_areas_utils
3
3
  from importlib import metadata
4
4
  import re
@@ -135,6 +135,9 @@ API_CONFIG = {
135
135
  },
136
136
  },
137
137
  "STACStatsForItems": {"$ref": "https://stac-extensions.github.io/stats/v0.2.0/schema.json#/definitions/stats_for_items"},
138
+ "STACStatsForCollections": {
139
+ "$ref": "https://stac-extensions.github.io/stats/v0.2.0/schema.json#/definitions/stats_for_collections"
140
+ },
138
141
  "STACLinks": {
139
142
  "type": "object",
140
143
  "properties": {
@@ -157,6 +160,15 @@ Note that you may not rely only on these ID that could change through time.
157
160
  "properties": {
158
161
  "version": {"type": "integer", "example": 8},
159
162
  "name": {"type": "string", "example": "GeoVisio Vector Tiles"},
163
+ "metadata": {
164
+ "type": "object",
165
+ "properties": {
166
+ "panoramax:fields": {
167
+ "type": "object",
168
+ "description": "Available properties per layer (layer: [field1, field2...])",
169
+ }
170
+ },
171
+ },
160
172
  "sources": {
161
173
  "type": "object",
162
174
  "properties": {
@@ -225,6 +237,9 @@ Note that you may not rely only on these ID that could change through time.
225
237
  },
226
238
  ]
227
239
  },
240
+ "PreparationParameter": prepare.PreparationParameter.model_json_schema(
241
+ ref_template="#/components/schemas/PreparationParameter/$defs/{model}", mode="serialization"
242
+ ),
228
243
  "GeoVisioPostUploadSet": upload_set.UploadSetCreationParameter.model_json_schema(
229
244
  ref_template="#/components/schemas/GeoVisioPostUploadSet/$defs/{model}", mode="serialization"
230
245
  ),
@@ -257,6 +272,7 @@ Note that you may not rely only on these ID that could change through time.
257
272
  "required": ["href", "rel"],
258
273
  "properties": {
259
274
  "stats:items": {"$ref": "#/components/schemas/STACStatsForItems"},
275
+ "stats:collections": {"$ref": "#/components/schemas/STACStatsForCollections"},
260
276
  "extent": {"$ref": "#/components/schemas/STACExtentTemporal"},
261
277
  "geovisio:status": {"$ref": "#/components/schemas/GeoVisioCollectionStatus"},
262
278
  "geovisio:length_km": {"$ref": "#/components/schemas/GeoVisioLengthKm"},
@@ -277,6 +293,30 @@ Note that you may not rely only on these ID that could change through time.
277
293
  },
278
294
  ]
279
295
  },
296
+ "GeoVisioCSVCollections": {
297
+ "type": "string",
298
+ "descrition": f"""CSV file containing the collections.
299
+
300
+ The CSV headers will be:
301
+ * id: ID of the collection
302
+ * status: Status of the collection
303
+ * name: Name of the collection (its title)
304
+ * created: Creation date of the collection
305
+ * updated: Last update date of the collection
306
+ * capture_date: Computed capture date of the collection (date of its first picture)
307
+ * minimum_capture_time: Capture datetime of the first picture
308
+ * maximum_capture_time: Capture datetime of the last picture
309
+ * min_x: Minimum X coordinate of the bounding box of the collection
310
+ * min_y: Minimum Y coordinate of the bounding box of the collection
311
+ * max_x: Maximum X coordinate of the bounding box of the collection
312
+ * max_y: Maximum Y coordinate of the bounding box of the collection
313
+ * nb_pictures: Number of pictures in the collection
314
+ * length_km: Total length of the collection in kilometers
315
+ * computed_h_pixel_density: Horizontal pixel density of the pictures in the collection, if all pictures have the same one
316
+ * computed_gps_accuracy: GPS accuracy of the pictures in the collection, if all pictures have the same one
317
+
318
+ """,
319
+ },
280
320
  "GeoVisioCollections": {
281
321
  "allOf": [
282
322
  {"$ref": "#/components/schemas/STACCollections"},
@@ -340,12 +380,28 @@ Note that you may not rely only on these ID that could change through time.
340
380
  "geovisio:sorted-by": {"$ref": "#/components/schemas/GeoVisioCollectionSortedBy"},
341
381
  "geovisio:upload-software": {"$ref": "#/components/schemas/GeoVisioCollectionUploadSoftware"},
342
382
  "geovisio:length_km": {"$ref": "#/components/schemas/GeoVisioLengthKm"},
383
+ "quality:horizontal_accuracy": {"type": "number", "title": "Estimated GPS position precision (in meters)"},
384
+ "quality:horizontal_accuracy_type": {
385
+ "type": "string",
386
+ "title": "Estimation process for GPS precision",
387
+ "example": "95% confidence interval",
388
+ },
343
389
  "providers": {
344
390
  "type": "array",
345
391
  "items": {
346
392
  "$ref": "#/components/schemas/GeoVisioProvider",
347
393
  },
348
394
  },
395
+ "summaries": {
396
+ "type": "object",
397
+ "properties": {
398
+ "panoramax:horizontal_pixel_density": {
399
+ "type": "array",
400
+ "title": "Number of pixels on horizon per field of view degree (as a list with a single value for STAC conformance)",
401
+ "items": {"type": "integer", "minimum": 0},
402
+ },
403
+ },
404
+ },
349
405
  },
350
406
  },
351
407
  ]
@@ -375,41 +431,9 @@ Note that you may not rely only on these ID that could change through time.
375
431
  "type": "object",
376
432
  "properties": {"title": {"type": "string", "description": "The sequence title"}},
377
433
  },
378
- "GeoVisioPatchCollection": {
379
- "type": "object",
380
- "properties": {
381
- "visible": {
382
- "type": "string",
383
- "description": "Should the sequence be publicly visible ?",
384
- "enum": ["true", "false", "null"],
385
- "default": "null",
386
- },
387
- "title": {
388
- "type": "string",
389
- "description": "The sequence title (publicly displayed)",
390
- },
391
- "relative_heading": {
392
- "type": "number",
393
- "minimum": -180,
394
- "maximum": 180,
395
- "description": "The relative heading (in degrees), offset based on movement path (0° = looking forward, -90° = looking left, 90° = looking right). Headings are unchanged if this parameter is not set.",
396
- },
397
- "sortby": {
398
- "description": """
399
- Define the pictures sort order based on given property. Sort order is defined based on preceding '+' (asc) or '-' (desc).
400
-
401
- Available properties are:
402
- * `gpsdate`: sort by GPS datetime
403
- * `filedate`: sort by the camera-generated capture date. This is based on EXIF tags `Exif.Image.DateTimeOriginal`, `Exif.Photo.DateTimeOriginal`, `Exif.Image.DateTime` or `Xmp.GPano.SourceImageCreateTime` (in this order).
404
- * `filename`: sort by the original picture file name
405
-
406
- If unset, sort order is unchanged.
407
- """,
408
- "type": "string",
409
- "enum": ["+gpsdate", "-gpsdate", "+filedate", "-filedate", "+filename", "-filename"],
410
- },
411
- },
412
- },
434
+ "GeoVisioPatchCollection": collections.PatchCollectionParameter.model_json_schema(
435
+ ref_template="#/components/schemas/GeoVisioPatchCollection/$defs/{model}", mode="serialization"
436
+ ),
413
437
  "GeoVisioCollectionItems": {
414
438
  "allOf": [
415
439
  {"$ref": "#/components/schemas/STACCollectionItems"},
@@ -440,6 +464,15 @@ If unset, sort order is unchanged.
440
464
  "geovisio:thumbnail": {"type": "string", "format": "uri"},
441
465
  "original_file:size": {"type": "integer", "minimum": 0, "title": "Size of the original file, in bytes"},
442
466
  "original_file:name": {"type": "string", "title": "Original file name"},
467
+ "panoramax:horizontal_pixel_density": {
468
+ "type": "integer",
469
+ "minimum": 0,
470
+ "title": "Number of pixels on horizon per field of view degree",
471
+ },
472
+ "quality:horizontal_accuracy": {
473
+ "type": "number",
474
+ "title": "Estimated GPS position precision (in meters)",
475
+ },
443
476
  },
444
477
  }
445
478
  },
@@ -485,7 +518,7 @@ If unset, sort order is unchanged.
485
518
  },
486
519
  "isBlurred": {
487
520
  "type": "string",
488
- "description": "Is picture blurred",
521
+ "description": "Is picture blurred. If set to 'true', the server will not apply the face blurring algorithm but will publish the image as it is",
489
522
  "enum": ["true", "false", "null"],
490
523
  "default": "false",
491
524
  },
@@ -549,23 +582,9 @@ Note that this parameter is not taken in account for 360° pictures, as by defin
549
582
  },
550
583
  ],
551
584
  },
552
- "GeoVisioPatchItem": {
553
- "type": "object",
554
- "properties": {
555
- "visible": {
556
- "type": "string",
557
- "description": "Should the picture be publicly visible ?",
558
- "enum": ["true", "false", "null"],
559
- "default": "null",
560
- },
561
- "heading": {
562
- "type": "number",
563
- "minimum": 0,
564
- "maximum": 360,
565
- "description": "The picture heading (in degrees). North is 0°, East = 90°, South = 180° and West = 270°.",
566
- },
567
- },
568
- },
585
+ "GeoVisioPatchItem": items.PatchItemParameter.model_json_schema(
586
+ ref_template="#/components/schemas/GeoVisioPatchItem/$defs/{model}", mode="serialization"
587
+ ),
569
588
  "GeoVisioCollectionStatus": {"type": "string", "enum": ["ready", "broken", "preparing", "waiting-for-process"]},
570
589
  "GeoVisioLengthKm": {"type": "number", "description": "Total length of sequence (in kilometers)"},
571
590
  "GeoVisioCollectionSortedBy": {
@@ -625,6 +644,9 @@ Available properties are:
625
644
  },
626
645
  },
627
646
  },
647
+ "GeoVisioUserConfiguration": users.UserConfiguration.model_json_schema(
648
+ ref_template="#/components/schemas/GeoVisioUserConfiguration/$defs/{model}", mode="serialization"
649
+ ),
628
650
  "GeoVisioUser": {
629
651
  "type": "object",
630
652
  "properties": {
@@ -670,6 +692,10 @@ Available properties are:
670
692
  },
671
693
  },
672
694
  },
695
+ "GeoVisioPageName": {"type": "string", "enum": ["end-user-license-agreement", "terms-of-service"]},
696
+ "GeoVisioPageSummary": pages.PageSummary.model_json_schema(
697
+ ref_template="#/components/schemas/GeoVisioPageSummary/$defs/{model}", mode="serialization"
698
+ ),
673
699
  "GeoVisioConfiguration": {
674
700
  "type": "object",
675
701
  "properties": {
@@ -697,6 +723,21 @@ Available properties are:
697
723
  },
698
724
  },
699
725
  },
726
+ "geo_coverage": {
727
+ "type": "object",
728
+ "properties": {
729
+ "label": {
730
+ "type": "string",
731
+ "description": "Instance geographical coverage for pictures uploads, in user language",
732
+ },
733
+ "langs": {
734
+ "type": "object",
735
+ "additionalProperties": "string",
736
+ "description": "Translated descriptions as lang -> value object",
737
+ "default": {"en": "Worldwide\nThe picture can be sent from anywhere in the world."},
738
+ },
739
+ },
740
+ },
700
741
  "logo": {
701
742
  "default": "https://gitlab.com/panoramax/gitlab-profile/-/raw/main/images/logo.svg",
702
743
  "format": "uri",
@@ -706,11 +747,13 @@ Available properties are:
706
747
  "type": "string",
707
748
  },
708
749
  "color": {"default": "#bf360c", "format": "color", "title": "Color", "type": "string"},
750
+ "email": {"default": "panoramax@panoramax.fr", "format": "email", "title": "Contact email", "type": "string"},
709
751
  "auth": {
710
752
  "type": "object",
711
753
  "properties": {
712
754
  "user_profile": {"type": "object", "properties": {"url": {"type": "string"}}},
713
755
  "enabled": {"type": "boolean"},
756
+ "enforce_tos_acceptance": {"type": "boolean"},
714
757
  },
715
758
  "required": ["enabled"],
716
759
  },
@@ -1044,9 +1087,11 @@ def getApiDocs():
1044
1087
  "externalDocs": {"url": "https://docs.panoramax.fr/api/api/api/#upload"},
1045
1088
  },
1046
1089
  {"name": "Editing", "description": "Modifying pictures & sequences"},
1090
+ {"name": "Semantics", "description": "Panoramax semantics"},
1047
1091
  {"name": "Reports", "description": "Report issues with pictures & sequences"},
1048
1092
  {"name": "Excluded Areas", "description": "Areas where pictures cannot be uploaded"},
1049
1093
  {"name": "Users", "description": "Account management"},
1050
1094
  {"name": "Auth", "description": "User authentication"},
1095
+ {"name": "Configuration", "description": "Various settings"},
1051
1096
  ],
1052
1097
  }