-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reorder topologies command #3296
Conversation
de80d9b
to
aa27b77
Compare
Codecov ReportBase: 98.13% // Head: 98.14% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #3296 +/- ##
=======================================
Coverage 98.13% 98.14%
=======================================
Files 273 274 +1
Lines 19890 19968 +78
=======================================
+ Hits 19520 19598 +78
Misses 370 370
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
Related to #2515 |
1 ⠞ ⠳ 2 | ||
⠞ ⠳ | ||
""" | ||
self.path_1 = PathFactory.create(geom=LineString(Point(700000, 6600000), Point(700100, 6600100), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only for your information, since python3.6, you can add '_'
in numeric litterals to make them more readable (the '_'
characters are ignored when parsing the numeric litterals).
For instance : LineString(Point(700_000, 6_600_000), Point(700_100, 6_600_100))
""" | ||
Part A | ||
|
||
⠳ 🡥 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No big deal because it has something to do with my setup : the up arrow character is not displayed neither on Github or PyCharm for me. What did you use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
geotrek/core/tests/test_commands.py
Outdated
|
||
def get_geometries(self): | ||
geometries = [] | ||
for pathagg in PathAggregation.objects.all(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency I would filter the queryset with the topology's ID in the same way you do in the tests.
geotrek/core/tests/test_commands.py
Outdated
call_command('reorder_topologies', stdout=output) | ||
self.assertEqual(f'Topologies with errors :\nTREK id: {topo.pk}\n', output.getvalue()) | ||
geometries = self.get_geometries() | ||
self.assertEqual(geometries, [LineString((700045, 6600045), (700050, 6600050), srid=2154), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have added assertions that test bad values ;) IMHO I would stop the test after asserting the error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job 👍
813e773
to
b1cf7d2
Compare
@@ -5,10 +5,14 @@ CHANGELOG | |||
2.89.1+dev (XXXX-XX-XX) | |||
----------------------- | |||
|
|||
**New features** | |||
|
|||
- Add new command to reorder pathaggregations of topologies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you specify the name of the command, as I am not sure to find its name...
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am adding documentation then is it necessary ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK thanks
da6e01f
to
2be6209
Compare
[--version] [-v {0,1,2,3}] [--settings SETTINGS] [--pythonpath PYTHONPATH] [--traceback] [--no-color] [--force-color] [--skip-checks] | ||
point_layer | ||
|
||
Load a layer with point geometries in te structure model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Load a layer with point geometries in te structure model | |
Load a layer with point geometries in the structure model |
[-v {0,1,2,3}] [--settings SETTINGS] [--pythonpath PYTHONPATH] [--traceback] [--no-color] [--force-color] [--skip-checks] | ||
point_layer | ||
|
||
Load a layer with point geometries in te structure model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Load a layer with point geometries in te structure model | |
Load a layer with point geometries in the signage model |
docs/install/import.rst
Outdated
Remove duplicate paths | ||
---------------------- | ||
|
||
It can happens during additions of paths with commands or directly in the application to have duplicate paths. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can happens during additions of paths with commands or directly in the application to have duplicate paths. | |
Duplicate paths can appear while adding paths with commands or directly in the application. |
docs/install/import.rst
Outdated
---------------------- | ||
|
||
It can happens during additions of paths with commands or directly in the application to have duplicate paths. | ||
Duplicate paths can cause some problems of routing for topologies, it can generates topologies representing multilinestring. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate paths can cause some problems of routing for topologies, it can generates topologies representing multilinestring. | |
Duplicate paths can cause some problems of routing for topologies, it can generate corrupted topologies (that become MultiLineStrings instead of LineStrings). |
docs/install/import.rst
Outdated
|
||
You have to run ``sudo geotrek remove_duplicate_paths`` | ||
|
||
During the process of the command every topologies on a duplicate path will be set on the original path and the duplicate path deleted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During the process of the command every topologies on a duplicate path will be set on the original path and the duplicate path deleted. | |
During the process of the command, every topology on a duplicate path will be set on the original path, and the duplicate path will be deleted. |
docs/install/import.rst
Outdated
Reorder topologies | ||
------------------ | ||
|
||
Every topologies have informations of which path they pass on and in which order. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every topologies have informations of which path they pass on and in which order. | |
All topologies have information about which path they go through on and in which order. |
docs/install/import.rst
Outdated
------------------ | ||
|
||
Every topologies have informations of which path they pass on and in which order. | ||
Actually, when an path is split in 2 by an other path, database add a new path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, when an path is split in 2 by an other path, database add a new path. | |
Actually, when a path is split in 2 by another path, a new path is added to the database. |
docs/install/import.rst
Outdated
|
||
Every topologies have informations of which path they pass on and in which order. | ||
Actually, when an path is split in 2 by an other path, database add a new path. | ||
We need to add informations for every topologies which need to pass on this new path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to add informations for every topologies which need to pass on this new path. | |
We need to add information for all topologies that need to go through this new path. |
docs/install/import.rst
Outdated
This is badly managed at the moment, especially for the order of passage of the paths. | ||
``sudo geotrek reorder_topologies`` | ||
|
||
It removes a lot of useless information which can accelerate the process of edition of topologies afterward. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It removes a lot of useless information which can accelerate the process of edition of topologies afterward. | |
It removes a lot of useless information which can accelerate the process of editing topologies afterward. |
docs/install/import.rst
Outdated
It removes a lot of useless information which can accelerate the process of edition of topologies afterward. | ||
|
||
|
||
During the process of this command, it tries to find a good order of passage on the paths which create |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During the process of this command, it tries to find a good order of passage on the paths which create | |
During the process of this command, it tries to find a good order of passage on the paths which creates |
docs/install/import.rst
Outdated
|
||
|
||
During the process of this command, it tries to find a good order of passage on the paths which create | ||
only one Linestring from the start to the end. It uses the wrong orders as much as possible. This command use the same algorithm to generate one Linestring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only one Linestring from the start to the end. It uses the wrong orders as much as possible. This command use the same algorithm to generate one Linestring | |
only one Linestring from start to end. It stays as close as possible to the corrupted order. This command uses the same algorithm to generate one Linestring |
docs/install/import.rst
Outdated
|
||
.. danger:: | ||
It can happens that this algorithm can't find any solution and will genereate a MultiLineString. | ||
This will be display at the end of the reorder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be display at the end of the reorder | |
This will be displayed at the end of the reorder |
docs/install/import.rst
Outdated
----------------------- | ||
|
||
|
||
You can set up automatic commands by creating a file ``/etc/cron.d/geotrek_command`` that contains: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can set up automatic commands by creating a file ``/etc/cron.d/geotrek_command`` that contains: | |
You can set up automatic commands by creating a `cron` file under ``/etc/cron.d/geotrek_command`` that contains: |
docs/install/import.rst
Outdated
--skip-checks Skip system checks. | ||
|
||
.. danger:: | ||
You can't chose for each choice which set of category you want to unset structures. Every categories of each choice will |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't chose for each choice which set of category you want to unset structures. Every categories of each choice will | |
You can't chose for each choice which set of category you want to unset structures, it will happen for all categories |
docs/install/import.rst
Outdated
|
||
|
||
Firstly, it creates (or finds) the category without structure associated. | ||
Secondly, every element with this category get this new category. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Secondly, every element with this category get this new category. | |
Secondly, every element with this old category gets assigned to this new category. |
docs/install/import.rst
Outdated
You can't chose for each choice which set of category you want to unset structures. Every categories of each choice will | ||
|
||
|
||
Firstly, it creates (or finds) the category without structure associated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Firstly, it creates (or finds) the category without structure associated. | |
Firstly, if a categroy is linked to a structure, it creates the same category but with no structure associated. |
docs/install/import.rst
Outdated
Unset structure on categories | ||
----------------------------- | ||
|
||
If you need to remove some similar categories with different structures you may need to remove the structure of all categories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pas très clair
If you need to remove some similar categories with different structures you may need to remove the structure of all categories | |
Use this command if you wish to undo linking categories to structures for some models |
No description provided.