I use a little algorithm to transform values from an openstreetmap-file into a table (.dbf).

I use the function: GetFieldAsString("string") from ogr.py and everything is fine, but when the "string" contains a char like "_" or ":" the error:

ERROR1: Invalid field name: 'string_string'


(The function I use comes from there)

closed as off-topic by PolyGeo Jan 8 '18 at 10:18

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking help to debug/write/improve code must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Providing a clear problem statement and evidence of a code attempt will help others to help you. See: How to create a Minimal, Complete, and Verifiable example." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.


The field name is too long. DBF is a really old format and has a maximum field name length of 10 characters and the only characters allowed are [A-Z][0-9] and underscores "_"

Not the answer you're looking for? Browse other questions tagged or ask your own question.