*Klaus Mithöfer*
/Tue Jun 28 06:54:55 PDT 2022/
------------------------------------------------------------------------
how the grid snapping work?

Hi Klaus,
the QgsMapToPixelSimplifier Class [1] gives a hint about what the "Simplify" algorithm "Snap to grid" method do:

SnapToGrid      

The simplification uses a grid (similar to ST_SnapToGrid) to remove duplicate points.


The code used for the "Snap to grid" method is at [2].

Another algorithm that snaps the vertex to a grid is the "Snap points to grid" [3], but this doesn't actually simplify the geometries, just simplifies the coordinates of the geometries.

Regards.

Andrea Giudiceandrea


[1] https://api.qgis.org/api/3.22/classQgsMapToPixelSimplifier.html#a0b97d82a3abd0876ce529ba9d9cfd412 [2] https://github.com/qgis/QGIS/blob/e113457133fe5d7c3f5e3b90a2795b8b691ae269/src/core/qgsmaptopixelgeometrysimplifier.cpp#L183-L229 [3] https://docs.qgis.org/3.22/en/docs/user_manual/processing_algs/qgis/vectorgeometry.html?highlight=simplify#snap-points-to-grid
_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to