Opened 22 years ago

Closed 16 years ago

#163 closed defect (wontfix)

conversion problem arc coverage to shape (ogr2ogr)

Reported by: menegon@… Owned by: warmerdam
Priority: high Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc: neteler@…, Mateusz Łoskot

Description (last modified by Mateusz Łoskot)

ciao Frank,

thanks for providing ogr2ogr! Unfortunately we have a problem to
convert from ARCcoverage to SHAPE. The ogr2ogr reports:

ogr2ogr -f "ESRI Shapefile" risult2 sezioni
ERROR 6: Can't create fields of type IntegerList on shapefile layers.

ERROR 6: Can't create fields of type IntegerList on shapefile layers.

The SHAPe is written, but it seems to contain no areas, but multilines
only. The ArcExplorer reports "invalid SHAPEFILE" when trying to open the file.
Finally we want to use the SHAPE for shp2psql.

The data set is stored at
ftp gdal.velocet.ca/pub/incoming/
ogr2ogr_arcBin_shape_problem.tar.gz

The processing chain was:
E00 -> avcimport -> ArcBinCoverage -> ogr2ogr -> SHAPE
resulting in above ERROR 6 (all files in above tar.gz).

Maybe you find time to look into this,

 thanks

 Stefano

Change History (12)

comment:1 by warmerdam, 22 years ago

Stefano,

Could you provide a sample dataset demonstrating the problem, and also
indicate the version of GDAL/OGR you are using?  

I have successfully loaded arc/info binary polygon coverages directly to
PostGIS with ogr2ogr in the past.  

Also, note you may need to use the -skipfailures flag to ogr2ogr to
more safely ignore problems like the unsupported integer list field. 


comment:2 by warmerdam, 22 years ago

*** Bug 162 has been marked as a duplicate of this bug. ***

comment:3 by warmerdam, 22 years ago

Sorry, I missed the test data on the first pass.

I have tested with this file, and the output shapefile file
(PAL.shp) contains lots of polygons.  However, I noticed during the
convension that debug messages reported two polygons were not properly 
assembled.  This may have resulted in two geometryless features in the output
shapefile. 

I will look into the failure to assemble the polygons, but is it possible that
you too only ran into two corrected shapes? 

PS. I would still encourage you to try building ogr2ogr with postgis support
and use it to directly load the coverage.

comment:4 by warmerdam, 22 years ago

I have patched gdal/ogr/ogrsf_frmts/avc/ogravcbinlayer.cpp to correct the
problem assembling polygons. It seems that two polygons had a "bridge" arc
between an internal ring and an external ring, but the bridge arc only appeared 
only once in the arc list so polygon assembly eventually failed (as the bridge
could only be walked one way.  

I have modified the code to discard any arcs with the target polygon on both 
sides under the assumption they are bridge arcs.  This seems to have corrected
the problem. 

comment:5 by neteler@…, 21 years ago

Frank,

hope it is ok to report to this bug (which re-appeared again today):

I have some Teleatlas demo data for Italy in E00 ASCII format.
Those I have converted to E00 binary to be acceptable for ogr2ogr/GRASS 5.1.

What I did:

avcimport impernet.e00 impernet

ogrinfo impernet
Had to open data source read-only.
INFO: Open of `impernet'
using driver `AVCBin' successful.
1: ARC (Line String)
2: CNT (Point)
3: LAB (Point)
4: PAL (Polygon)


ogr2ogr -f "ESRI Shapefile" impernet_shape impernet
ERROR 6: Can't create fields of type IntegerList on shapefile layers.

ERROR 6: Can't create fields of type IntegerList on shapefile layers.

While ogr2ogr produces the SHAPE files for all layers, v.in.ogr in
GRASS 5.1 crashes due the the error. Before modifying GRASS' behaviour
I would like to know if above problem is "desired".

The data are on
gdal.velocet.ca
pub/incoming/
impernet.e00.gz

Maybe you find the time to look into this problem.

Thanks in advance,

 Markus Neteler

comment:6 by neteler@…, 21 years ago

Frank,

probably you haven't seen the report, I reopen it.

ogr2ogr -f "ESRI Shapefile" impernet_shape impernet
ERROR 6: Can't create fields of type IntegerList on shapefile layers.

ERROR 6: Can't create fields of type IntegerList on shapefile layers.

The data are on your FTP site, description posted below in a previous
report.
If possible, maybe you could have a look?

Thanks,

 Markus

comment:7 by warmerdam, 20 years ago

Review for possible correction for 1.2.0 release.

comment:8 by warmerdam, 20 years ago

Markus, 

Approximately 9 months after you report the additional error, I am 
finally looking into it!

The problem with creating IntegerList fields is normal for Shapefiles.  I 
see it is non-fatal, some fields are just dropped.  In particular, the 
"arc list" fields for the polygons.  At least that is what happens when you
run ogr2ogr. 

I don't know why v.in.ogr is failing.  Perhaps there is no case to translate
or skip list type attributes?  I haven't got a GRASS build up and working
now so I can't easily reproduce this problem.  Would it be practical for you
to reverify that the problem exists with the most modern v.in.ogr? 

If it does, I think the problem is more properly registered in the GRASS
bug system. 

I am closing this bug now, but feel free to re-open it if you think there is
still a problem within OGR. 

Best regards,

comment:9 by neteler@…, 20 years ago

Frank,

a comment:
> The problem with creating IntegerList fields is normal for Shapefiles.  I 
> see it is non-fatal, some fields are just dropped.  In particular, the 
> "arc list" fields for the polygons.  At least that is what happens when you
> run ogr2ogr. 

In v.in.ogr we have implemented (main.c):
[...]
		} else if( Ogr_ftype == OFTIntegerList ) {
		    /* hack: treat as string */
		    sprintf (buf, ", %s varchar ( %d )", Ogr_fieldname, 40 );
		    G_warning ( "Writing column <%s> with fixed length 40 chars (may be
truncated)", Ogr_fieldname);
[...]

in order to catch the field values instead of losing them.
Maybe something similar could be done in ogr2ogr.

Best regards

 Markus Neteler

comment:10 by warmerdam, 20 years ago

Well, some formats do support the lists, so we wouldn't want to do this all
the time.  However, this might be a good error recover strategy.

Reopening to implement. 

comment:11 by Mateusz Łoskot, 16 years ago

Cc: Mateusz Łoskot added
Description: modified (diff)

Frank,

This is the oldest defect we have in our Trac database. Are there any plans regarding it?

comment:12 by warmerdam, 16 years ago

Resolution: wontfix
Status: reopenedclosed

After many years of contemplation, I think I'm not keen on this approach in ogr2ogr.

Note: See TracTickets for help on using tickets.