ign-borea 0.2.1__tar.gz → 0.2.3__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 (112) hide show
  1. {ign_borea-0.2.1 → ign_borea-0.2.3}/PKG-INFO +11 -5
  2. {ign_borea-0.2.1 → ign_borea-0.2.3}/README.md +22 -10
  3. {ign_borea-0.2.1 → ign_borea-0.2.3}/README_borea_lib.md +6 -1
  4. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/datastruct/dtm.py +2 -2
  5. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/datastruct/shot.py +1 -1
  6. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/datastruct/workdata.py +3 -3
  7. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/format/rpc.py +2 -1
  8. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/geodesy/proj_engine.py +1 -1
  9. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/geodesy/transform_geodesy.py +2 -0
  10. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/reader/orientation/manage_reader.py +2 -2
  11. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/reader/reader_camera.py +3 -2
  12. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/reader/reader_point.py +3 -3
  13. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/stat/statistics.py +2 -2
  14. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/transform_world_image/transform_worksite/space_resection.py +2 -2
  15. ign_borea-0.2.3/borea/utils/check/check_path.py +26 -0
  16. ign_borea-0.2.3/borea/utils/solver/solver.py +18 -0
  17. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/worksite/worksite.py +1 -1
  18. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/writer/writer_con.py +2 -2
  19. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/writer/writer_df_to_txt.py +2 -2
  20. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/writer/writer_opk.py +2 -2
  21. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/writer/writer_rpc.py +3 -3
  22. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea_dependency/requirements-dev.txt +1 -1
  23. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea_dependency/requirements.txt +1 -1
  24. ign_borea-0.2.3/borea_tools/__init__.py +0 -0
  25. {ign_borea-0.2.1 → ign_borea-0.2.3}/ign_borea.egg-info/PKG-INFO +11 -5
  26. {ign_borea-0.2.1 → ign_borea-0.2.3}/ign_borea.egg-info/SOURCES.txt +3 -0
  27. {ign_borea-0.2.1 → ign_borea-0.2.3}/ign_borea.egg-info/requires.txt +2 -2
  28. {ign_borea-0.2.1 → ign_borea-0.2.3}/pyproject.toml +1 -1
  29. {ign_borea-0.2.1 → ign_borea-0.2.3}/LICENSE +0 -0
  30. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/__init__.py +0 -0
  31. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/datastruct/__init__.py +0 -0
  32. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/datastruct/camera.py +0 -0
  33. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/datastruct/gcp.py +0 -0
  34. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/format/__init__.py +0 -0
  35. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/format/conl.py +0 -0
  36. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/geodesy/__init__.py +0 -0
  37. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/geodesy/approx_euclidean_proj.py +0 -0
  38. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/geodesy/euclidean_proj.py +0 -0
  39. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/geodesy/local_euclidean_proj.py +0 -0
  40. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/geodesy/projectionlist/__init__.py +0 -0
  41. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/geodesy/projectionlist/search_proj.py +0 -0
  42. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/__init__.py +0 -0
  43. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_add_data/__init__.py +0 -0
  44. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_add_data/p_add_shot.py +0 -0
  45. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_add_data/p_file_gcp2d.py +0 -0
  46. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_add_data/p_file_gcp3d.py +0 -0
  47. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_add_data/p_gen_param.py +0 -0
  48. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_add_data/p_proj.py +0 -0
  49. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_add_data/p_pt2d.py +0 -0
  50. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_add_data/p_pt3d.py +0 -0
  51. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_add_data/p_unit_shot.py +0 -0
  52. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_add_data/p_write.py +0 -0
  53. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_format/__init__.py +0 -0
  54. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_format/p_read_opk.py +0 -0
  55. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_format/p_write_con.py +0 -0
  56. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_format/p_write_opk.py +0 -0
  57. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_format/p_write_rpc.py +0 -0
  58. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_func/__init__.py +0 -0
  59. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_func/p_control.py +0 -0
  60. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_func/p_image_world.py +0 -0
  61. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_func/p_spaceresection.py +0 -0
  62. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_func/p_tf_proj_pt.py +0 -0
  63. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/process/p_func/p_world_image.py +0 -0
  64. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/reader/__init__.py +0 -0
  65. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/reader/orientation/__init__.py +0 -0
  66. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/reader/orientation/reader_opk.py +0 -0
  67. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/stat/__init__.py +0 -0
  68. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/transform_world_image/__init__.py +0 -0
  69. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/transform_world_image/transform_dtm/__init__.py +0 -0
  70. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/transform_world_image/transform_dtm/world_image_dtm.py +0 -0
  71. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/transform_world_image/transform_shot/__init__.py +0 -0
  72. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/transform_world_image/transform_shot/conversion_coor_shot.py +0 -0
  73. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/transform_world_image/transform_shot/image_world_shot.py +0 -0
  74. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/transform_world_image/transform_shot/world_image_shot.py +0 -0
  75. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/transform_world_image/transform_worksite/__init__.py +0 -0
  76. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/transform_world_image/transform_worksite/image_world_intersection.py +0 -0
  77. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/transform_world_image/transform_worksite/image_world_least_square.py +0 -0
  78. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/transform_world_image/transform_worksite/image_world_work.py +0 -0
  79. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/transform_world_image/transform_worksite/world_image_work.py +0 -0
  80. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/utils/__init__.py +0 -0
  81. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/utils/check/__init__.py +0 -0
  82. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/utils/check/check_args_opk.py +0 -0
  83. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/utils/check/check_args_reader_pt.py +0 -0
  84. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/utils/check/check_array.py +0 -0
  85. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/utils/check/check_header.py +0 -0
  86. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/utils/check/check_order_axe.py +0 -0
  87. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/utils/miscellaneous/__init__.py +0 -0
  88. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/utils/miscellaneous/miscellaneous.py +0 -0
  89. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/utils/miscellaneous/param_bundle.py +0 -0
  90. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/utils/miscellaneous/sparse.py +0 -0
  91. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/utils/singleton/__init__.py +0 -0
  92. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/utils/singleton/singleton.py +0 -0
  93. {ign_borea-0.2.1/borea/utils/xml → ign_borea-0.2.3/borea/utils/solver}/__init__.py +0 -0
  94. {ign_borea-0.2.1/borea/worksite → ign_borea-0.2.3/borea/utils/xml}/__init__.py +0 -0
  95. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/utils/xml/xml.py +0 -0
  96. {ign_borea-0.2.1/borea/writer → ign_borea-0.2.3/borea/worksite}/__init__.py +0 -0
  97. {ign_borea-0.2.1/borea_tools → ign_borea-0.2.3/borea/writer}/__init__.py +0 -0
  98. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea/writer/manage_writer.py +0 -0
  99. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea_tools/opk_control.py +0 -0
  100. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea_tools/opk_to_conl.py +0 -0
  101. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea_tools/opk_to_opk.py +0 -0
  102. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea_tools/opk_to_rpc.py +0 -0
  103. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea_tools/pt_image_to_world.py +0 -0
  104. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea_tools/pt_world_to_image.py +0 -0
  105. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea_tools/ptfile_image_to_world.py +0 -0
  106. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea_tools/ptfile_world_to_image.py +0 -0
  107. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea_tools/spaceresection_opk.py +0 -0
  108. {ign_borea-0.2.1 → ign_borea-0.2.3}/borea_tools/transform_proj_points.py +0 -0
  109. {ign_borea-0.2.1 → ign_borea-0.2.3}/ign_borea.egg-info/dependency_links.txt +0 -0
  110. {ign_borea-0.2.1 → ign_borea-0.2.3}/ign_borea.egg-info/entry_points.txt +0 -0
  111. {ign_borea-0.2.1 → ign_borea-0.2.3}/ign_borea.egg-info/top_level.txt +0 -0
  112. {ign_borea-0.2.1 → ign_borea-0.2.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: ign-borea
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: A package to manipulate orientation files
5
5
  Author-email: Antoine Cornu <antoine.cornu@ign.fr>, Nicolas Laurain <nicolas.laurain@ign.fr>
6
6
  License: MIT License
@@ -36,13 +36,13 @@ Classifier: Operating System :: MacOS
36
36
  Requires-Python: >=3.9
37
37
  Description-Content-Type: text/markdown
38
38
  License-File: LICENSE
39
- Requires-Dist: numpy<=1.26.4
39
+ Requires-Dist: numpy
40
40
  Requires-Dist: dataclasses
41
41
  Requires-Dist: pyproj
42
42
  Requires-Dist: scipy
43
43
  Requires-Dist: pandas
44
44
  Provides-Extra: dev
45
- Requires-Dist: numpy<=1.26.4; extra == "dev"
45
+ Requires-Dist: numpy; extra == "dev"
46
46
  Requires-Dist: pylint; extra == "dev"
47
47
  Requires-Dist: pytest; extra == "dev"
48
48
  Requires-Dist: pytest-shutil; extra == "dev"
@@ -53,6 +53,7 @@ Requires-Dist: dataclasses; extra == "dev"
53
53
  Requires-Dist: pyproj; extra == "dev"
54
54
  Requires-Dist: scipy; extra == "dev"
55
55
  Requires-Dist: pandas; extra == "dev"
56
+ Dynamic: license-file
56
57
 
57
58
  [![IGNF badge](https://img.shields.io/badge/IGNF-8cbd3a)](https://www.ign.fr/) [![PyPI Downloads](https://img.shields.io/pypi/dm/ign-borea.svg?label=PyPI%20downloads)](
58
59
  https://pypi.org/project/ign-borea/)
@@ -83,6 +84,11 @@ pip install GDAL==<GDAL VERSION FROM OGRINFO>
83
84
  ```
84
85
  You can find more information on [mothergeo-py](https://mothergeo-py.readthedocs.io/en/latest/development/how-to/gdal-ubuntu-pkg.html) if you have problems installing GDAL.
85
86
 
87
+ #### Conda/Mamba
88
+
89
+ You create your conda/mamba environment with pip in it, then in the environment you install borea with `pip install ign-borea` and GDAL with `conda install GDAL` or `mamba install GDAL`.
90
+ Note: GDAL version must be >= 3.3.2
91
+
86
92
  #### In the QGIS environment
87
93
 
88
94
  View the doc on [borea github docs/installation/In_QGIS.md](https://github.com/IGNF/Borea/tree/main/docs/installation/In_QGIS.md).
@@ -157,7 +163,7 @@ The DataFrame **pt3d** is a table with 5 column and n line. The id of column mus
157
163
 
158
164
  it can be created with the function `read_file_pt_dataframe(path_file_pt,header_file,"pt3d")`
159
165
  The dictionary **pinit** which give the initialization point X, Y, Z. A point on the worksite with a z at an approximate flying height. The name of the key in the dictionary is `coor_init`.
160
- Example at the end of explanation of function [file](https://github.com/IGNF/Borea/tree/main/docs/functions/Space_resection.md).
166
+ Example at the end of explanation of function [file](https://github.com/IGNF/Borea/tree/main/examples/eg_space_resection.py) l.38.
161
167
 
162
168
  * You can calculate some control point statistics to see how accurate your site is `stat = Stat(work, pathreturn, control_type)` to init the object and run for all stat with `stat.main_stat_and_save()`. Make stat on function image to world and world to image, if there are data. And save result on *pathreturn/Stat_{Name_worksite}.txt*.
163
169
 
@@ -21,18 +21,32 @@ Why Borea? B for Box and orea is a back slang of aero.
21
21
 
22
22
  ## Dependency
23
23
 
24
+ Borea needs:
25
+ - python >= 3.9
26
+ - gdal >= 3.3.2
27
+ - numpy
28
+ - pyproj
29
+ - scipy
30
+ - pandas
31
+ - dataclasses
32
+
24
33
  ### Conda/Mamba
25
- For conda/mamba environment the depencency is [borea_dependency/environment.yml](./borea_dependency/environment.yml).
34
+ For conda/mamba environment is [borea_dependency/environment.yml](./borea_dependency/environment.yml).
26
35
 
27
36
  ### Pip venv
28
- For pip environment (venv) the depencency is [borea_dependency/requirements.txt](./borea_dependency/requirements.txt)
37
+ For pip environment (venv) is [borea_dependency/requirements.txt](./borea_dependency/requirements.txt)
29
38
  and you need to install `libgdal-dev` and `GDAL>=3.3.2`.
30
39
 
31
40
  ## Installation
32
41
 
33
- You need to retrieve the repository with ```git clone``` and install the environment. By ```conda``` or ```mamba``` with ```environment.yml``` or ```pip``` with ```requirements.txt```.
42
+ There are two ways to install Borea with the repository `git clone` or with pip `pip install ign-borea` [doc](./README_borea_lib.md).
43
+
44
+ With **the repository**, you also need to install the environment.
45
+ With **pip** the environment comes with it but does not contain GDAL, which you have to install yourself.
34
46
 
47
+ ### Installation of the environment
35
48
  #### Conda/Mamba
49
+ GDAL is contained and installed in the conda/mamba environment.
36
50
  ```
37
51
  conda env create -f ./borea_dependency/environment.yaml
38
52
  ```
@@ -41,20 +55,18 @@ mamba env create -f ./borea_dependency/environment.yaml
41
55
  ```
42
56
 
43
57
  #### Pip
44
- The package exists on pip with `pip install ign-borea` without GDAL
45
-
58
+ GDAL is not included in the pip environment, so you have to install it yourself.
46
59
  ```
47
60
  pip install -r ./borea_dependency/requirements.txt
48
61
  sudo apt-get install libgdal-dev
49
62
  ```
50
- Please note that the `GDAL` version depends on the `libgdal-dev` version.
63
+ You need the version of `GDAL` and you can get it back with:
51
64
  ```
52
- apt-cache show libgdal-dev
53
- # or if you are ogr
54
- ogrinfo --version
65
+ gdalinfo --version
55
66
  ```
67
+ after
56
68
  ```
57
- pip install GDAL==<GDAL VERSION FROM OGRINFO>
69
+ pip install GDAL==<GDAL VERSION>
58
70
  ```
59
71
  You can find more information on [mothergeo-py](https://mothergeo-py.readthedocs.io/en/latest/development/how-to/gdal-ubuntu-pkg.html) if you have problems installing GDAL.
60
72
 
@@ -27,6 +27,11 @@ pip install GDAL==<GDAL VERSION FROM OGRINFO>
27
27
  ```
28
28
  You can find more information on [mothergeo-py](https://mothergeo-py.readthedocs.io/en/latest/development/how-to/gdal-ubuntu-pkg.html) if you have problems installing GDAL.
29
29
 
30
+ #### Conda/Mamba
31
+
32
+ You create your conda/mamba environment with pip in it, then in the environment you install borea with `pip install ign-borea` and GDAL with `conda install GDAL` or `mamba install GDAL`.
33
+ Note: GDAL version must be >= 3.3.2
34
+
30
35
  #### In the QGIS environment
31
36
 
32
37
  View the doc on [borea github docs/installation/In_QGIS.md](https://github.com/IGNF/Borea/tree/main/docs/installation/In_QGIS.md).
@@ -101,7 +106,7 @@ The DataFrame **pt3d** is a table with 5 column and n line. The id of column mus
101
106
 
102
107
  it can be created with the function `read_file_pt_dataframe(path_file_pt,header_file,"pt3d")`
103
108
  The dictionary **pinit** which give the initialization point X, Y, Z. A point on the worksite with a z at an approximate flying height. The name of the key in the dictionary is `coor_init`.
104
- Example at the end of explanation of function [file](https://github.com/IGNF/Borea/tree/main/docs/functions/Space_resection.md).
109
+ Example at the end of explanation of function [file](https://github.com/IGNF/Borea/tree/main/examples/eg_space_resection.py) l.38.
105
110
 
106
111
  * You can calculate some control point statistics to see how accurate your site is `stat = Stat(work, pathreturn, control_type)` to init the object and run for all stat with `stat.main_stat_and_save()`. Make stat on function image to world and world to image, if there are data. And save result on *pathreturn/Stat_{Name_worksite}.txt*.
107
112
 
@@ -1,11 +1,11 @@
1
1
  """
2
2
  A module for manipulating a digital elevation model.
3
3
  """
4
- from pathlib import Path, PureWindowsPath
5
4
  import numpy as np
6
5
  from osgeo import gdal
7
6
  from scipy import ndimage
8
7
  from borea.transform_world_image.transform_dtm.world_image_dtm import WorldImageDtm
8
+ from borea.utils.check.check_path import check_path
9
9
  from borea.utils.singleton.singleton import Singleton
10
10
  gdal.UseExceptions()
11
11
 
@@ -49,7 +49,7 @@ class Dtm(WorldImageDtm, metaclass=Singleton):
49
49
  if path_dtm:
50
50
  gdal.AllRegister()
51
51
  self.type_dtm = type_dtm
52
- self.path_dtm = Path(PureWindowsPath(path_dtm))
52
+ self.path_dtm = check_path(path_dtm)
53
53
  self.img = gdal.Open(self.path_dtm.as_posix())
54
54
  self.rb = self.img.GetRasterBand(1)
55
55
  self.nodata = self.rb.GetNoDataValue()
@@ -9,7 +9,7 @@ from borea.geodesy.local_euclidean_proj import LocalEuclideanProj
9
9
  from borea.utils.check.check_order_axe import check_order_axe
10
10
 
11
11
 
12
- # pylint: disable=too-many-instance-attributes too-many-arguments too-many-positional-arguments
12
+ # pylint: disable=too-many-instance-attributes, too-many-arguments, too-many-positional-arguments
13
13
  class Shot:
14
14
  """
15
15
  Shot class definition.
@@ -35,7 +35,7 @@ class Workdata:
35
35
  self.approxeucli = False
36
36
  self.epsg_output = False
37
37
 
38
- # pylint: disable-next=too-many-arguments too-many-positional-arguments
38
+ # pylint: disable-next=too-many-arguments, too-many-positional-arguments
39
39
  def add_shot(self, name_shot: str, pos_shot: np.ndarray,
40
40
  ori_shot: np.ndarray, name_cam: str,
41
41
  unit_angle: str, linear_alteration: bool,
@@ -83,7 +83,7 @@ class Workdata:
83
83
 
84
84
  ProjEngine().set_epsg(epsg, path_geoid, epsg_output)
85
85
 
86
- # pylint: disable-next=too-many-arguments too-many-positional-arguments
86
+ # pylint: disable-next=too-many-arguments, too-many-positional-arguments
87
87
  def add_camera(self, name_camera: str, ppax: float, ppay: float,
88
88
  focal: float, width: int, height: int) -> None:
89
89
  """
@@ -150,7 +150,7 @@ class Workdata:
150
150
  try:
151
151
  self.shots[name_shot]
152
152
  except KeyError as e_info:
153
- raise ValueError(f"The shot {name_shot} doesn't exist in list of shots.") from e_info
153
+ raise KeyError(f"The shot {name_shot} doesn't exist in list of shots.") from e_info
154
154
 
155
155
  if name_point not in self.gcp2d:
156
156
  self.gcp2d[name_point] = []
@@ -9,6 +9,7 @@ from borea.datastruct.dtm import Dtm
9
9
  from borea.transform_world_image.transform_shot.image_world_shot import ImageWorldShot
10
10
  from borea.transform_world_image.transform_shot.world_image_shot import WorldImageShot
11
11
  from borea.utils.miscellaneous.miscellaneous import normalize
12
+ from borea.utils.solver.solver import npsolve
12
13
 
13
14
 
14
15
  class Rpc:
@@ -161,7 +162,7 @@ class Rpc:
161
162
  np.array: Rpc coefficients.
162
163
  """
163
164
  mat_obs = self.setup_matrix_obs_rpc(img_norm, world_norm, polynomial_degree)
164
- x = np.linalg.lstsq(mat_obs, img_norm, rcond=None)[0]
165
+ x = npsolve(mat_obs, img_norm)
165
166
 
166
167
  coef_rpc = np.zeros(40)
167
168
  if polynomial_degree == 1:
@@ -9,7 +9,7 @@ from borea.geodesy.transform_geodesy import TransformGeodesy
9
9
  from borea.utils.singleton.singleton import Singleton
10
10
 
11
11
 
12
- # pylint: disable=unpacking-non-sequence
12
+ # pylint: disable=unpacking-non-sequence, unsubscriptable-object
13
13
  @dataclass
14
14
  class ProjEngine(metaclass=Singleton):
15
15
  """
@@ -1,6 +1,7 @@
1
1
  """
2
2
  Module for class ProjEngine, transform geodesy
3
3
  """
4
+ # pylint: disable=unsubscriptable-object
4
5
  import pyproj
5
6
  import numpy as np
6
7
  import pandas as pd
@@ -235,6 +236,7 @@ class TransformGeodesy():
235
236
  df_pt['y'],
236
237
  df_pt['z']]))
237
238
 
239
+ # pylint: disable-next=unpacking-non-sequence
238
240
  df_pt["x"], df_pt["y"] = self.proj_to_proj_out(df_pt['x'], df_pt['y'])
239
241
 
240
242
  return df_pt
@@ -2,7 +2,7 @@
2
2
  Photogrammetry site file reader module.
3
3
  """
4
4
  import importlib
5
- from pathlib import Path, PureWindowsPath
5
+ from borea.utils.check.check_path import check_path
6
6
  from borea.worksite.worksite import Worksite
7
7
 
8
8
 
@@ -19,7 +19,7 @@ def reader_orientation(file: str, args: dict) -> Worksite:
19
19
  """
20
20
  # Attention multiple file management orientation
21
21
  # Attention management of files with the same extension but different formats
22
- file = Path(PureWindowsPath(file))
22
+ file = check_path(file)
23
23
  name_work = file.stem
24
24
  ext = file.suffix[1:]
25
25
 
@@ -1,8 +1,9 @@
1
1
  """
2
2
  Script to read camera file txt or xml.
3
3
  """
4
- from pathlib import Path, PureWindowsPath
4
+ from pathlib import Path
5
5
  from borea.datastruct.camera import Camera
6
+ from borea.utils.check.check_path import check_path
6
7
  from borea.worksite.worksite import Worksite
7
8
 
8
9
 
@@ -15,7 +16,7 @@ def read_camera(files: list, work: Worksite) -> None:
15
16
  work (Worksite): Worksite which needs camera data.
16
17
  """
17
18
  for file in files:
18
- camera_txt(Path(PureWindowsPath(file)), work)
19
+ camera_txt(check_path(file), work)
19
20
 
20
21
 
21
22
  def camera_txt(file: Path, work: Worksite) -> None:
@@ -2,9 +2,9 @@
2
2
  Script to read point (connecting point, gcp2d gcp3d) format
3
3
  .txt/.mes/.app with data arranged in columns.
4
4
  """
5
- from pathlib import Path, PureWindowsPath
6
5
  import pandas as pd
7
6
  import numpy as np
7
+ from borea.utils.check.check_path import check_path
8
8
  from borea.worksite.worksite import Worksite
9
9
  from borea.utils.check.check_args_reader_pt import check_header_file
10
10
 
@@ -26,7 +26,7 @@ def read_file_pt(path: str, header: list, type_point: str, work: Worksite) -> No
26
26
  work.type_z_data = type_z
27
27
 
28
28
  try:
29
- with open(Path(PureWindowsPath(path)), 'r', encoding="utf-8") as file_pts:
29
+ with open(check_path(path), 'r', encoding="utf-8") as file_pts:
30
30
  for pt in file_pts.readlines():
31
31
  if pt != '\n' and pt[0] != '#':
32
32
  info = pt.split()
@@ -74,7 +74,7 @@ def read_file_pt_dataframe(path: str, header: list, type_point: str) -> tuple:
74
74
  ttype = []
75
75
  coor = []
76
76
  try:
77
- with open(Path(PureWindowsPath(path)), 'r', encoding="utf-8") as file_pts:
77
+ with open(check_path(path), 'r', encoding="utf-8") as file_pts:
78
78
  for pt in file_pts.readlines():
79
79
  if pt != '\n' and pt[0] != '#':
80
80
  info = pt.split()
@@ -3,8 +3,8 @@ Module for statistics
3
3
  """
4
4
  import os
5
5
  import io
6
- from pathlib import Path, PureWindowsPath
7
6
  import numpy as np
7
+ from borea.utils.check.check_path import check_path
8
8
  from borea.worksite.worksite import Worksite
9
9
 
10
10
 
@@ -22,7 +22,7 @@ class Stat:
22
22
  type_point (list): List of type point on which we make the stats.
23
23
  """
24
24
  self.work = work
25
- self.pathoutput = Path(PureWindowsPath(pathoutput))
25
+ self.pathoutput = check_path(pathoutput)
26
26
 
27
27
  if type_point is None:
28
28
  self.type_point = []
@@ -13,6 +13,7 @@ from borea.transform_world_image.transform_shot.image_world_shot import ImageWor
13
13
  # pylint: disable-next=line-too-long
14
14
  from borea.transform_world_image.transform_worksite.image_world_intersection import WorldIntersection # noqa: E501
15
15
  from borea.utils.miscellaneous.param_bundle import set_param_bundle_diff
16
+ from borea.utils.solver.solver import npsolve
16
17
 
17
18
 
18
19
  class SpaceResection:
@@ -240,8 +241,7 @@ class SpaceResection:
240
241
 
241
242
  # Creation of A with mat_obs_axia
242
243
  # Calculate dx = (A.T @ A)**-1 @ A.T @ B
243
- return np.squeeze(np.linalg.lstsq(self.mat_obs_axia(pt_eucli, shot_adjust),
244
- v_res, rcond=None)[0])
244
+ return np.squeeze(npsolve(self.mat_obs_axia(pt_eucli, shot_adjust), v_res))
245
245
 
246
246
  def mat_obs_axia(self, pt_eucli: np.ndarray, imc_adjust: Shot) -> np.ndarray:
247
247
  """
@@ -0,0 +1,26 @@
1
+ """
2
+ Script to check path of data.
3
+ """
4
+ from pathlib import Path, PureWindowsPath, PurePosixPath
5
+
6
+
7
+ def check_path(file: str) -> Path:
8
+ """
9
+ Check path of data if Posix of Windows path.
10
+
11
+ Args:
12
+ file (str): The path of data.
13
+
14
+ Returns:
15
+ Path: The good path.
16
+ """
17
+ file = Path(file)
18
+ name = file.stem
19
+
20
+ if "/" in name:
21
+ return Path(PurePosixPath(file))
22
+
23
+ if "\\" in name:
24
+ return Path(PureWindowsPath(file))
25
+
26
+ return file
@@ -0,0 +1,18 @@
1
+ """
2
+ Least square solver used by Borea
3
+ """
4
+ import numpy as np
5
+
6
+
7
+ def npsolve(mat_a: np.ndarray, mat_b: np.ndarray) -> np.ndarray:
8
+ """
9
+ Solver used by Borea to resolve Ax = B
10
+
11
+ Args:
12
+ mat_a (np.ndarray): Matrix A
13
+ mat_b (np.ndarray): Matrix B
14
+
15
+ Returns:
16
+ np.ndarray: the result x
17
+ """
18
+ return np.linalg.lstsq(mat_a, mat_b, rcond=None)[0]
@@ -173,7 +173,7 @@ class Worksite(Workdata):
173
173
  self.type_z_shot, False)[2]
174
174
  shot.set_z_nadir(z_nadir)
175
175
 
176
- # pylint: disable-next=too-many-arguments too-many-positional-arguments
176
+ # pylint: disable-next=too-many-arguments, too-many-positional-arguments
177
177
  def set_unit_output(self, type_z: str = None, unit_angle: str = None,
178
178
  linear_alteration: bool = None, order_axe: str = None,
179
179
  proj_output: bool = True) -> None:
@@ -2,7 +2,7 @@
2
2
  Photogrammetry worksite to writing in rpc.
3
3
  """
4
4
  import os
5
- from pathlib import Path, PureWindowsPath
5
+ from borea.utils.check.check_path import check_path
6
6
  from borea.worksite.worksite import Worksite
7
7
  from borea.geodesy.proj_engine import ProjEngine
8
8
  from borea.format.conl import Conl
@@ -31,6 +31,6 @@ def write(name: str, folder_con: str, param_con: dict, work: Worksite) -> None:
31
31
 
32
32
  for name_shot, shot in work.shots.items():
33
33
  cam = work.cameras[shot.name_cam]
34
- path_conical = os.path.join(Path(PureWindowsPath(folder_con)), f"{name_shot}.CON")
34
+ path_conical = os.path.join(check_path(folder_con), f"{name_shot}.CON")
35
35
 
36
36
  Conl(shot, cam, geoview_proj).save_conl(path_conical)
@@ -2,8 +2,8 @@
2
2
  Photogrammetry worksite to writing dataframe to txt.
3
3
  """
4
4
  import os
5
- from pathlib import Path, PureWindowsPath
6
5
  import pandas as pd
6
+ from borea.utils.check.check_path import check_path
7
7
 
8
8
 
9
9
  def write_df_to_txt(name: str, pathreturn: str, df: pd.DataFrame) -> None:
@@ -15,7 +15,7 @@ def write_df_to_txt(name: str, pathreturn: str, df: pd.DataFrame) -> None:
15
15
  pathreturn (str): Path to save the file.
16
16
  df (pd.DataFrame): DataFrame to save.
17
17
  """
18
- path_txt = os.path.join(Path(PureWindowsPath(pathreturn)), f"{name}.txt")
18
+ path_txt = os.path.join(check_path(pathreturn), f"{name}.txt")
19
19
 
20
20
  name_column = list(df.columns)
21
21
 
@@ -2,8 +2,8 @@
2
2
  Photogrammetry worksite to writing in opk.
3
3
  """
4
4
  import os
5
- from pathlib import Path, PureWindowsPath
6
5
  import numpy as np
6
+ from borea.utils.check.check_path import check_path
7
7
  from borea.worksite.worksite import Worksite
8
8
  from borea.utils.check.check_args_opk import check_header_file
9
9
 
@@ -24,7 +24,7 @@ def write(name_opk: str, path_opk: str, args: dict, work: Worksite) -> None:
24
24
  linear alteration.
25
25
  work (Worksite): The site to be recorded.
26
26
  """
27
- path_opk = os.path.join(Path(PureWindowsPath(path_opk)), f"{name_opk}.opk")
27
+ path_opk = os.path.join(check_path(path_opk), f"{name_opk}.opk")
28
28
 
29
29
  if args["header"]:
30
30
  header, type_z = check_header_file(args["header"])
@@ -2,8 +2,8 @@
2
2
  Photogrammetry worksite to writing in rpc.
3
3
  """
4
4
  import os
5
- from pathlib import Path, PureWindowsPath
6
5
  from borea.format.rpc import Rpc
6
+ from borea.utils.check.check_path import check_path
7
7
  from borea.worksite.worksite import Worksite
8
8
  from borea.datastruct.dtm import Dtm
9
9
 
@@ -53,6 +53,6 @@ def write(name: str, folder_rpc: str, param_rpc: dict, work: Worksite) -> None:
53
53
  for idx, val in enumerate(rpc.param_rpc["SAMP_DEN_COEFF"]):
54
54
  list_txt_rpc += [f"SAMP_DEN_COEFF_{idx + 1}: {val}"]
55
55
 
56
- path_rpc = os.path.join(Path(PureWindowsPath(folder_rpc)),
56
+ path_rpc = os.path.join(check_path(folder_rpc),
57
57
  f"{name_shot}_RPC.TXT")
58
- Path(path_rpc).write_text("\n".join(list_txt_rpc), encoding="UTF-8")
58
+ check_path(path_rpc).write_text("\n".join(list_txt_rpc), encoding="UTF-8")
@@ -1,4 +1,4 @@
1
- numpy <= 1.26.4
1
+ numpy
2
2
  pylint
3
3
  pytest
4
4
  pytest-shutil
@@ -1,4 +1,4 @@
1
- numpy <= 1.26.4
1
+ numpy
2
2
  dataclasses
3
3
  pyproj
4
4
  scipy
File without changes
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: ign-borea
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: A package to manipulate orientation files
5
5
  Author-email: Antoine Cornu <antoine.cornu@ign.fr>, Nicolas Laurain <nicolas.laurain@ign.fr>
6
6
  License: MIT License
@@ -36,13 +36,13 @@ Classifier: Operating System :: MacOS
36
36
  Requires-Python: >=3.9
37
37
  Description-Content-Type: text/markdown
38
38
  License-File: LICENSE
39
- Requires-Dist: numpy<=1.26.4
39
+ Requires-Dist: numpy
40
40
  Requires-Dist: dataclasses
41
41
  Requires-Dist: pyproj
42
42
  Requires-Dist: scipy
43
43
  Requires-Dist: pandas
44
44
  Provides-Extra: dev
45
- Requires-Dist: numpy<=1.26.4; extra == "dev"
45
+ Requires-Dist: numpy; extra == "dev"
46
46
  Requires-Dist: pylint; extra == "dev"
47
47
  Requires-Dist: pytest; extra == "dev"
48
48
  Requires-Dist: pytest-shutil; extra == "dev"
@@ -53,6 +53,7 @@ Requires-Dist: dataclasses; extra == "dev"
53
53
  Requires-Dist: pyproj; extra == "dev"
54
54
  Requires-Dist: scipy; extra == "dev"
55
55
  Requires-Dist: pandas; extra == "dev"
56
+ Dynamic: license-file
56
57
 
57
58
  [![IGNF badge](https://img.shields.io/badge/IGNF-8cbd3a)](https://www.ign.fr/) [![PyPI Downloads](https://img.shields.io/pypi/dm/ign-borea.svg?label=PyPI%20downloads)](
58
59
  https://pypi.org/project/ign-borea/)
@@ -83,6 +84,11 @@ pip install GDAL==<GDAL VERSION FROM OGRINFO>
83
84
  ```
84
85
  You can find more information on [mothergeo-py](https://mothergeo-py.readthedocs.io/en/latest/development/how-to/gdal-ubuntu-pkg.html) if you have problems installing GDAL.
85
86
 
87
+ #### Conda/Mamba
88
+
89
+ You create your conda/mamba environment with pip in it, then in the environment you install borea with `pip install ign-borea` and GDAL with `conda install GDAL` or `mamba install GDAL`.
90
+ Note: GDAL version must be >= 3.3.2
91
+
86
92
  #### In the QGIS environment
87
93
 
88
94
  View the doc on [borea github docs/installation/In_QGIS.md](https://github.com/IGNF/Borea/tree/main/docs/installation/In_QGIS.md).
@@ -157,7 +163,7 @@ The DataFrame **pt3d** is a table with 5 column and n line. The id of column mus
157
163
 
158
164
  it can be created with the function `read_file_pt_dataframe(path_file_pt,header_file,"pt3d")`
159
165
  The dictionary **pinit** which give the initialization point X, Y, Z. A point on the worksite with a z at an approximate flying height. The name of the key in the dictionary is `coor_init`.
160
- Example at the end of explanation of function [file](https://github.com/IGNF/Borea/tree/main/docs/functions/Space_resection.md).
166
+ Example at the end of explanation of function [file](https://github.com/IGNF/Borea/tree/main/examples/eg_space_resection.py) l.38.
161
167
 
162
168
  * You can calculate some control point statistics to see how accurate your site is `stat = Stat(work, pathreturn, control_type)` to init the object and run for all stat with `stat.main_stat_and_save()`. Make stat on function image to world and world to image, if there are data. And save result on *pathreturn/Stat_{Name_worksite}.txt*.
163
169
 
@@ -70,12 +70,15 @@ borea/utils/check/check_args_reader_pt.py
70
70
  borea/utils/check/check_array.py
71
71
  borea/utils/check/check_header.py
72
72
  borea/utils/check/check_order_axe.py
73
+ borea/utils/check/check_path.py
73
74
  borea/utils/miscellaneous/__init__.py
74
75
  borea/utils/miscellaneous/miscellaneous.py
75
76
  borea/utils/miscellaneous/param_bundle.py
76
77
  borea/utils/miscellaneous/sparse.py
77
78
  borea/utils/singleton/__init__.py
78
79
  borea/utils/singleton/singleton.py
80
+ borea/utils/solver/__init__.py
81
+ borea/utils/solver/solver.py
79
82
  borea/utils/xml/__init__.py
80
83
  borea/utils/xml/xml.py
81
84
  borea/worksite/__init__.py
@@ -1,11 +1,11 @@
1
- numpy<=1.26.4
1
+ numpy
2
2
  dataclasses
3
3
  pyproj
4
4
  scipy
5
5
  pandas
6
6
 
7
7
  [dev]
8
- numpy<=1.26.4
8
+ numpy
9
9
  pylint
10
10
  pytest
11
11
  pytest-shutil
@@ -5,7 +5,7 @@ requires = ["setuptools>=61.0"]
5
5
  [project]
6
6
  dynamic = ["dependencies", "optional-dependencies"]
7
7
  name = "ign-borea"
8
- version = "0.2.1"
8
+ version = "0.2.3"
9
9
  authors = [
10
10
  { name="Antoine Cornu", email="antoine.cornu@ign.fr" },
11
11
  { name="Nicolas Laurain", email="nicolas.laurain@ign.fr"}
File without changes
File without changes
File without changes