[QGIS-Developer] Shapefile not correctly shown in some areas

2024-01-12 Thread BastaPrint





Hello, 
To make things short, I have a device which gathers data in the fields 
(hundreds of data per second), and gets the position through a GPS (every 
second). 

Between 2 GPS positions, I triangulate the positions, so the points are 
aligned. 

Sometimes, the device "writes" the data so it spends some time doing so, and it 
does not gather anything, so I have a "hole". 



Then, to visualize the data, I create a Shapefile, only with Points. 



In one Shapefile, I had some strange points: points that appear on the map, but 
are not clickable and disappear when I zoom in too much. I attach the files ; 
they can be downloaded here, too: https://www.grosfichiers.com/sjNC3yx7Kvi 


For instance, in the file I join, the position number 1613 and further are 
problematic. If my viewing area includes the point 1612, I see all the points, 
well aligned, but I cannot click points 1613 and further. 

If I zoom in, or if I move the area and the point 1612 is out of the area, I 
see nothing anymore. 

The code to generate the Shapefile has a systematic approach: it takes the 
points one after the other, and writes their position by incrementing the 
values. So I suspect there is no bug. 
In a previous test, the same problem occured BEFORE point 1217 : I could only 
see the first points if the area included point 1217. 


Questions: 
- can anyone try to see my shapefile and confirm the problem? 

- does this bug ring a bell to anyone? 
- what may be the problem? 



Thank you very much! 

My versions are detailled below. I just updated to the LTR to try to solve the 
problem, but the bug exists with the 3.22.7-Białowieża and 3.28.14-Firenze 
versions. 




Aurélie 






Version de QGIS 
3.28.14-Firenze 
Révision du code
b09131c512 

Version de Qt   
5.15.3 

Version de Python   
3.9.5 

Version de GDAL/OGR 
3.8.2 

Version de Proj 
9.3.1 

Version de la base de données du registre EPSG  
v10.098 (2023-11-24) 

Version de GEOS 
3.12.1-CAPI-1.18.1 

Version de SQLite   
3.41.1 

Version de PDAL 
2.6.0 

Version du client PostgreSQL
unknown 

Version de SpatiaLite   
5.1.0 

Version de QWT  
6.1.6 

Version de QScintilla2  
2.13.4 

Version de l'OS 
Windows 10 Version 2009 






Extensions Python actives 

QGeoloGIS   
1.9.0 

db_manager  
0.1.20 

grassprovider   
2.12.99 

MetaSearch  
0.3.6 

processing  
2.12.99 

sagaprovider
2.12.99 




=== Previously = 




Version de QGIS 
3.22.7-Białowieża   
Révision du code
5a65627a 

Version de Qt   
5.15.3 

Version de Python   
3.9.5 

Version de GDAL/OGR 
3.4.3 

Version de Proj 
9.0.0 

Version de la base de données du registre EPSG  
v10.054 (2022-02-13) 

Version de GEOS 
3.10.2-CAPI-1.16.0 

Version de SQLite   
3.38.1 

Version de PDAL 
2.3.0 

Version du client PostgreSQL
13.0 

Version de SpatiaLite   
5.0.1 

Version de QWT  
6.1.6 

Version de QScintilla2  
2.13.1 

Version de l'OS 
Windows 10 Version 2009 































20240110-153600.prj
Description: Binary data


20240110-153600.cpg
Description: Binary data


20240110-153600.shp
Description: Binary data


20240110-153600.shx
Description: Binary data
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [QGIS-Developer] Shapefile not correctly shown in some areas

2024-01-13 Thread BastaPrint

Thanks a lot Andrea, you found the reason! 
The extent was wrong, and if I calculate & write it correctly, the file works. 
(Basically, I calculated it on the GPS points themselves, and not on the 
interpolated points, and it makes a difference because I interpolate points 
"before any GPS info" or "after the last GPS point"). 





To answer to other suggestions: 
- indeed, writing the file again from QGIS saves the new file in the right 
format 
- the .dbf file was not fautly. I had the same symptoms with or without it, so 
I did not mention it / send it. 

- I write the shapefiles "by hand", using the ESRI norm, playing around with 
the Little Endian and Big Endian formats (why did they make it so complex?). 



Thanks again ! 
Aurélie 


- Mail original -

De: "Andrea Giudiceandrea via QGIS-Developer"  
À: qgis-developer@lists.osgeo.org 
Envoyé: Samedi 13 Janvier 2024 11:47:33 
Objet: Re: [QGIS-Developer] Shapefile not correctly shown in some areas 

Hi all, 


> Colin Sare-Soar colin.saresoar at terrashape.co.uk 
> Fri Jan 12 19:21:21 PST 2024 
> I cannot see the point numbers or any info. The table is blank. 

This is due to the fact the the .dbf sidecar file which stores the 
fields names and values has not been provided or has not been created at 
all. 


> Il 12/01/2024 17:11, Aurélie Tisson (BastaPrint) via QGIS-Developer 
ha scritto: 
> If my viewing area includes the point 1612, I see all 
> the points, well aligned, but I cannot click points 1613 and further. 
> If I zoom in, or if I move the area and the point 1612 is out of the 
> area, I see nothing anymore. 

It looks like this issue is due to the fact that the extent stored in 
the .shp and in the .shx files is incorrect. 

As you can see in the Layer Properties / Information dialog window, the 
extent stored for such layer is: 

645765.5000,6860847. : 
645766.3750,6860852. 


The points with Feature ID from 0 to 34 and from 1613 to 2000 are 
outside such extent. 

As suggested by Richard, just exporting the layer in a new ESRI 
Shapefile layer will write the right extent in the .shp and .shx files 
and the issue will not occur using the new layer. 

While I guess there is an issue in the code used to create the ESRI 
Shapefile layer, which not correctly updates the extent of the created 
layer, I also see some issue in QGIS itself and or in the GDAL/OGR library: 

- QGIS should be less strict and also display the features outside the 
stored extent and or warn the user about the incorrect extent 
- the "Updade extent" functionality in the Layer Properties / Source 
dialog window seems not working, at least for ESRI Shapefile layers 
- the "Repair Shapefile" processing algorithm (based on GDAL/OGR 
functionality) doesn't repair the incorrect extent stored in the .shx file. 

Best regards. 

Andrea 
___ 
QGIS-Developer mailing list 
QGIS-Developer@lists.osgeo.org 
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer 
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer 
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer