MCPcopy Create free account
hub / github.com/GenericMappingTools/gmt / main

Function main

src/testapi_putvector.c:10–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#define NROWS 2
9
10int main () {
11 void *API = NULL; /* The API control structure */
12 struct GMT_VECTOR *V = NULL; /* Structure to hold input dataset as vectors */
13
14 uint64_t dim[4] = {NCOLS, NROWS, 1, 0}; /* ncols, nrows, nlayers, type */
15 /* two records with cartesian, time, lon, lat data */
16 char *S0[NROWS] = {"134.9", "202"};
17 char *S1[NROWS] = {"2020-06-01T14:55:33", "2020-06005T16:00:50.75"};
18 char *S2[NROWS] = {"12:45:36W", "19:48E"};
19 char *S3[NROWS] = {"16:15:00S", "29:30N"};
20
21 /* Initialize the GMT session */
22 API = GMT_Create_Session ("testapi_putvector", 2U, GMT_SESSION_EXTERNAL, NULL);
23 /* Create a dataset */
24 V = GMT_Create_Data (API, GMT_IS_VECTOR, GMT_IS_POINT, GMT_CONTAINER_ONLY, dim, NULL, NULL, 0, 0, NULL);
25 /* Hook the five converted text vectors up to this container */
26 GMT_Put_Vector(API, V, 0, GMT_TEXT|GMT_DOUBLE, S0);
27 GMT_Put_Vector(API, V, 1, GMT_TEXT|GMT_LONG, S1);
28 GMT_Put_Vector(API, V, 2, GMT_TEXT|GMT_DOUBLE, S2);
29 GMT_Put_Vector(API, V, 3, GMT_TEXT|GMT_DOUBLE, S3);
30 /* Write table to stdout */
31 GMT_Write_Data (API, GMT_IS_VECTOR, GMT_IS_FILE, GMT_IS_POINT, GMT_WRITE_SET, NULL, NULL, V);
32 /* Destroy the GMT session */
33 GMT_Destroy_Session (API);
34};

Callers

nothing calls this directly

Calls 5

GMT_Create_SessionFunction · 0.85
GMT_Create_DataFunction · 0.85
GMT_Put_VectorFunction · 0.85
GMT_Write_DataFunction · 0.85
GMT_Destroy_SessionFunction · 0.85

Tested by

no test coverage detected