<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><a href="http://www.gdal.org/ogr/drv_shapefile.html"><span style='color:#1F497D;text-decoration:none'>http://www.gdal.org/ogr/drv_shapefile.html</span></a> states that “Normally the OGR Shapefile driver treats a whole directory of shapefiles as a dataset, and a single shapefile within that directory as a layer. In this case the directory name should be used as the dataset name. However, it is also possible to use one of the files (.shp, .shx or .dbf) in a shapefile set as the dataset name, and then it will be treated as a dataset with one layer.”<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Previously ogr2osm was rejecting shapefile directories. My example came from the US NHD data.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I was working with NHD data and the following command generated a directory from the original .mdb file which contained multiple layers<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>ogr2ogr NHDH1711.shp NHDH1711.mdb<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>It then created a directory named NHDH1711.shp which had the following contents (plus more layers)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>NHDAreaEventFC.dbf<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>NHDAreaEventFC.prj<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>NHDAreaEventFC.shp<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>NHDAreaEventFC.shx<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>NHDArea.dbf<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>NHDArea.prj<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>NHDArea.shp<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>NHDArea.shx<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>NHDFlowline.dbf<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>NHDFlowline.prj<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>NHDFlowline.shp<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>NHDFlowline.shx<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I could then run ogr2osm on the directory and use a filterLayer() function in the translation file to eliminate the layers I did not want. The code I used to do so is at </span><a href="https://github.com/pnorman/ogr2osm-translations/blob/3e44a11b1bdc441101430fad4fb0d356805d3812/us_nhd.py#L55">https://github.com/pnorman/ogr2osm-translations/blob/3e44a11b1bdc441101430fad4fb0d356805d3812/us_nhd.py#L55</a><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> TC Haddad [mailto:tchaddad@gmail.com] <br><b>Sent:</b> Monday, April 30, 2012 12:50 PM<br><b>To:</b> Paul Norman<br><b>Subject:</b> Re: [Imports] A new ogr2osm version<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>Hi Paul<br><br>can you elaborate on "Support for shapefile directories", or give an example?<br><br>Tanya<o:p></o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'>On Mon, Apr 30, 2012 at 12:36 PM, Paul Norman <<a href="mailto:penorman@mac.com" target="_blank">penorman@mac.com</a>> wrote:<o:p></o:p></p><p class=MsoNormal>Based on Andrew Guertin's work for UVM I have released a new version of<br>ogr2osm<br>It can be found at <a href="https://github.com/pnorman/ogr2osm" target="_blank">https://github.com/pnorman/ogr2osm</a><br><br>Improvements and bug fixes over the previous version include<br><br>- MultiLineStrings are broken up into multiple LineStrings<br>- More readable raw XML<br>- Support for keys or values which require escaping in the XML<br>- upload=false is set by default to help prevent accidental uploads<br>- Support for shapefile directories<br>- Significant speed improvements when dealing with data sources where<br>multiple geometries share points in common. What used to take hours now<br>takes minutes.<br><br>Installation instructions can be found at<br><a href="https://github.com/pnorman/ogr2osm#installation" target="_blank">https://github.com/pnorman/ogr2osm#installation</a><br><br>ogr2osm has three main advantages over other tools that can convert<br>shapefiles<br>- It handles the reprojection for you<br>- It can deal with shapefile directories which is what gdal uses to handle<br>multiple layers with shapefiles<br>- It accepts a python function for converting from datasource tagging to OSM<br>tagging, allowing you to use more complicated logic to come up with better<br>OSM tagging<br><br>As always, potential importers are reminded about the import guidelines.<br>ogr2osm allows you to write a good conversion to OSM tagging. It doesn't do<br>the rest of the work for you and it won't contact the community before<br>importing for you. You still have to do all of these yourself.<br><br>If anyone has good well-commented examples of translations files I welcome<br>pull requests against <a href="https://github.com/pnorman/ogr2osm-translations" target="_blank">https://github.com/pnorman/ogr2osm-translations</a><br><br><br><br>_______________________________________________<br>Imports mailing list<br><a href="mailto:Imports@openstreetmap.org">Imports@openstreetmap.org</a><br><a href="http://lists.openstreetmap.org/listinfo/imports" target="_blank">http://lists.openstreetmap.org/listinfo/imports</a><o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>