-
Notifications
You must be signed in to change notification settings - Fork 901
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
BUG: wrong foxpro DBF file read #3243
Comments
Can you share the files and details of your environment? At least the output of |
SYSTEM INFOpython : 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] GEOS, GDAL, PROJ INFOGEOS : 3.11.3 PYTHON DEPENDENCIESgeopandas : 0.13.2 |
i think it read only dbf file do not pay attention to FPT on dbf memory columns R05_USER.DBF.zip |
I'm not familiar with GDAL automatically detects that the DBF file is in However, it appears that perhaps that is not the correct encoding for this file? GDAL emits this warning before returning scrambled text: It isn't clear from your example above what values are correct here; in the DBF file the values in |
I tried opening the file in ArcMap and it doesn't open it at all... so It seems the .dbf diverges at least slightly from the typical shapefile .dbf. |
you can open dbf file using FOXPRO vfp9 |
I'm not sure, but I think this .dbf will be too "modern" or "advanced" to be read by a parser intended to read ESRI shapefiles. A theory loosely based on a quick scanning of this page: I guess that the fields that don't show the correct data are "memo" fields with longer text fields. If I understand correctly, the data for the "memo" fields in the .dbf file is only a reference to where the real data can be found in the .fpt file. Because GDAL (and hence fiona and pyogrio) only support the .dbf files as described by the ESRI shapefile format (=(a subset of) dBase 4 and 5 format I think), it doesn't use the "modern"/"advanced" .fpt file, so it cannot show the data in the memo field. Hence it just shows the data in the .dbf, which are just a few random characters as they are meant as pointers/offsets in the .fpt file rather than real data. |
gpd.read_file(self.dbf_path, encoding='cp1257')
return coluns values as
0 ļ?
1 »7
2 _6
3 Ó6
instead of
0 2552552552552552552552552552552552552552552552...
1 0680000482540310080000000000000000000000000000...
2 0842512262552550152482272551950310000000000001...
3 0840042362542550090000040000002240030000000000...
The text was updated successfully, but these errors were encountered: