OVF file syntax

Frank Warmerdam warmerdam at POBOX.COM
Tue Aug 15 10:48:47 EDT 2006


P Kishor wrote:
>> cd "C:\My Documents\resources"
>> less foo.ovf
> <OGRVRTDataSource>
>  <OGRVRTLayer name="foo">
>  <SrcDataSource>"C:\\My Documents\\Data\\foo.csv"</SrcDataSource>
>  <SrcLayer>foo</SrcLayer>
>  <GeometryField encoding="PointFromColumns" x="LONGITUDE" y="LATITUDE"/>
>  <GeometryType>wkbPoint</GeometryType>
>  </OGRVRTLayer>
> </OGRVRTDataSource>
> 
>> less proj.txt
> PROJCS['USA_Contiguous_Lambert_Conformal_Conic',GEOGCS['GCS_Nor...
> 
>> cd "C:\My Documents\Data"
>> less foo.csv
> ID,A,B,C,D,E,LONGITUDE,LATITUDE,F
> 1,10,,,,,-106.524288,35.139437,
> 2,10,,,,,-106.522907,35.132337,
> 3,10,,,,,-106.519838,35.148427,
> 
>> cd "C:\My Documents\Home"
>> ogr2ogr -f "ESRI Shapefile" \
>    -a_srs "C:\\My Documents\\resources\\proj.txt" \
>    -t_srs "C:\\My Documents\\resources\\proj.txt" \
>    foo_shapefile \
>    "C:\\My Documents\\resources\\foo.ovf"
> 
> Couldn't run: ogr2ogr -f "ESRI Shapefile" -a_srs "C:/My
> Documents/resources/proj.txt" -t_srs "C:/My
> Documents/resources/proj.txt" foo_shapefile "C:/My
> Documents/resources/foo.ovf" (No such file or directory)
> 
> I can't tell whether ogr2ogr can't file 'foo.ovf', or it can't find
> the files referenced inside 'foo.ovf', or if I have something else
> wrong altogether.

Puneet,

I'm guessing this is mostly some sort of shell quoting problem.  I will
add that you shouldn't use double backslashes to escape backslashes in
a .ovf file.  OVF files are XML and would only need XML styling escaping
internally.  So the SrcDataSource line should read:

   <SrcDataSource>"C:\My Documents\Data\foo.csv"</SrcDataSource>

I would encourage you to try your experiment in a path with no spaces
so you don't need so much quoting.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGF, http://osgeo.org



More information about the mapserver-users mailing list