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
"Points Along Geometry" not creating points if geometry is multipart #34022
Comments
@earthcli can you attach sample data? |
@gioman Thanks for your quick response, the sample data is located here: the input is the 'flood_lines.shp' |
the lines where the point are not created are multi-part geometries, if you first use "multipart to singleparts" the result is the expected one, but apparently is still a regression anyway. |
I see, many thanks. |
@agiudiceandrea I use qgis:pointsalonglines in the plugin python console, it does works, |
In QGIS 3.10.1 (on my Windows 7 system) hovering the pointer on the algorithm name "Points along geometry" in the processing toolbox I see "Algorithm ID: 'native:pointsalonglines'". In the python console, executing |
Both QGIS 3.4.5 (which uses the python version of the algorithm) and QGIS 3.10.1 (which uses the c++ version) seem to behave the same way when a multi part geometry feature is processed by "Points along geometry" alg:
This seems more likely related to a change in QgsGeometry::interpolate (c6a91da #7587) on which both the algorithm versions rely on. QGIS/src/core/geometry/qgsgeometry.cpp Line 2027 in c6a91da
This seems related to the algorithm itself (both python and c++ versions) that doesn't take into account the aforementioned change and doesn't test for multi part geometry, so it tries to generate the points along the total length/perimeter of a multi part line/polygon geometry instead of along the length/perimeter of the first part only. QGIS/src/analysis/processing/qgsalgorithmpointsalonggeometry.cpp Lines 188 to 189 in b8f1d25
QGIS/python/plugins/processing/algs/qgis/PointsAlongGeometry.py Lines 124 to 127 in e83d02e
|
I found the result of qgis:pointsalonglines with v3.10 and 3.2.2 are different, exactly the new version gives a wrong result. see the screenshot attatched.
The text was updated successfully, but these errors were encountered: