<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="NO-BOK" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi Paulo,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Maybe SQLITE dialect [1] in ogr2ogr could help?!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Could be worth a try to create a vector VRT [2] with ogr2ogr and import that.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">No idea if it is faster but could be an option…
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Cheers<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Stefan<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">1: <a href="https://gdal.org/programs/ogr2ogr.html#cmdoption-ogr2ogr-dialect">
https://gdal.org/programs/ogr2ogr.html#cmdoption-ogr2ogr-dialect</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">2: </span><a href="https://gdal.org/drivers/vector/vrt.html"><span lang="EN-US">https://gdal.org/drivers/vector/vrt.html</span></a><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> grass-dev <grass-dev-bounces@lists.osgeo.org>
<b>On Behalf Of </b>Paulo van Breugel<br>
<b>Sent:</b> torsdag 27. juni 2019 23:15<br>
<b>To:</b> Markus Metz <markus.metz.giswork@gmail.com><br>
<b>Cc:</b> GRASS developers email list <grass-dev@lists.osgeo.org><br>
<b>Subject:</b> Re: [GRASS-dev] datetime function in v.in.ogr<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div id="aqm-original">
<div>
<div>
<p style="mso-margin-top-alt:8.0pt;margin-right:0cm;margin-bottom:8.0pt;margin-left:0cm">
<span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">Op 27 juni 2019 23:05:17 schreef Markus Metz <<a href="mailto:markus.metz.giswork@gmail.com">markus.metz.giswork@gmail.com</a>>:<o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid gray 1.0pt;padding:0cm 0cm 0cm 5.0pt;margin-left:4.5pt;margin-right:0cm">
<div>
<p class="MsoNormal"><span style="color:black"><br>
<br>
On Thu, Jun 27, 2019 at 9:27 PM Paulo van Breugel <<a href="mailto:p.vanbreugel@gmail.com">p.vanbreugel@gmail.com</a>> wrote:<br>
><br>
> Hi devs,<br>
><br>
> I am trying to import a shapefile using v.in.ogr, filtering on date<br>
> using datetime, e.g.,<br>
><br>
> v.in.ogr input=myshapefile.shp layer=myshapefile output=outputlayer<br>
> where="datm_start >= datetime('2019-01-01')"<br>
><br>
> I am getting the message:<br>
><br>
> ERROR 1: Undefined function 'datetime' used.<br>
> ERROR: Error setting attribute filter 'datm_start >= datetime('2019-01-01')'<br>
><br>
> Does this mean it is not possible to use functions in v.in.ogr? Or am I<br>
> doing somthing wrong?<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black">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')"<o:p></o:p></span></p>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Ok, thanks, was hoping I could do a selection before to safe on the time ik takes to import. I'll look for a way to filter before import using another tool.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div id="aqm-original">
<div>
<div>
<blockquote style="border:none;border-left:solid gray 1.0pt;padding:0cm 0cm 0cm 5.0pt;margin-left:4.5pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black">HTH,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black">Markus M<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black">><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span style="color:black">> Running grass gis 7.6, Linux.<br>
><br>
><br>
> Cheers,<br>
><br>
> Paulo<br>
><br>
><br>
> _______________________________________________<br>
> grass-dev mailing list<br>
> <a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/grass-dev">https://lists.osgeo.org/mailman/listinfo/grass-dev</a><o:p></o:p></span></p>
</div>
</blockquote>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>