[mapserver-users] OGR csv - no field names

Jeff McKenna jmckenna at gatewaygeomatics.com
Mon Apr 25 14:39:23 PDT 2016


Note that when you execute 'ogrinfo myfile.csv myfile -summary' OGR will 
not find any geometry (you will get a response of 'Geometry: None') 
which makes it impossible to view in MapServer; that is why you use a 
.vrt, where you specify the x and y source columns by name.

I'm not aware of a workaround for no field names for a CSV.

-jeff


-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/



On 2016-04-23 11:50 PM, Ian Walberg wrote:
> Folks,
>
> Can a csv file with no field names as the first row be used as an OGR source?
>
> GDAL creates dummy field names, are these passed to mapserver?
>
> OGRFeature(USA-Hilton):652
>    field_1 (String) = -74.16958
>    field_2 (String) =  40.73526
>    field_3 (String) =  Penn Station
>
> What do we need in the layer to make this work?
>
> LABELITEM 'name' - this throws an error, 'field_3' does not seem to work either.
> CONNECTIONTYPE OGR
> CONNECTION 'Stations.csv'
>
> Thanks
>
> Ian





More information about the mapserver-users mailing list