I have a SQLite database
containing a GGA sentence
in one of its fields. I'd like to display this information as a POINT
layer.
I've looked at OGR Virtual Format
solution as suggested here but I cannot define the Geometry
field like in that solution as I do not have lat
, lon
readily available.
I can create these 2 fields as computed fields but I can't get them to display.
If I do this:
<OGRVRTDataSource>
<OGRVRTLayer name="test">
<SrcDataSource>C:/Temp/SQLite/test.db</SrcDataSource>
<SrcLayer>table_test</SrcLayer>
<Field name="GPGGA" />
<GeometryType>wkbPoint</GeometryType>
<LayerSRS>WGS84</LayerSRS>
</OGRVRTLayer>
</OGRVRTDataSource>
The GPGGA field is available and I can compute the lat
and lon
fields (using the Field Calculator
from the layer's properties' Fields
section).
However, if I add the <GeometryField>
definition below to my .vrt file
:
<OGRVRTDataSource>
<OGRVRTLayer name="test">
<SrcDataSource>C:/Temp/SQLite/test.db</SrcDataSource>
<SrcLayer>table_test</SrcLayer>
<Field name="GPGGA" />
<GeometryType>wkbPoint</GeometryType>
<LayerSRS>WGS84</LayerSRS>
<GeometryField encoding="PointFromColumns" x="lon" y="lat"/>
</OGRVRTLayer>
</OGRVRTDataSource>
The GPGGA
field disappear from the available fields and consequently, the lat
and lon
fields do not compute properly.
I have looked at the GDAL help section but couldn't find the solution.