What is the bug or the crash?
I noticed that using the return_details and sort_by_intersection_size options does not give the expected results.
If the object to evaluate has more parts or is multipart, the output is incorrect, that is, the output returns only the length (or area) of the largest part.
In the image below I highlight the fact that the L-shaped segment is calculated only the length of the longest segment.

In the case of Multipolygon with separate parts, the area of the largest overlap is calculated and not the overall area.

Steps to reproduce the issue
I attach an example project (use the views to correctly display the two cases)I attach an example project (use the views to correctly display the two cases)
progetto_overlap.zip
https://discourse.osgeo.org/t/espressione-di-qgis-overlay-intersects/111118/1
Versions
| Versione di QGIS | 3.41.0-Master |
| Revisione codice QGIS | fda2aa46e9 |
| |
| Librerie |
| Versione Qt | 5.15.13 |
| Versione Python | 3.12.7 |
| Versione GDAL/OGR | 3.11.0dev-b281c45d9a |
| Versione PROJ | 9.5.0 |
| Versione database del Registro EPSG | v11.016 (2024-08-31) |
| Versione GEOS | 3.13.0-CAPI-1.19.0 |
| Versione SQLite | 3.46.1 |
| Versione PDAL | 2.8.1 |
| Versione client PostgreSQL | 16.2 |
| Versione SpatiaLite | 5.1.0 |
| Versione QWT | 6.3.0 |
| Versione QScintilla2 | 2.14.1 |
| Versione SO | Windows 11 Version 2009 |
| Questa copia di QGIS scrive messaggi di debug. |
| |
| Plugins Python attivi |
| DataPlotly | 4.2.0 |
| felt | 3.1.5 |
| gps_replay | 0.0.5 |
| HCMGIS | 24.10.20 |
| mmqgis | 2021.9.10 |
| nominatim_locator_filter | 0.3.2 |
| profile-manager | 0.31 |
| qconsolidate | 1.1.0 |
| qduckdb | 1.0.1 |
| quick_map_services | 0.19.34 |
| relazioniplugin | 1.1 |
| SelectionFilter | 1.0 |
| db_manager | 0.1.20 |
| MetaSearch | 0.3.6 |
| processing | 2.12.99 |
The problem is present on QGIS 3.34.12, QGIS 3.40.0 and the master
Supported QGIS version
New profile
Additional context
No response
What is the bug or the crash?
I noticed that using the
return_detailsandsort_by_intersection_sizeoptions does not give the expected results.If the object to evaluate has more parts or is multipart, the output is incorrect, that is, the output returns only the length (or area) of the largest part.
In the image below I highlight the fact that the L-shaped segment is calculated only the length of the longest segment.

In the case of Multipolygon with separate parts, the area of the largest overlap is calculated and not the overall area.

Steps to reproduce the issue
I attach an example project (use the views to correctly display the two cases)I attach an example project (use the views to correctly display the two cases)
progetto_overlap.zip
https://discourse.osgeo.org/t/espressione-di-qgis-overlay-intersects/111118/1
Versions
The problem is present on QGIS 3.34.12, QGIS 3.40.0 and the master
Supported QGIS version
New profile
Additional context
No response