[FWTools] .tab with multy type objects conversion using ogr2ogr crashed
szekerest at gmail.com
Fri Jul 30 15:16:03 EST 2010
2010/7/30 Andrey Khmelevskiy <kmelevskiy at gmail.com>
> 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
> 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?
You may use the -sql option to select a particuar shape type to be
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
> Warning 6: Normalized/laundered field name: 'Flood_Risk_Comment' to
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the FWTools