Opened 11 years ago
Closed 11 years ago
#5021 closed enhancement (fixed)
Implement fieldmap option in ogr2ogr
Reported by: | tamas | Owned by: | tamas |
---|---|---|---|
Priority: | normal | Milestone: | 1.10.0 |
Component: | default | Version: | svn-trunk |
Severity: | normal | Keywords: | |
Cc: |
Description
Related to issue #3247 we experienced, that if we use ogr2ogr to append source data to a shapefile destination (by using the -append flag) and field name truncation is taking place, the corresponding values are not copied.
This is because when setting up the field index map (in ogr2ogr) the destination (truncated) field indexes are searched by the name of of the source fields (the long names).
Since it's not always trivial to find the correct fields by names, we implement a field map option, something like:
ogr2ogr -append -f "ESRI Shapefile" -fieldmap "0,1,2,3,4,5" destination.shp [source]
We could also simplify the setting when using indentity field order:
ogr2ogr -append -f "ESRI Shapefile" -fieldmap identity destination.shp [source]
Attachments (1)
Change History (6)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
For us who are not C-programmers it would be much more easy to avoid errors if "3" in the fieldmap list would mean the 3rd field, not the 4th. But I suppose that you, the developers, belong to those who have a big party at age of 49 because we all really were zero year old when we had the first birthdate.
comment:3 by , 11 years ago
Added a new patch with a modified description. Hope that is better. The documentation and the test script will also be updated.
comment:5 by , 11 years ago
Milestone: | → 1.10.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
A few remarks :