[gdal-dev] VRT layer definition question

Al Piszcz ap at solarrain.com
Mon May 31 13:30:33 PDT 2021


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>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210531/442a741a/attachment.html>


More information about the gdal-dev mailing list