[gdal-dev] VRT layer definition question

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Mon May 31 13:41:55 PDT 2021


Hi,

Please add couple of rows from your CSV file. Maybe the lon and lat fields
are otherwise OK but GDAL does not recognize them to contain numbers but
perhaps text. You can also check what sort of attributes ogrinfo reports
with

ogrinfo file1.csv -al -so

-Jukka Rahkonen-



Al Piszcz wrote
> I am having a challenge determining the right position or entry for the
> Field entry, the spatial filter error below indicates my VRT format is not
> correct. Is there a better approach? Thank you.
> 
>>ogrmerge.py -overwrite_ds -single -o __sdg\merge_02.csv __sdg\merge_01.vrt
> 
> *Warning 1: The 'lon' and/or 'lat' fields of the source layer are not
> declared as numeric fields, so the spatial filter cannot be turned into an
> attribute filter on them*
> 
> The VRT is defined as
> <OGRVRTDataSource>
>   
> <OGRVRTLayer name="file1">
>     
> <SrcDataSource>
> lib/_data/sdg/data\file1.csv
> </SrcDataSource>
>     
> <SrcLayer>
> file1
> </SrcLayer>
>    
> <Field name="lon" type="real" />
>    
> <Field name="lat" type="real" />
>    
> <SrcRegion clip="true">
> POLYGON ((0.0 0.0, 0.0 0.1, 0.1 0.1, 0.1 0.0, 0.0
> 0.0))
> </SrcRegion>
>    
> <GeometryType>
> wkbPoint
> </GeometryType>
>    
> <LayerSRS>
> WGS84
> </LayerSRS>
>    
> <GeometryField encoding="PointFromColumns" x="lon" y="lat"/>
> </OGRVRTLayer>
>   
> <OGRVRTLayer name="file2">
>     
> <SrcDataSource>
> lib/_data/sdg/data\file2.csv
> </SrcDataSource>
>     
> <SrcLayer>
> file2
> </SrcLayer>
>    
> <Field name="lon" type="real" />
>    
> <Field name="lat" type="real" />
>    
> <SrcRegion clip="true">
> POLYGON ((0.0 0.0, 0.0 0.1, 0.1 0.1, 0.1 0.0, 0.0
> 0.0))
> </SrcRegion>
>    
> <GeometryType>
> wkbPoint
> </GeometryType>
>    
> <LayerSRS>
> WGS84
> </LayerSRS>
>    
> <GeometryField encoding="PointFromColumns" x="lon" y="lat"/>
> </OGRVRTLayer>
> 
> </OGRVRTDataSource>
> _______________________________________________
> gdal-dev mailing list

> gdal-dev at .osgeo

> https://lists.osgeo.org/mailman/listinfo/gdal-dev





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list