[Gdal-dev] ogr2ogr Unable to open datasource

Ryan Ollerenshaw ollerery at engr.orst.edu
Tue Oct 31 13:54:17 EST 2006


Ryan Ollerenshaw wrote:
>>
>>
>> Because as far as OGR knows the csv file is non-spatial, so when it 
>> creates
>> the "shapefile" it just creates the .dbf file and no spatial files.
>>
>> If you want to treat the first two columns as a point location you 
>> need to
>> follow extra steps (ie. using an OGR VRT file) to turn them into a 
>> spatial
>> location.
>>
>> Best regards,
>
> Thank you for the help but the documentation for using an OGR VRT file 
> does not seem to be clear.  I created a ovf file (see below) and ran
> # ogr2ogr -f "ESRI Shapefile" thick18.shp thick18.cvs
> but still no change only a dbf file is created.  I do not see in the 
> VRT documentation how to use the ovf file.
>
> Resources I have found:
> http://gdal.maptools.org/ogr/drv_vrt.html
> http://mapserver.gis.umn.edu/docs/reference/vector_data/VirtualSpatialData 
>

ovf file:
<OGRVRTDataSource>
        <OGRVRTLayer  name="thick18">
        <SrcDataSource>thick18</SrcDataSource>
        <SrcLayer>thick18.csv</SrcLayer>
        <GeometryField encoding="PointFromColumns" x="long" y="lat"/>
        <GeometryType>wkbPoint</GeometryType>
        </OGRVRTLayer>
</OGRVRTDataSource>

csv file:
lat,long,water_thic,error
-180,     90.00,      0.00,      4.84 
-179,     90.00,      0.00,      4.84 
-178,     90.00,      0.00,      4.84 
-177,     90.00,      0.00,      4.84 
-176,     90.00,      0.00,      4.84 
-175,     90.00,      0.00,      4.84 
-174,     90.00,      0.00,      4.84 
....
....
>
> -Ryan
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev



More information about the Gdal-dev mailing list