Skip to content
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

fix: clean imported layer attribute mapping #57

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/crud/crud_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,11 @@ async def import_file(
for field_name in field_names:
if field_name == "id":
continue
attribute_mapping[field_type + "_attr" + str(cnt)] = field_name
# Replace hyphens with an underscore as ogr2ogr also does this while importing the layer
# TODO: Find a more robust way to sync changes made by ogr2ogr to field names and this attribute mapping
attribute_mapping[field_type + "_attr" + str(cnt)] = field_name.replace(
"-", "_"
)
cnt += 1

# Upload file to temporary table using ogr2ogr
Expand Down