Repository navigation
fix(px,shapefile): values on the DATA= line; .cst and undeclared DBF encodings (#50) - #51
Merged
Merged
Conversation
…encodings (#50) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 8, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #50.
PX: values may start on the
DATA=line, as INE writes them (DATA=70.0 68.0 ...). The first value was"DATA=70.0". The keyword is now dropped from the data text. A closing;followed by a space or a line break no longer stays on the last value.Shapefile: when no
.cpgexists, the DBF encoding is taken from:.cstcode page file (Statistics Finland shipsISO-8859-1in one);guess_dbf_encoding: 0x57/0x03 = cp1252, 0xC9 = cp1251, 0x7B = cp932, …);Such files failed with
dbfFileException: Could not decode field name ... b'Alaj\xe4rvi'.Tests:
test_px_values_on_the_data_line,test_dbf_encoding_without_cpg(4 cases),test_guess_dbf_encoding.ruff check,ruff format --check,radon cc --min D,pydocstyle,vulture: clean.tests/test_shapefile.pykeeps its CRLF line endings.On the metacrafter-testdata files: the Finnish municipalities zip now opens (Alajärvi, Äänekoski), and the INE Madrid PX gives
VALUE70.0 instead of"DATA=70.0".🤖 Generated with Claude Code