Message posté par : Thomas Gratier (thomas.gratier(a)gmail.com)
----------------------------------------
Bonjour,
J'ai testé votre fichier et j'ai le même problème avec Geopandas mais aussi QGIS
or ogrinfo. J'ai tenté de corriger avec GDAL, mais aussi avec un utilitaire qui
s'appelle shapechk.exe
J'ai aussi testé si le fichier shp était assimilé à un shp par les outils en général
(voir le code ci-dessous et les résultats) avec le code Python ci-dessous
-----------------
Code :
import magic # instructions installation
https://github.com/ahupp/python-magic
from pathlib import Path
shp_path = '/home/thomasg/Téléchargements/lieux_dits.shp'
for file in Path(shp_path).parent.glob(Path(shp_path).stem + '.*'):
print(f'{file} is of type {magic.from_file(file)}')
another_shp_path = '/tmp/H1.shp'
for file in Path(another_shp_path).parent.glob(Path(another_shp_path).stem +
'.*'):
print(f'{file} is of type {magic.from_file(file)}')
-----------------
La sortie est la suivante (le premier fichier est un fichier valide sur ma machine, le
deuxième est le vôtre):
-----------------
Code :
/home/thomasg/Téléchargements/lieux_dits.shp is of type ESRI Shapefile version 1000 length
23639890 type Polygon
/home/thomasg/Téléchargements/lieux_dits.qix is of type data
/home/thomasg/Téléchargements/lieux_dits.dbf is of type amd 29k coff prebar executable
/home/thomasg/Téléchargements/lieux_dits.prj is of type ASCII text, with very long lines,
with no line terminators
/home/thomasg/Téléchargements/lieux_dits.shx is of type ESRI Shapefile version 1000 length
107098 type Polygon
/tmp/H1.shx is of type data
/tmp/H1.dbf is of type data
/tmp/H1.shp is of type data
/tmp/H1.prj is of type data
-----------------
On voit que tous vos fichiers sont de type "data" alors qu'ils sont
correctement reconnus pour un fichier shp valide. Cela montre bien que votre fichier shp
et tous les fichiers associés ne sont pas reconnus du tout.
Ma conclusion personnelle, c'est que votre fichier et tous les fichiers associés sont
bien un shp mais corrompu donc inutilisable.
Cordialement
Thomas
----------------------------------------
Le message est situé
https://georezo.net/forum/viewtopic.php?pid=356597#p356597
Pour y répondre : donnees(a)ml.georezo.net ou reply de votre messagerie
Pour vous désabonner connectez-vous sur le forum puis Profil / Abonnement
--
Association GeoRezo - le portail géomatique
https://georezo.net