[FWTools] .tab with multy type objects conversion using ogr2ogr crashed

Tamas Szekeres szekerest at gmail.com
Fri Jul 30 15:16:03 EST 2010


2010/7/30 Andrey Khmelevskiy <kmelevskiy at gmail.com>

> Hi,
>
> 1) I need to convert .tab file into .shp format.
>
> I've got error by using following command:
> C:\Program Files\FWTools2.4.7>ogr2ogr -f "ESRI Shapefile" test.shp SHP.shp
>
> The error:
> ERROR 1: Attempt to write non-linestring (POINT) geometry to ARC type
> shapefile.
> ERROR 1: Terminating translation prematurely after failed
> translation of layer tab (use -skipfailures to skip errors)
> C:\Program Files\FWTools2.4.7>ogr2ogr -f "ESRI Shapefile" test.shp tab.TAB
> ERROR 1: test.shp is not a directory.
> ESRI Shapefile driver failed to create test.shp
>
> It am sure it is general practice that .tab files contain multityped data
> in it (points, lines, polygonds).
> I wonder how to handle tab->shp conversion by using ogr2ogr function?
>

Andrey,

You may use the -sql option to select a particuar shape type to be
converted:

SELECT * FROM table WHERE OGR_GEOMETRY='POLYGON'

for more information about OGR sql see: http://www.gdal.org/ogr/ogr_sql.html



>
> Another relative issue I have:
> 2)During the same conversion tab->shp I've got next message wich means that
> the field name 'Flood_Risk_Comment'  will be reduce to 'Flood_Ri_1' in
> resulting shp attribute table:
> C:\Program Files\FWTools2.4.7>ogr2ogr -f "ESRI Shapefile" test_pnt.shp
> tab_pnt.TAB
> Warning 6: Normalized/laundered field name: 'Flood_Risk_Comment' to
> 'Flood_Ri_1'
> Any idea how to handle filed name reduction issue?
>
>
Field names can only be maximum 10 character length with the shape format.
I'm not aware of any workaround to this issue. You may however rename the
fields to a more reasonable 'short' name by using the OGR sql field name
alias option, see the document referred above.

Best regards,

Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/fwtools/attachments/20100730/c95650a5/attachment.htm 


More information about the FWTools mailing list