<div dir="ltr"><br><br>On Wed, Nov 6, 2019 at 3:01 PM Markus Neteler <<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a>> wrote:<br>><br>> Hi Daniel,<br>><br>> On Mon, Nov 4, 2019 at 12:23 PM Daniel McInerney<br>> <<a href="mailto:daniel.o.mcinerney@gmail.com">daniel.o.mcinerney@gmail.com</a>> wrote:<br>> ><br>> > Hi List,<br>> ><br>> > As part of a workflow, we are importing ESRI Shapefiles into GRASS so<br>> > that we can manage the vector topology, before re-exporting the vectors<br>> > back to an ESRI Shapefile. However, we noticed that the date fields are<br>> > being converted from a field of type Date to type String.<br><div><br></div><div>Indeed, this happens in v.out.ogr, should be easy to fix. Can you create a ticket just as a reminder?<br></div><div>></div>> AFAIK this is how SQLite handles it internally but the GRASS DBMI<br>> driver should take care of it to keep it in date format.<br><div><br></div><div>This has nothing to do with the sqlite driver.<br></div><div><br></div><div>Markus M<br></div><div><br></div><div>></div>><br>> > Hopefully the<br>> > following steps will demonstrate the issue:<br>> ><br>> > The input Shapefile is scdb_date, with a date field called 'BA_DATE':<br>> ><br>> >  >ogrinfo -so -al scdb_date.shp | grep BA_DATE<br>> > BA_DATE: Date (10.0)<br>> ><br>> > After importing into GRASS using v.in.ogr, the field is still of type<br>> > DATE (although the length has increased to 20):<br>> ><br>> >  >db.describe scdb_date | grep -A 5 BA_DATE<br>> > column:BA_DATE<br>> > description:<br>> > type:DATE<br>> > len:20<br>> > scale:0<br>> > precision:0<br>> ><br>> > However, when I export the vector (scdb_date) back to an ESRI Shapefile<br>> > using v.out.ogr, the BA_DATE is converted to a String:<br>> ><br>> > v.out.ogr input=scdb_date output=scdb_date_export.shp<br>> > format='ESRI_Shapefile'<br>> ><br>> >  >ogrinfo -so -al scdb_date_export.shp | grep 'BA_DATE'<br>> > BA_DATE: String (20.0)<br>><br>> Probably the date detection failed in the grass-sqlite driver?<br>> Could it be an encoding problem?<br>><br>> > I tried exporting to a GeoPackage, but the issue persists. While, we can<br>> > still overcome this issue using ogr and SQL, I am wondering if is there<br>> > a flag or option in v.out.ogr that I am overlooking that would maintain<br>> > the fields of type Date or is there something else that I should consider?<br>><br>> As this is unexpected could you make a small data sample available to<br>> easier reproduction?<br>><br>> thanks<br>> Markus<br>> _______________________________________________<br>> grass-user mailing list<br>> <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>> <a href="https://lists.osgeo.org/mailman/listinfo/grass-user">https://lists.osgeo.org/mailman/listinfo/grass-user</a></div>