For the record, we have figured part of the mystery offlist, it turns out the VRT definition had two problems:

1- Missing required <SrcDataSource> (path to the .csv file)

2- <SrcLayer> was wrong (layer name for CSV sources is only the basename of the .csv file)

With the above fixes "ogrinfo" could read the data, but we still do not see the points on the map, however converting the VRT to a shapefile does work for the same layer... that's another mystery to solve.

Daniel


Kevin Flanders wrote:
I would like to map a virtual table, and I am told I can do it without declaring an ODBC…using the following mapfile layer definition:

  LAYER

    NAME "Fire Data"

    GROUP "Fire Data"

    STATUS on

    TYPE point

    CONNECTIONTYPE OGR

    CONNECTION "<OGRVRTDataSource>

<OGRVRTLayer name='firegis'> <SrcLayer>mapsonline.csv</SrcLayer>

<GeometryField encoding='PointFromColumns' x='XCOORD' y='YCOORD'/>
                                       <GeometryType>wkbPoint</GeometryType>

                                     </OGRVRTLayer>

                                   </OGRVRTDataSource>"

    TEMPLATE "ttt"

    TOLERANCE 4

    CLASS

NAME "Fire Data"
      SYMBOL "circle"

      OUTLINECOLOR 80 80 80

      COLOR 219 0 0

      SIZE 12

    END

  END

But this fails. Do I need an ODBC….or is it true I can access a text file directly in this manner. The data is being placed with all my other shapefiles (ie. in the same folder).

Also, can the .csv file just as easily be a .txt file….and can the entries have quotations around them?

Kevin



--
Daniel Morissette
http://www.mapgears.com/

Reply via email to