Use html for the code block in README
[guile-gdal] / gdal / ogr.scm
1 (define-module (gdal ogr)
2   #:use-module (system foreign)
3   #:use-module (rnrs bytevectors)
4   #:use-module (ice-9 q)
5   #:use-module (srfi srfi-9)
6   #:use-module (srfi srfi-1)
7   #:use-module (srfi srfi-4 gnu)
8   #:use-module (gdal config)
9   #:use-module (gdal internal))
10
11   ;;------------------------------------------------------------------------------
12
13   ;;; Enums
14
15   ;;------------------------------------------------------------------------------
16
17   ;;; OGRFieldType enums
18   (define-public OFT_INTEGER 0)
19   (define-public OFT_INTEGER_LIST 1)
20   (define-public OFT_REAL 2)
21   (define-public OFT_REAL_LIST 3)
22   (define-public OFT_STRING 4)
23   (define-public OFT_STRING_LIST 5)
24   (define-public OFT_WIDE_STRING 6)
25   (define-public OFT_WIDE_STRING_LIST 7)
26   (define-public OFT_BINARY 8)
27   (define-public OFT_DATE 9)
28   (define-public OFT_TIME 10)
29   (define-public OFT_DATE_TIME 11)
30   (define-public OFT_INTEGER64 12)
31   (define-public OFT_INTEGER64_LIST 13)
32
33   ;;------------------------------------------------------------------------------
34
35   ;;; Structures
36
37   ;;------------------------------------------------------------------------------
38
39   ;;; gdal-datetime
40
41   (define-record-type <gdal-datetime>
42     (make-gdal-datetime year month day hour minute second tz)
43     gdal-datetime?
44     (year gdal-datetime-year set-gdal-datetime-year!)
45     (month gdal-datetime-month set-gdal-datetime-month!)
46     (day gdal-datetime-day set-gdal-datetime-day!)
47     (hour gdal-datetime-hour set-gdal-datetime-hour!)
48     (minute gdal-datetime-minute set-gdal-datetime-minute!)
49     (second gdal-datetime-second set-gdal-datetime-second!)
50     (tz gdal-datetime-tz set-gdal-datetime-tz!))
51
52   (export make-gdal-datetime
53           gdal-datetime?
54           gdal-datetime-year
55           set-gdal-datetime-year!
56           gdal-datetime-month
57           set-gdal-datetime-month!
58           gdal-datetime-day
59           set-gdal-datetime-day!
60           gdal-datetime-hour
61           set-gdal-datetime-hour!
62           gdal-datetime-minute
63           set-gdal-datetime-minute!
64           gdal-datetime-second
65           set-gdal-datetime-second!
66           gdal-datetime-tz
67           set-gdal-datetime-tz!)
68
69 ;;------------------------------------------------------------------------------
70
71 ;;; OGR Function Bindings
72
73 ;;------------------------------------------------------------------------------
74
75 (define-gdal-foreign %ogr-l-reset-reading
76   void "OGR_L_ResetReading" (list '*) 20)
77
78 (define (reset-layer-reading h-layer)
79     "Reset feature reading to start on the first feature.
80
81 This affects get-next-feature.
82
83 Parameters:
84     h-layer: handle to the layer on which features are read."
85   (%ogr-l-reset-reading h-layer))
86
87 (export reset-layer-reading)
88
89 ;;------------------------------------------------------------------------------
90
91 (define-gdal-foreign %ogr-l-get-next-feature
92   '* "OGR_L_GetNextFeature" (list '*) 20)
93
94 (define (get-next-feature h-layer)
95     "Fetch the next available feature from this layer.
96
97 The returned feature becomes the responsibility of the caller to delete with
98 \"destroy-feature\". It is critical that all features associated with an
99 OGRLayer (more specifically an OGRFeatureDefn) be deleted before that
100 layer/datasource is deleted.
101
102 This function implements sequential access to the features of a layer. The
103 \"reset-layer-reading\" function can be used to start at the beginning again.
104
105 Returns a handle to a feature, or NULL if no more features are available.
106
107 Parameters:
108     h-layer: handle to the layer on which features are read."
109   (%ogr-l-get-next-feature h-layer))
110
111 (export get-next-feature)
112
113 ;;------------------------------------------------------------------------------
114
115 (define-gdal-foreign %ogr-l-get-layer-defn
116   '* "OGR_L_GetLayerDefn" (list '*) 20)
117
118 (define (get-feature-definition-of-layer h-layer)
119     "Fetch the schema information for this layer.
120
121 The returned handle to the OGRFeatureDefn is owned by the OGRLayer, and should
122 not be modified or freed by the application. It encapsulates the attribute
123 schema of the features of the layer.
124
125 Parameters:
126     h-layer: handle to the layer on which features are read."
127   (%ogr-l-get-layer-defn h-layer))
128
129 (export get-feature-definition-of-layer)
130
131 ;;------------------------------------------------------------------------------
132
133 (define-gdal-foreign %ogr-fd-get-field-count
134   int "OGR_FD_GetFieldCount" (list '*) 20)
135
136 (define (get-field-count-of-feature-definition h-defn)
137     "Fetch number of fields on the passed feature definition.
138
139 Parameters:
140     h-defn: handle to the feature definition to get the fields count from."
141   (%ogr-fd-get-field-count h-defn))
142
143 (export get-field-count-of-feature-definition)
144
145 ;;------------------------------------------------------------------------------
146
147 (define-gdal-foreign %ogr-fd-get-field-defn
148   '* "OGR_FD_GetFieldDefn" (list '* int) 20)
149
150 (define (get-field-definition-of-feature-definition h-defn i-field)
151     "Fetch field definition of the passed feature definition.
152
153 Parameters:
154     h-defn: handle to the feature definition to get the field definition from.
155     i-field: the field to fetch, between 0 and
156 (- (get-field-count-of-feature-definition) 1)."
157   (%ogr-fd-get-field-defn h-defn i-field))
158
159 (export get-field-definition-of-feature-definition)
160
161 ;;------------------------------------------------------------------------------
162
163 (define-gdal-foreign %ogr-fld-get-type
164   int "OGR_Fld_GetType" (list '*) 20)
165
166 (define (get-type-of-field h-defn)
167     "Fetch type of this field. See OFT_* enums for possible return values.
168
169 Parameters:
170     h-defn: handle to the field definition to get type from."
171   (%ogr-fld-get-type h-defn))
172
173 (export get-type-of-field)
174
175 ;;------------------------------------------------------------------------------
176
177 (define-gdal-foreign %ogr-f-get-field-as-integer
178   int "OGR_F_GetFieldAsInteger" (list '* int) 20)
179
180 (define (get-field-as-integer h-feat i-field)
181     "Fetch field value as integer.
182
183 OFTString features will be translated using atoi(). OFTReal fields will be cast
184 to integer. Other field types, or errors will result in a return value of zero.
185
186 Parameters:
187     h-feat: handle to the feature that owned the field.
188     i-field: the field to fetch, from 0 to GetFieldCount()-1"
189   (%ogr-f-get-field-as-integer h-feat i-field))
190
191 (export get-field-as-integer)
192
193 ;;------------------------------------------------------------------------------
194
195 (define-gdal-foreign %ogr-f-get-field-as-integer64
196   int64 "OGR_F_GetFieldAsInteger64" (list '* int) 20)
197
198 (define (get-field-as-integer64 h-feat i-field)
199     "Fetch field value as integer 64 bit.
200
201 OFTInteger are promoted to 64 bit. OFTReal fields will be cast to integer.
202 Other field types, or errors will result in a return value of zero.
203
204 Parameters:
205     h-feat: handle to the feature that owned the field.
206     i-field: the field to fetch, from 0 to GetFieldCount()-1"
207   (%ogr-f-get-field-as-integer64 h-feat i-field))
208
209 (export get-field-as-integer64)
210
211 ;;------------------------------------------------------------------------------
212
213 (define-gdal-foreign %ogr-f-get-field-as-double
214   double "OGR_F_GetFieldAsDouble" (list '* int) 20)
215
216 (define (get-field-as-double h-feat i-field)
217     "Fetch field value as a double.
218
219 OFTString features will be translated using CPLAtof(). OFTInteger fields will
220 be cast to double. Other field types, or errors will result in a return value
221 of zero.
222
223 Parameters:
224     h-feat: handle to the feature that owned the field.
225     i-field: the field to fetch, from 0 to GetFieldCount()-1"
226   (%ogr-f-get-field-as-double h-feat i-field))
227
228 (export get-field-as-double)
229
230 ;;------------------------------------------------------------------------------
231
232 (define-gdal-foreign %ogr-f-get-field-as-string
233   '* "OGR_F_GetFieldAsString" (list '* int) 20)
234
235 (define (get-field-as-string h-feat i-field)
236     "Fetch field value as a string.
237
238 OFTReal and OFTInteger fields will be translated to string using sprintf(),
239 but not necessarily using the established formatting rules. Other field types,
240 or errors will result in a return value of zero.
241
242 Parameters:
243     h-feat: handle to the feature that owned the field.
244     i-field: the field to fetch, from 0 to GetFieldCount()-1"
245   (pointer->string (%ogr-f-get-field-as-string h-feat i-field)))
246
247 (export get-field-as-string)
248
249 ;;------------------------------------------------------------------------------
250
251 (define-gdal-foreign %ogr-f-get-field-as-integer-list
252   '* "OGR_F_GetFieldAsIntegerList" (list '* int '*) 20)
253
254 (define (get-field-as-integer-list h-feat i-field)
255     "Fetch field value as a list of integers.
256
257 Currently this function only works for OFTIntegerList fields.
258
259 Parameters:
260     h-feat: handle to the feature that owned the field.
261     i-field: the field to fetch, from 0 to GetFieldCount()-1"
262   (let* ((bv-count (make-bytevector (sizeof int)))
263          (bv-result (%ogr-f-get-field-as-integer-list h-feat
264                                                       i-field
265                                                       (bytevector->pointer
266                                                         bv-count))))
267     (pointer->list bv-result
268                    (bytevector-s32-native-ref bv-count 0)
269                    int32)))
270
271 (export get-field-as-integer-list)
272
273 ;;------------------------------------------------------------------------------
274
275 (define-gdal-foreign %ogr-f-get-field-as-integer64-list
276   '* "OGR_F_GetFieldAsInteger64List" (list '* int '*) 20)
277
278 (define (get-field-as-integer64-list h-feat i-field)
279     "Fetch field value as a list of 64 bit integers.
280
281 Currently this function only works for OFTInteger64List fields.
282
283 Parameters:
284     h-feat: handle to the feature that owned the field.
285     i-field: the field to fetch, from 0 to GetFieldCount()-1"
286   (let* ((bv-count (make-bytevector (sizeof int)))
287          (bv-result (%ogr-f-get-field-as-integer64-list h-feat
288                                                         i-field
289                                                         (bytevector->pointer
290                                                           bv-count))))
291     (pointer->list bv-result
292                    (bytevector-s32-native-ref bv-count 0)
293                    int64)))
294
295 (export get-field-as-integer64-list)
296
297 ;;------------------------------------------------------------------------------
298
299 (define-gdal-foreign %ogr-f-get-field-as-double-list
300   '* "OGR_F_GetFieldAsDoubleList" (list '* int '*) 20)
301
302 (define (get-field-as-double-list h-feat i-field)
303     "Fetch field value as a list of doubles.
304
305 Currently this function only works for OFTRealList fields.
306
307 Parameters:
308     h-feat: handle to the feature that owned the field.
309     i-field: the field to fetch, from 0 to GetFieldCount()-1"
310   (let* ((bv-count (make-bytevector (sizeof int)))
311          (bv-result (%ogr-f-get-field-as-double-list h-feat
312                                                      i-field
313                                                      (bytevector->pointer
314                                                        bv-count))))
315     (pointer->list bv-result
316                    (bytevector-s32-native-ref bv-count 0)
317                    double)))
318
319 (export get-field-as-double-list)
320
321 ;;------------------------------------------------------------------------------
322
323 (define-gdal-foreign %ogr-f-get-field-as-binary
324   '* "OGR_F_GetFieldAsBinary" (list '* int '*) 20)
325
326 (define (get-field-as-binary h-feat i-field)
327     "Fetch field value as binary.
328
329 This method only works for OFTBinary and OFTString fields.
330
331 Parameters:
332     h-feat: handle to the feature that owned the field.
333     i-field: the field to fetch, from 0 to GetFieldCount()-1"
334   (let* ((bv-count (make-bytevector (sizeof int)))
335          (bv-result (%ogr-f-get-field-as-binary h-feat
336                                                 i-field
337                                                 (bytevector->pointer
338                                                   bv-count))))
339     (pointer->bytevector bv-result
340                    (bytevector-s32-native-ref bv-count 0))))
341
342 (export get-field-as-binary)
343
344 ;;------------------------------------------------------------------------------
345
346 (define-gdal-foreign %ogr-f-get-field-as-string-list
347   '* "OGR_F_GetFieldAsStringList" (list '* int) 20)
348
349 (define (get-field-as-string-list h-feat i-field)
350     "Fetch field value as a list of strings.
351
352 Currently this method only works for OFTStringList fields.
353
354 Parameters:
355     h-feat: handle to the feature that owned the field.
356     i-field: the field to fetch, from 0 to GetFieldCount()-1"
357   (pointerpointer->string-list (%ogr-f-get-field-as-string-list h-feat
358                                                                 i-field)))
359
360 (export get-field-as-string-list)
361
362 ;;------------------------------------------------------------------------------
363
364 (define-gdal-foreign %ogr-f-get-field-as-datetime
365   int "OGR_F_GetFieldAsDateTime" (list '* int '* '* '* '* '* '* '*) 20)
366
367 (define (get-field-as-datetime h-feat i-field)
368     "Fetch field value as date and time.
369
370 Currently this method only works for OFTDate, OFTTime and OFTDateTime fields.
371 Use get-field-as-datetime-ex for second with millisecond accuracy.
372
373 Parameters:
374     h-feat: handle to the feature that owned the field.
375     i-field: the field to fetch, from 0 to GetFieldCount()-1"
376   (let* ((bv-year (make-bytevector (sizeof int)))
377          (bv-month (make-bytevector (sizeof int)))
378          (bv-day (make-bytevector (sizeof int)))
379          (bv-hour (make-bytevector (sizeof int)))
380          (bv-minute (make-bytevector (sizeof int)))
381          (bv-second (make-bytevector (sizeof int)))
382          (bv-tz (make-bytevector (sizeof int)))
383          (result (%ogr-f-get-field-as-datetime h-feat
384                                                i-field
385                                                (bytevector->pointer bv-year)
386                                                (bytevector->pointer bv-month)
387                                                (bytevector->pointer bv-day)
388                                                (bytevector->pointer bv-hour)
389                                                (bytevector->pointer bv-minute)
390                                                (bytevector->pointer bv-second)
391                                                (bytevector->pointer bv-tz))))
392     (if (c-bool->boolean result)
393       (make-gdal-datetime (bytevector-s32-native-ref bv-year 0)
394                           (bytevector-s32-native-ref bv-month 0)
395                           (bytevector-s32-native-ref bv-day 0)
396                           (bytevector-s32-native-ref bv-hour 0)
397                           (bytevector-s32-native-ref bv-minute 0)
398                           (bytevector-s32-native-ref bv-second 0)
399                           (bytevector-s32-native-ref bv-tz 0))
400       (error "failed to get datetime"))))
401
402 (export get-field-as-datetime)
403
404 ;;------------------------------------------------------------------------------
405
406 (define-gdal-foreign %ogr-f-get-field-as-datetime-ex
407   int "OGR_F_GetFieldAsDateTimeEx" (list '* int '* '* '* '* '* '* '*) 20)
408
409 (define (get-field-as-datetime-ex h-feat i-field)
410     "Fetch field value as date and time.
411
412 Currently this method only works for OFTDate, OFTTime and OFTDateTime fields.
413
414 Parameters:
415     h-feat: handle to the feature that owned the field.
416     i-field: the field to fetch, from 0 to GetFieldCount()-1"
417   (let* ((bv-year (make-bytevector (sizeof int)))
418          (bv-month (make-bytevector (sizeof int)))
419          (bv-day (make-bytevector (sizeof int)))
420          (bv-hour (make-bytevector (sizeof int)))
421          (bv-minute (make-bytevector (sizeof int)))
422          (bv-second (make-bytevector (sizeof int)))
423          (bv-tz (make-bytevector (sizeof int)))
424          (result (%ogr-f-get-field-as-datetime-ex
425                     h-feat
426                     i-field
427                     (bytevector->pointer bv-year)
428                     (bytevector->pointer bv-month)
429                     (bytevector->pointer bv-day)
430                     (bytevector->pointer bv-hour)
431                     (bytevector->pointer bv-minute)
432                     (bytevector->pointer bv-second)
433                     (bytevector->pointer bv-tz))))
434     (if (c-bool->boolean result)
435       (make-gdal-datetime (bytevector-s32-native-ref bv-year 0)
436                           (bytevector-s32-native-ref bv-month 0)
437                           (bytevector-s32-native-ref bv-day 0)
438                           (bytevector-s32-native-ref bv-hour 0)
439                           (bytevector-s32-native-ref bv-minute 0)
440                           (bytevector-s32-native-ref bv-second 0)
441                           (bytevector-s32-native-ref bv-tz 0))
442       (error "failed to get datetime"))))
443
444 (export get-field-as-datetime-ex)
445
446 ;;------------------------------------------------------------------------------
447
448 (define-gdal-foreign %ogr-f-set-field-integer
449   void "OGR_F_SetFieldInteger" (list '* int int) 20)
450
451 (define (set-field-integer h-feat i-field n-value)
452     "Set field to integer value.
453
454 OFTInteger, OFTInteger64 and OFTReal fields will be set directly. OFTString
455 fields will be assigned a string representation of the value, but not
456 necessarily taking into account formatting constraints on this field. Other
457 field types may be unaffected.
458
459 Parameters:
460     h-feat: handle to the feature that owned the field.
461     i-field: the field to fetch, from 0 to GetFieldCount()-1.
462     n-value: the value to assign"
463   (%ogr-f-set-field-integer h-feat i-field n-value))
464
465 (export set-field-integer)
466
467 ;;------------------------------------------------------------------------------
468
469 (define-gdal-foreign %ogr-f-set-field-integer64
470   void "OGR_F_SetFieldInteger64" (list '* int int64) 20)
471
472 (define (set-field-integer64 h-feat i-field n-value)
473     "Set field to 64 bit integer value.
474
475 OFTInteger, OFTInteger64 and OFTReal fields will be set directly. OFTString
476 fields will be assigned a string representation of the value, but not
477 necessarily taking into account formatting constraints on this field. Other
478 field types may be unaffected.
479
480 Parameters:
481     h-feat: handle to the feature that owned the field.
482     i-field: the field to fetch, from 0 to GetFieldCount()-1.
483     n-value: the value to assign"
484   (%ogr-f-set-field-integer64 h-feat i-field n-value))
485
486 (export set-field-integer64)
487
488 ;;------------------------------------------------------------------------------
489
490 (define-gdal-foreign %ogr-f-set-field-integer64-list
491   void "OGR_F_SetFieldInteger64List" (list '* int int '*) 20)
492
493 (define (set-field-integer64-list h-feat i-field values)
494     "Set field to list of 64 bit integers value.
495
496 This function currently on has an effect of OFTIntegerList, OFTInteger64List
497 and OFTRealList fields.
498
499 Parameters:
500     h-feat: handle to the feature that owned the field.
501     i-field: the field to fetch, from 0 to GetFieldCount()-1.
502     values: the values to assign"
503   (%ogr-f-set-field-integer64-list h-feat i-field (length values)
504                                    (list->pointer values int64)))
505
506 (export set-field-integer64-list)
507
508 ;;------------------------------------------------------------------------------
509
510 (define-gdal-foreign %ogr-f-set-field-integer-list
511   void "OGR_F_SetFieldIntegerList" (list '* int int '*) 20)
512
513 (define (set-field-integer-list h-feat i-field values)
514     "Set field to list of integers value.
515
516 This function currently on has an effect of OFTIntegerList, OFTInteger64List
517 and OFTRealList fields.
518
519 Parameters:
520     h-feat: handle to the feature that owned the field.
521     i-field: the field to fetch, from 0 to GetFieldCount()-1.
522     values: the values to assign"
523   (%ogr-f-set-field-integer-list h-feat i-field (length values)
524                                  (list->pointer values int)))
525
526 (export set-field-integer-list)
527
528 ;;------------------------------------------------------------------------------
529
530 (define-gdal-foreign %ogr-f-set-field-null
531   void "OGR_F_SetFieldNull" (list '* int) 22)
532
533 (define (set-field-null h-feat i-field)
534     "Clear a field, marking it as null.
535
536 Parameters:
537     h-feat: handle to the feature that owned the field.
538     i-field: the field to fetch, from 0 to GetFieldCount()-1"
539   (%ogr-f-set-field-null h-feat i-field))
540
541 (export set-field-null)
542
543 ;;------------------------------------------------------------------------------
544
545 (define-gdal-foreign %ogr-f-set-field-raw
546   void "OGR_F_SetFieldRaw" (list '* int '*) 20)
547
548 (define (set-field-raw h-feat i-field value)
549     "Set field.
550
551 The passed value OGRField must be of exactly the same type as the target field,
552 or an application crash may occur. The passed value is copied, and will not be
553 affected. It remains the responsibility of the caller.
554
555 Parameters:
556     h-feat: handle to the feature that owned the field.
557     i-field: the field to fetch, from 0 to GetFieldCount()-1.
558     value: handle on the value to assign"
559   (%ogr-f-set-field-raw h-feat i-field value))
560
561 (export set-field-raw)
562
563 ;;------------------------------------------------------------------------------
564
565 (define-gdal-foreign %ogr-f-set-field-string
566   void "OGR_F_SetFieldString" (list '* int '*) 20)
567
568 (define (set-field-string h-feat i-field value)
569     "Set field to string value.
570
571 OFTInteger fields will be set based on an atoi() conversion of the string.
572 OFTInteger64 fields will be set based on an CPLAtoGIntBig() conversion of the
573 string. OFTReal fields will be set based on an CPLAtof() conversion of the
574 string. Other field types may be unaffected.
575
576 Parameters:
577     h-feat: handle to the feature that owned the field.
578     i-field: the field to fetch, from 0 to GetFieldCount()-1.
579     value: string to assign"
580   (%ogr-f-set-field-string h-feat i-field (string->pointer value)))
581
582 (export set-field-string)
583
584 ;;------------------------------------------------------------------------------
585
586 (define-gdal-foreign %ogr-f-set-field-string-list
587   void "OGR_F_SetFieldStringList" (list '* int '*) 20)
588
589 (define (set-field-string-list h-feat i-field lst)
590     "Set field to list of strings value.
591
592 This function currently on has an effect of OFTStringList fields.
593
594 Parameters:
595     h-feat: handle to the feature that owned the field.
596     i-field: the field to fetch, from 0 to GetFieldCount()-1.
597     lst: string list to assign"
598   (%ogr-f-set-field-string-list h-feat i-field (length lst)
599                                 (string-list->pointerpointer lst)))
600
601 (export set-field-string-list)
602
603 ;;------------------------------------------------------------------------------
604
605 (define-gdal-foreign %ogr-f-set-field-date-time
606   void "OGR_F_SetFieldDateTime" (list '* int int int int int int int int) 20)
607
608 (define (set-field-date-time h-feat i-field year month day hour
609                              minute second tz-flag)
610     "Set field to datetime.
611
612 This method currently only has an effect for OFTDate, OFTTime and OFTDateTime
613 fields.
614
615 Parameters:
616     h-feat: handle to the feature that owned the field.
617     i-field: the field to fetch, from 0 to GetFieldCount()-1.
618     year: including century.
619     month: (1-12).
620     day: (1-31).
621     hour: (0-23).
622     minute: (0-59).
623     second: (0-59).
624     tz-flag: 0=unknown, 1=localtime, 100=GMT, see data model for details"
625   (%ogr-f-set-field-date-time h-feat i-field year month day
626                               hour minute second tz-flag))
627
628 (export set-field-date-time)
629
630 ;;------------------------------------------------------------------------------
631
632 (define-gdal-foreign %ogr-f-set-field-date-time-ex
633   void "OGR_F_SetFieldDateTimeEx" (list '* int int int int int
634                                         int float int) 20)
635
636 (define (set-field-date-time-ex h-feat i-field year month day hour
637                               minute second tz-flag)
638     "Set field to datetime.
639
640 This method currently only has an effect for OFTDate, OFTTime and OFTDateTime
641 fields.
642
643 Parameters:
644     h-feat: handle to the feature that owned the field.
645     i-field: the field to fetch, from 0 to GetFieldCount()-1.
646     year: including century.
647     month: (1-12).
648     day: (1-31).
649     hour: (0-23).
650     minute: (0-59).
651     second: (0-59, with millisecond accuracy).
652     tz-flag: 0=unknown, 1=localtime, 100=GMT, see data model for details"
653   (%ogr-f-set-field-date-time-ex h-feat i-field year month day
654                                 hour minute second tz-flag))
655
656 (export set-field-date-time-ex)
657
658 ;;------------------------------------------------------------------------------