Opened 13 years ago

Closed 13 years ago

#4255 closed defect (fixed)

PostNAS - ogr2ogr does not handle array field correctly

Reported by: astrid_emde Owned by: warmerdam
Priority: normal Milestone: 1.9.0
Component: default Version: svn-trunk
Severity: normal Keywords:
Cc: marina.thust@…

Description (last modified by astrid_emde)

select distinct artderflurstuecksgrenze from AX_BesondereFlurstuecksgrenze;

Attachments (3)

NBA_RIO_20110802T000000_0von0_0_0_funktioniert.xml (6.3 KB ) - added by astrid_emde 13 years ago.
NBA_RIO_20110802T000000_0von0_0_0_fehlerhaft.xml (6.3 KB ) - added by astrid_emde 13 years ago.
with two values for artDerFlurstuecksgrenze
postnas_import.sh (967 bytes ) - added by astrid_emde 13 years ago.
script to run the import

Download all attachments as: .zip

Change History (8)

by astrid_emde, 13 years ago

with two values for artDerFlurstuecksgrenze

comment:1 by astrid_emde, 13 years ago

Description: modified (diff)
Summary: ogr2ogr does not handle array field correctlyPostNAS - ogr2ogr does not handle array field correctly

comment:2 by astrid_emde, 13 years ago

Description: modified (diff)

by astrid_emde, 13 years ago

Attachment: postnas_import.sh added

script to run the import

comment:3 by astrid_emde, 13 years ago

Cc: marina.thust@… added

comment:4 by Even Rouault, 13 years ago

Hum, the explanation is simple, the solution not.

In the funkioniert case, there are 2 values for <artDerFlurstuecksgrenze>, so OGR as expected (from the code point of view ;-) ) returns a IntegerList field. In the fehlerhaft case, there is only a single value, so OGR as expected returns a Integer field.

The issue is that OGR is not aware of the NAS schema and relies on the data to establish the field names and types. So, apart from an ad-hoc patch to force "artDerFlurstuecksgrenze" to be IntegerList, I don't see an obvious cleaner approach.

comment:5 by Even Rouault, 13 years ago

Resolution: fixed
Status: newclosed

Actually, I see that Frank already fixed a similar problem by an ad-hoc patch, so here you go :

r23109 /trunk/gdal/ogr/ogrsf_frmts/nas/nasreader.cpp: NAS: add special handling for artDerFlurstuecksgrenze (#4255)

Note: See TracTickets for help on using tickets.