[GRASS-dev] datetime function in v.in.ogr

Markus Metz markus.metz.giswork at gmail.com
Thu Jun 27 14:05:05 PDT 2019


On Thu, Jun 27, 2019 at 9:27 PM Paulo van Breugel <p.vanbreugel at gmail.com>
wrote:
>
> Hi devs,
>
> I am trying to import a shapefile using v.in.ogr, filtering on date
> using datetime, e.g.,
>
> v.in.ogr input=myshapefile.shp layer=myshapefile output=outputlayer
> where="datm_start >= datetime('2019-01-01')"
>
> I am getting the message:
>
> ERROR 1: Undefined function 'datetime' used.
> ERROR: Error setting attribute filter 'datm_start >=
datetime('2019-01-01')'
>
> Does this mean it is not possible to use functions in v.in.ogr? Or am I
> doing somthing wrong?

The OGR shapefile driver does not support this function. You need to import
the shapefile into GRASS, using anything but the dbf driver as database
driver (default is sqlite), then try to filter with v.extract
where="datm_start >= datetime('2019-01-01')"

HTH,

Markus M

>
> Running grass gis 7.6, Linux.
>
>
> Cheers,
>
> Paulo
>
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20190627/67d4f427/attachment.html>


More information about the grass-dev mailing list