[Qgis-developer] ogr virtual datasource not working

Milo van der Linden milo at dogodigi.net
Wed Feb 23 15:45:50 EST 2011


One more question. I have now created the following vrt, but the DateTime is
not parsed correctly. Are extra options available for the datetime object to
tell ogr how it is formatted and thus, how it should be interpreted?

<OGRVRTDataSource>
    <OGRVRTLayer name="test">
        <SrcDataSource relativeToVRT="1">test.csv</SrcDataSource>
        <GeometryType>wkbPoint</GeometryType>
        <LayerSRS>EPSG:28992</LayerSRS>
        <GeometryField encoding="PointFromColumns" x="T X Coord Loc" y="T Y
Coord Loc"/>
    <Field name="Incident Id" type="Integer" />
    <Field name="Nr Incident" type="Integer" />
    <Field name="Dtg Start Incident" type="DateTime" />
    <Field name="Dtg Einde Incident" type="DateTime" />
    <Field name="Brw Melding Cl" type="String" />
    <Field name="Brw Melding Cl1" type="String" />
    <Field name="Brw Melding Cl2" type="String" />
    <Field name="Naam Locatie1" type="String" />
    <Field name="Postcode4pp" type="String" />
    <Field name="Plaats Naam" type="String" />
    <Field name="Gemeente Naam" type="String" />
    </OGRVRTLayer>
</OGRVRTDataSource>



2011/2/23 Milo van der Linden <milo at dogodigi.net>

> Thanks! Nice tip! I have read the documentation and will play arround with
> setting the datatypes for my columns too, this will give me the ability to
> do thematic mapping right on the csv!
>
> 2011/2/23 Richard Duivenvoorde <rdmailings at duif.net>
>
>> Milo van der Linden wrote:
>> > Shouldn't it go to the dev list if the absolute path is required? I
>> > think that assuming the vrt and the csv are in the same dir should be
>> > the first check as ogr2ogr has no problem with it.
>>
>> Hi Milo,
>>
>> I had a look at the docs of ogr vrt driver:
>> http://www.gdal.org/ogr/drv_vrt.html
>>
>> it's not really necessary to use the full path, you can add a attribute
>> relativeToVRT="1" to the SrcDataSource element:
>>
>> <SrcDataSource relativeToVRT="1">test.csv</SrcDataSource>
>> instead of
>> <SrcDataSource>test.csv</SrcDataSource>
>>
>> this makes your vrt-definition also work in qgis without an absolute
>> path. (don't know why a relative path is working for ogr2ogr though ...)
>>
>> Regards,
>>
>> Richard
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20110223/98df28be/attachment-0001.html


More information about the Qgis-developer mailing list