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