Skip to content
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

Snapping between an object and a river #30

Open
LePetitTim opened this issue Nov 22, 2021 · 1 comment
Open

Snapping between an object and a river #30

LePetitTim opened this issue Nov 22, 2021 · 1 comment
Labels
💫 Improvements question Further information is requested

Comments

@LePetitTim
Copy link
Contributor

LePetitTim commented Nov 22, 2021

I used the snapping of Geotrek-admin to allow users to snap anything to a stream.

I found out that this snapping effect does not work anymore. Snapping between 2 paths in GeotrekCE/Geotrek-admin, is updated thanks to the triggers. The snapping is only visual. Normally, It was finding which vertices of the new created/edited path snap on the other paths.
Technically, this is a problem in the Javascript

Problem on Geotrek-admin :

Creation of the Path :
Peek 22-11-2021 14-20

The path is not cut :
Peek 22-11-2021 14-19

Here, we can see, if we have 2 long paths, it snaps visually but not in the database and distance of snapping in triggers is not big enough to snap and cut these 2 paths.
The Path 5344 should be cut in half.


I logged the messages of the data which will be treated and sent to the database :

Peek 22-11-2021 14-28
Here it sends the geometry and then the snaplist, it should be :

 [null, <id_tronçon>]

I beginned to work on a fix (#24) on Georiviere because we don't have any triggers that allow to snap in the database afterward.

Peek 22-11-2021 14-41

With this correction, we can snap geometries without triggers.


New problem

In Geotrek-admin and Georiviere-admin we store geometries in the Spatial Reference System Identifier 2154 (Lambert-93), or others identifier depending on the place of the world but it's always coordinates in meters.
Visually when we move objects on the map, the Identifier is 4326. Then, we need to transform geometries stocked in SRID 2154 to geometries in SRID 4326. After the transformation we show this new geometry on the map.
The problem here is when we show this new geometry this is not exactly the same as the one in the old identifier.

Peek 22-11-2021 14-54


After that i fixed the snaplist, we could snap any geometry on streams but with these transformation, visually the geometry is not snapped :

Peek 22-11-2021 13-58

On Qgis, we can see that the point is actually snapped on the geometry in 2154. Unfortunately, visually the stream in 4326 do not touch the object.

Peek 22-11-2021 14-03

In conclusion, should objects snap the stream in the database or only visually ?

@thomasmagninfeysot
Copy link

Salut @LePetitTim !
Merci pour cette analyse bien précise, à mon avis il faut que le snap soit opérationnel dans la base et en visualisation pour une cohérence et une compréhension par l'utilisateur et une bonne gestion à long terme de la base par les administrateurs !
Et pour la visualisation il faut effectivement qu'elle soit la plus juste possible et éviter les décalages lié au SRID qui j'imagine apporteront des problèmes de snap !

@babastienne babastienne added question Further information is requested 💫 Improvements labels Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💫 Improvements question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants