<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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 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;
        color:black;}
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;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle23
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@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 bgcolor="white" 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:windowtext">Thanks for the ideas.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">I think the vrt file needs the csv fields to have names unless I misunderstand.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">CSVT file – does this specify the column/field data type? Can the name be specified as well?<o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"><o:p> </o:p></span></a></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">Regards<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"><o:p> </o:p></span></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">Ian<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"><o:p> </o:p></span></span></p>
<span style="mso-bookmark:_MailEndCompose"></span>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"> Simon Mercier [mailto:smercier@mapgears.com]
<br>
<b>Sent:</b> Monday, April 25, 2016 10:31 AM<br>
<b>To:</b> Steve.Toutant@inspq.qc.ca; Ian Walberg <ian.walberg@airborne.aero><br>
<b>Cc:</b> mapserver-users@lists.osgeo.org; mapserver-users <mapserver-users-bounces@lists.osgeo.org><br>
<b>Subject:</b> Re: [mapserver-users] RE OGR csv - no field names<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">why not use a vrt file instead! 
<a href="http://www.gdal.org/drv_vrt.html">http://www.gdal.org/drv_vrt.html</a><br>
<br>
<OGRVRTDataSource><br>
    <OGRVRTLayer name="precipitation"><br>
        <SrcDataSource>precipitation.csv</SrcDataSource><br>
        <GeometryType>wkbPoint</GeometryType><br>
        <LayerSRS>EPSG:4326</LayerSRS><br>
        <GeometryField encoding="PointFromColumns" x="lon" y="lat"/><br>
        <Field name="precipitation_mm" src="prec_mm"/><br>
    </OGRVRTLayer><br>
</OGRVRTDataSource><br>
<br>
<br>
<o:p></o:p></p>
<div>
<p class="MsoNormal">On 16-04-25 08:01 AM, <a href="mailto:Steve.Toutant@inspq.qc.ca">
Steve.Toutant@inspq.qc.ca</a> wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">I don't know why
</span><tt><span style="font-size:10.0pt">LABELITEM 'filed_3' would not work in your case</span></tt>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial",sans-serif">You can try to specify column names by using a  .csvt file</span>
<br>
<a href="http://www.gdal.org/drv_csv.html"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">http://www.gdal.org/drv_csv.html</span></a>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial",sans-serif">Example: </span><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:blue"><a href="https://anitagraser.com/2011/03/07/how-to-specify-data-types-of-csv-columns-for-use-in-qgis/">https://anitagraser.com/2011/03/07/how-to-specify-data-types-of-csv-columns-for-use-in-qgis/</a></span>
<br>
<br>
<o:p></o:p></p>
<p style="margin-bottom:12.0pt"><br>
<br>
<o:p></o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100.0%;border-collapse:collapse">
<tbody>
<tr style="height:4.8pt">
<td width="40%" valign="top" style="width:40.0%;padding:0in 0in 0in 0in;height:4.8pt">
<p class="MsoNormal"><b><span style="font-size:7.5pt;font-family:"Arial",sans-serif">Ian Walberg
<a href="mailto:ian.walberg@airborne.aero"><ian.walberg@airborne.aero></a>@lists.osgeo.org</span></b><span style="font-size:7.5pt;font-family:"Arial",sans-serif">
</span><br>
<span style="font-size:7.5pt;font-family:"Arial",sans-serif">Envoyé par : "mapserver-users"
<a href="mailto:mapserver-users-bounces@lists.osgeo.org"><mapserver-users-bounces@lists.osgeo.org></a></span>
<o:p></o:p></p>
<p><span style="font-size:7.5pt;font-family:"Arial",sans-serif">2016-04-23 22:50</span>
<o:p></o:p></p>
</td>
<td width="59%" valign="top" style="width:59.0%;padding:0in 0in 0in 0in;height:4.8pt">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100.0%;border-collapse:collapse">
<tbody>
<tr style="height:12.6pt">
<td width="57" valign="top" style="width:42.75pt;padding:0in 0in 0in 0in;height:12.6pt">
<p class="MsoNormal" align="right" style="text-align:right"><span style="font-size:7.5pt;font-family:"Arial",sans-serif">A</span><o:p></o:p></p>
</td>
<td valign="top" style="padding:0in 0in 0in 0in;height:12.6pt">
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Arial",sans-serif"><a href="mailto:mapserver-users@lists.osgeo.org">"mapserver-users@lists.osgeo.org"</a>
<a href="mailto:mapserver-users@lists.osgeo.org"><mapserver-users@lists.osgeo.org></a></span>
<o:p></o:p></p>
</td>
</tr>
<tr style="height:12.6pt">
<td width="57" valign="top" style="width:42.75pt;padding:0in 0in 0in 0in;height:12.6pt">
<p class="MsoNormal" align="right" style="text-align:right"><span style="font-size:7.5pt;font-family:"Arial",sans-serif">cc</span><o:p></o:p></p>
</td>
<td valign="top" style="padding:0in 0in 0in 0in;height:12.6pt"></td>
</tr>
<tr style="height:12.6pt">
<td width="57" valign="top" style="width:42.75pt;padding:0in 0in 0in 0in;height:12.6pt">
<p class="MsoNormal" align="right" style="text-align:right"><span style="font-size:7.5pt;font-family:"Arial",sans-serif">Objet</span><o:p></o:p></p>
</td>
<td valign="top" style="padding:0in 0in 0in 0in;height:12.6pt">
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Arial",sans-serif">[mapserver-users] OGR csv - no field names</span><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><o:p> </o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="393" style="width:294.75pt;border-collapse:collapse">
<tbody>
<tr style="height:4.8pt">
<td width="57" valign="top" style="width:42.75pt;padding:0in 0in 0in 0in;height:4.8pt">
</td>
<td width="336" valign="top" style="width:3.5in;padding:0in 0in 0in 0in;height:4.8pt">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p style="margin-bottom:12.0pt"><br>
<br>
<br>
<br>
<br>
<tt><span style="font-size:10.0pt">Folks,</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<br>
<tt>Can a csv file with no field names as the first row be used as an OGR source?</tt><br>
<br>
<tt>GDAL creates dummy field names, are these passed to mapserver?</tt><br>
<br>
<tt>OGRFeature(USA-Hilton):652</tt><br>
<tt> field_1 (String) = -74.16958</tt><br>
<tt> field_2 (String) =  40.73526</tt><br>
<tt> field_3 (String) =  Penn Station</tt><br>
<br>
<tt>What do we need in the layer to make this work?</tt><br>
<br>
<tt>LABELITEM 'name' - this throws an error, 'field_3' does not seem to work either.</tt><br>
<tt>CONNECTIONTYPE OGR</tt><br>
<tt>CONNECTION 'Stations.csv'</tt><br>
<br>
<tt>Thanks</tt><br>
<br>
<tt>Ian</tt><br>
<tt>_______________________________________________</tt><br>
<tt>mapserver-users mailing list</tt><br>
<tt><a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a></tt><br>
</span><a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users"><tt><span style="font-size:10.0pt">http://lists.osgeo.org/mailman/listinfo/mapserver-users</span></tt></a>
<br>
<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>mapserver-users mailing list<o:p></o:p></pre>
<pre><a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><o:p></o:p></pre>
<pre><a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>simon mercier<o:p></o:p></pre>
<pre>mapgears<o:p></o:p></pre>
<pre>+1.418.476.7139 p101<o:p></o:p></pre>
</div>
</body>
</html>