8

I have a roads.shp file which represents the highway map of Istanbul.

By using Random Extract tool, I generated 2000 random routes on the existing map. Then, I needed to add uniform generated points on those routes, once in 20 meters (done by using points along geometry from processing tools).

At last, I want to add timestamp to each point, as if the points are the trajectories of the cars. To add the timestamp, I need to choose Time field type. The problem starts here: In the Field Calculator, the Time field type is not found, along with other so many field types. I tried to use Date field type but the result is not in the way I want. Can you help me about it? I use QGIS 3.22.2.

P.S. the CRS type I set my project is TUREF / 3-degree Gauss-Kruger zone 10

example

3
  • 3
    You must use different spatial data format than shapefile. It doesn't support DateTime. Commented Jan 16, 2022 at 15:02
  • Thank you so much! data format is the issue. Which data format is recommended to use Time field type? Commented Jan 16, 2022 at 15:07
  • 3
    Geopackage. See the solution below
    – Babel
    Commented Jan 16, 2022 at 15:13

1 Answer 1

8

You probably use shapefiles to store your layer. To solve your issue, save the layer to a Geopackage.

Shapefiles do not support Datetime field types. See the QGIS documentation about Shapefiles:

Only Decimal number, Whole number, Text data and Date attributes are supported.

See also this explanation.

6
  • 1
    For shapefiles I would refer to ESRI's documentation : google.com/…
    – Taras
    Commented Jan 17, 2022 at 7:30
  • OK, but I can't see any information about field types in this documentation - or did I overlook it? Searching for text, string or date does not find anything.
    – Babel
    Commented Jan 17, 2022 at 7:47
  • Search for "Type"
    – Taras
    Commented Jan 17, 2022 at 7:48
  • For Type, onle Integer and Double (and Point(?)) are mentioned - no information about Date or Text/String. Did the initial Shapefile format not have any corresponding fieldtypes?
    – Babel
    Commented Jan 17, 2022 at 7:52
  • I can be wrong, but it did not
    – Taras
    Commented Jan 17, 2022 at 7:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.