<br><br><div style="visibility: hidden; display: inline;" id="avg_ls_inline_popup"></div><style type="text/css">#avg_ls_inline_popup { position:absolute; z-index:9999; padding: 0px 0px; margin-left: 0px; margin-top: 0px; width: 240px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 13px;}</style><div class="gmail_quote">
2010/7/30 Andrey Khmelevskiy <span dir="ltr"><<a href="mailto:kmelevskiy@gmail.com">kmelevskiy@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>1) I need to convert .tab file into .shp format. <br><br>I've got error by using following command:<br>C:\Program Files\FWTools2.4.7>ogr2ogr -f "ESRI Shapefile" test.shp SHP.shp<br><br>The error:<br>
ERROR 1: Attempt to write non-linestring (POINT) geometry to ARC type shapefile.<br>ERROR 1: Terminating translation prematurely after failed<br>translation of layer tab (use -skipfailures to skip errors)<br>C:\Program Files\FWTools2.4.7>ogr2ogr -f "ESRI Shapefile" test.shp tab.TAB<br>
ERROR 1: test.shp is not a directory.<br>ESRI Shapefile driver failed to create test.shp<br><br>It am sure it is general practice that .tab files contain multityped data in it (points, lines, polygonds).<br>I wonder how to handle tab->shp conversion by using ogr2ogr function?<br>
</blockquote><div><br>Andrey,<br><br>You may use the -sql option to select a particuar shape type to be converted:<br><br><pre class="fragment">SELECT * FROM table WHERE OGR_GEOMETRY=<span class="stringliteral">'POLYGON'</span><span class="stringliteral"></span><br>
</pre>for more information about OGR sql see: <a href="http://www.gdal.org/ogr/ogr_sql.html">http://www.gdal.org/ogr/ogr_sql.html</a> <br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Another relative issue I have:<br>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:<br>
C:\Program Files\FWTools2.4.7>ogr2ogr -f "ESRI Shapefile" test_pnt.shp tab_pnt.TAB<br>Warning 6: Normalized/laundered field name: 'Flood_Risk_Comment' to 'Flood_Ri_1'<br>Any idea how to handle filed name reduction issue?<br>
<br></blockquote><div><br>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.<br>
<br></div></div>Best regards,<br><br>Tamas<br><br>