Create a BUFR handle from a file resource.
The file is read until a BUFR message is found. The message is then copied.
Remember always to delete the handle when it is not needed anymore to avoid
memory leaks.
Create a handle from a BUFR message contained in a samples directory.
The message is copied at the creation of the handle
Frees the cached definition files of the context
Get the static default context
Sets the search path for definition files.
Sets the search path for sample files.
Copy the keys belonging to a given namespace from a source handle to a destination handle
\defgroup codes_handle The message handle
The codes_handle is the structure giving access to parsed message values by keys.
Counts the messages contained in a file resource.
Counts the messages contained in a file.
Print all keys from the parsed definition files available in a context
Print all keys, with the context print procedure and dump mode to a resource
Get raw bytes values from a key. If several keys of the same name are present, the last one is returned
@see codes_set_bytes
Get a double value from a key, if several keys of the same name are present, the last one is returned
@see codes_set_double
Get double array values from a key. If several keys of the same name are present, the last one is returned
@see codes_set_double_array
Get as double the i-th element of the “key” array
Get as double array the elements of the “key” array whose indexes are listed in the input array i
Convert an error code into a string
@param code : the error code
@return the error message
Get the Git version control SHA1 identifier
Get the length of the string representation of the key, if several keys of the same name are present, the maximum length is returned
Get a long value from a key, if several keys of the same name are present, the last one is returned
@see codes_set_long
Get long array values from a key. If several keys of the same name are present, the last one is returned
@see codes_set_long_array
\defgroup handling_coded_messages Handling coded messages */
getting the message attached to a handle
getting a copy of the message attached to a handle
\defgroup get_set Accessing header and data values */
Get the number offset of a key, in a message if several keys of the same name
are present, the offset of the last one is returned
Get the number of coded value from a key, if several keys of the same name are present, the total sum is returned
Get a string value from a key, if several keys of the same name are present, the last one is returned
@see codes_set_string
Get string array values from a key. If several keys of the same name are present, the last one is returned
@see codes_set_string_array
Get latitude/longitude and data values.
The Latitudes, longitudes and values arrays must be properly allocated by the caller.
Their required dimension can be obtained by getting the value of the integer key “numberOfPoints”.
Create a GRIB handle from a file resource.
The file is read until a GRIB message is found. The message is then copied.
Remember always to delete the handle when it is not needed anymore to avoid
memory leaks.
Create a handle from a user message in memory. The message will not be freed at the end.
The message will be copied as soon as a modification is needed.
This function works also with multi-field messages.
Create a handle from a GRIB message contained in the samples directory.
The message is copied at the creation of the handle
Frees the geoiterator from memory.
Test procedure for values in a geoiterator.
\brief Create a new geoiterator from a GRIB handle, using current geometry and values.
Get the next value from a geoiterator.
Get the previous value from a geoiterator.
Test procedure for values in a geoiterator.
Append the sections starting with start_section of the message pointed by h at
the end of the multi-field GRIB handle mh.
This is only applicable to GRIB edition 2.
Remember always to delete the multi-handle when it is not needed any more to avoid
memory leaks.
Delete multi-field GRIB handle.
This is only applicable to GRIB edition 2.
Create an empty multi-field GRIB handle.
This is only applicable to GRIB edition 2.
Remember always to delete the multi-handle when it is not needed any more to avoid
memory leaks.
Write a multi-field GRIB handle in a file.
This is only applicable to GRIB edition 2.
Remember always to delete the multi-handle when it is not needed any more to avoid
memory leaks.
Turn off support for multi-fields in single GRIB messages
Turn on support for multi-fields in single GRIB messages
Reset file handle in multiple GRIB field support mode
Frees an nearest from memory
Find the 4 nearest points of a latitude longitude point.
The flags are provided to speed up the process of searching. If you are
sure that the point you are asking for is not changing from a call
to another you can use CODES_NEAREST_SAME_POINT. The same is valid for
the grid. Flags can be used together doing a bitwise OR.
The distances are given in kilometres.
Find the nearest point of a set of points whose latitudes and longitudes
are given in the inlats, inlons arrays respectively.
If the flag is_lsm is 1 the nearest land point is returned and the
GRIB passed as handle (h) is considered a land sea mask.
The land nearest point is the nearest point with land sea mask value>=0.5.
If no nearest land points are found the nearest value is returned.
If the flag is_lsm is 0 the nearest point is returned.
values, distances, indexes (in the “values” array) for the nearest points (ilons,ilats)
are returned.
The distances are given in kilometres.
\brief Create a new nearest neighbour object from a handle, using current geometry.
Set the GRIBEX mode off.
GRIB files won’t be always compatible with GRIBEX.
Set the GRIBEX mode on.
GRIB files will be compatible with GRIBEX.
Set the GTS header mode off.
The GTS headers will be deleted.
Set the GTS header mode on.
The GTS headers will be preserved.
Clone an existing handle using the context of the original handle,
The message is copied and reparsed
Frees a handle, also frees the message if it is not a user message
@see codes_handle_new_from_message
@param h : The handle to be deleted
@return 0 if OK, integer value on error
Create a handle from a file resource.
The file is read until a message is found. The message is then copied.
Remember always to delete the handle when it is not needed anymore to avoid
memory leaks.
Create a new handle from an index after having selected the key values.
All the keys belonging to the index must be selected before calling this function. Successive calls to this function will return all the handles compatible with the constraints defined selecting the values of the index keys.
When no more handles are available from the index a NULL pointer is returned and the err variable is set to CODES_END_OF_INDEX.
Create a handle from a user message in memory. The message will not be freed at the end.
The message will be copied as soon as a modification is needed.
Create a handle from a user message. The message is copied and will be freed with the handle
Indexes the file given in argument in the index given in argument.
Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as double or when the native type of the key is double.
Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as long or when the native type of the key is long.
Get the number of distinct values of the key in argument contained in the index. The key must belong to the index.
Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as string or when the native type of the key is string.
Create a new index based on a set of keys.
Create a new index form a file. The file is indexed with the keys in argument.
Select the message subset with key==value. The value is a double. The key must have been created with double type or have double as native type if the type was not explicitly defined in the index creation.
Select the message subset with key==value. The value is a long. The key must have been created with long type or have long as native type if the type was not explicitly defined in the index creation.
Select the message subset with key==value. The value is a string. The key must have been created with string type or have string as native type if the type was not explicitly defined in the index creation.
Delete the keys iterator.
@param kiter : valid codes_keys_iterator
@return 0 if OK, integer value on error
get the key name from the keys iterator
@param kiter : valid codes_keys_iterator
@return key name
\defgroup keys_iterator Iterating on keys names
The keys iterator is designed to get the key names defined in a message.
Key names on which the iteration is carried out can be filtered through their
attributes or by the namespace they belong to.
@param h : the handle whose keys you want to iterate
@param filter_flags : flags to filter out some of the keys through their attributes
@param name_space : if not null the iteration is carried out only on
keys belonging to the namespace passed. (NULL for all the keys)
@return keys iterator ready to iterate through keys according to filter_flags
and namespace
Step to the next item from the keys iterator.
@param kiter : valid codes_keys_iterator
@return 1 if next iterator exists, 0 if no more elements to iterate on
Rewind the keys iterator.
@param kiter : valid codes_keys_iterator
@return 0 if OK, integer value on error
Set a bytes array from a key. If several keys of the same name are present, the last one is set
@see codes_get_bytes
Set a double value from a key. If several keys of the same name are present, the last one is set
@see codes_get_double
Set a double array from a key. If several keys of the same name are present, the last one is set
@see codes_get_double_array
Same as codes_set_double_array but allows setting of READ-ONLY keys like codedValues.
Use with great caution!!
Set a long value from a key. If several keys of the same name are present, the last one is set
@see codes_get_long
Set a long array from a key. If several keys of the same name are present, the last one is set
@see codes_get_long_array
Set a string value from a key. If several keys of the same name are present, the last one is set
@see codes_get_string
Set a string array from a key. If several keys of the same name are present, the last one is set
@see codes_get_long_array
Write a coded message to a file.
Frees the cached definition files of the context
Get the static default context
Sets memory procedures of the context for large buffers
Sets the search path for definition files.
Sets the context logging procedure used for system (warning, errors, infos …) messages
Sets memory procedures of the context
Sets memory procedures of the context for persistent data
Sets the context printing procedure used for user interaction
Sets the search path for sample files.
Copy the keys belonging to a given namespace from a source handle to a destination handle
\defgroup grib_handle The grib_handle
The grib_handle is the structure giving access to parsed grib values by keys.
Counts the messages contained in a file resource.
Counts the messages contained in a file.
Print all keys from the parsed definition files available in a context
Print all keys, with the context print procedure and dump mode to a resource
Get raw bytes values from a key. If several keys of the same name are present, the last one is returned
@see grib_set_bytes
Get latitude/longitude and data values.
The Latitudes, longitudes and values arrays must be properly allocated by the caller.
Their required dimension can be obtained by getting the value of the integer key “numberOfPoints”.
Get a double value from a key, if several keys of the same name are present, the last one is returned
@see grib_set_double
Get double array values from a key. If several keys of the same name are present, the last one is returned
@see grib_set_double_array
Get as double the i-th element of the “key” array
Get as double array the elements of the “key” array whose indexes are listed in the input array i
Convert an error code into a string
@param code : the error code
@return the error message
Get the Git version control SHA1 identifier
Get the length of the string representation of the key, if several keys of the same name are present, the maximum length is returned
Get a long value from a key, if several keys of the same name are present, the last one is returned
@see grib_set_long
Get long array values from a key. If several keys of the same name are present, the last one is returned
@see grib_set_long_array
\defgroup handling_coded_messages Handling coded messages */
getting the message attached to a handle
getting a copy of the message attached to a handle
\defgroup get_set Accessing header and data values */
Get the number offset of a key, in a message if several keys of the same name
are present, the offset of the last one is returned
Get the number of coded value from a key, if several keys of the same name are present, the total sum is returned
Get a string value from a key, if several keys of the same name are present, the last one is returned
@see grib_set_string
Get string array values from a key. If several keys of the same name are present, the last one is returned
@see grib_set_string_array
Set the GRIBEX mode off.
GRIB files won’t be always compatible with GRIBEX.
Set the GRIBEX mode on.
Grib files will be compatible with GRIBEX.
Set the GTS header mode off.
The GTS headers will be deleted.
Set the GTS header mode on.
The GTS headers will be preserved.
Clone an existing handle using the context of the original handle,
The message is copied and reparsed
Frees a handle, also frees the message if it is not a user message
@see grib_handle_new_from_message
@param h : The handle to be deleted
@return 0 if OK, integer value on error
Create a handle from a file resource.
The file is read until a message is found. The message is then copied.
Remember always to delete the handle when it is not needed anymore to avoid
memory leaks.
Create a new handle from an index after having selected the key values.
All the keys belonging to the index must be selected before calling this function. Successive calls to this function will return all the handles compatible with the constraints defined selecting the values of the index keys.
When no more handles are available from the index a NULL pointer is returned and the err variable is set to GRIB_END_OF_INDEX.
Create a handle from a user message in memory. The message will not be freed at the end.
The message will be copied as soon as a modification is needed.
Create a handle from a user message. The message is copied and will be freed with the handle
Create a handle from a user message in memory. The message will not be freed at the end.
The message will be copied as soon as a modification is needed.
This function works also with multi-field messages.
Note: The data pointer argument may be modified
Create a handle from a GRIB message contained in the samples directory.
The message is copied at the creation of the handle
Indexes the file given in argument in the index given in argument.
Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as double or when the native type of the key is double.
Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as long or when the native type of the key is long.
Get the number of distinct values of the key in argument contained in the index. The key must belong to the index.
Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as string or when the native type of the key is string.
Create a new index based on a set of keys.
Create a new index form a file. The file is indexed with the keys in argument.
Select the message subset with key==value. The value is a double. The key must have been created with double type or have double as native type if the type was not explicitly defined in the index creation.
Select the message subset with key==value. The value is a long. The key must have been created with long type or have long as native type if the type was not explicitly defined in the index creation.
Select the message subset with key==value. The value is a string. The key must have been created with string type or have string as native type if the type was not explicitly defined in the index creation.
Frees a geoiterator from memory
Test procedure for values in a geoiterator.
\brief Create a new geoiterator from a handle, using current geometry and values.
Get the next value from a geoiterator.
Get the previous value from a geoiterator.
Test procedure for values in a geoiterator.
Delete the iterator.
@param kiter : valid grib_keys_iterator
@return 0 if OK, integer value on error
get the key name from the iterator
@param kiter : valid grib_keys_iterator
@return key name
\defgroup keys_iterator Iterating on keys names
The keys iterator is designed to get the key names defined in a message.
Key names on which the iteration is carried out can be filtered through their
attributes or by the namespace they belong to.
@param h : the handle whose keys you want to iterate
@param filter_flags : flags to filter out some of the keys through their attributes
@param name_space : if not null the iteration is carried out only on
keys belonging to the namespace passed. (NULL for all the keys)
@return keys iterator ready to iterate through keys according to filter_flags
and namespace
Step to the next iterator.
@param kiter : valid grib_keys_iterator
@return 1 if next iterator exists, 0 if no more elements to iterate on
Rewind the iterator.
@param kiter : valid grib_keys_iterator
@return 0 if OK, integer value on error
Append the sections starting with start_section of the message pointed by h at
the end of the multi-field handle mh.
Remember always to delete the multi handle when it is not needed anymore to avoid
memory leaks.
Delete multi-field handle.
Create an empty multi-field handle.
Remember always to delete the multi handle when it is not needed anymore to avoid
memory leaks.
Write a multi-field handle in a file.
Remember to delete the multi handle when it is not needed anymore to avoid
memory leaks.
Turn off support for multi-fields in single GRIB messages
Turn on support for multi-fields in single GRIB messages
Reset file handle in multi-field support mode
Frees a nearest neighbour object from memory
Find the 4 nearest points of a latitude longitude point.
The flags are provided to speed up the process of searching. If you are
sure that the point you are asking for is not changing from a call
to another you can use GRIB_NEAREST_SAME_POINT. The same is valid for
the grid. Flags can be used together doing a bitwise OR.
The distances are given in kilometres.
Find the nearest point of a set of points whose latitudes and longitudes
are given in the inlats, inlons arrays respectively.
If the flag is_lsm is 1 the nearest land point is returned and the
GRIB passed as handle (h) is considered a land sea mask.
The land nearest point is the nearest point with land sea mask value>=0.5.
If no nearest land points are found the nearest value is returned.
If the flag is_lsm is 0 the nearest point is returned.
values, distances, indexes (in the “values” array) for the nearest points (ilons,ilats)
are returned.
The distances are given in kilometres.
\brief Create a new nearest neighbour object from a handle, using current geometry.
Set a bytes array from a key. If several keys of the same name are present, the last one is set
@see grib_get_bytes
Set a double value from a key. If several keys of the same name are present, the last one is set
@see grib_get_double
Set a double array from a key. If several keys of the same name are present, the last one is set
@see grib_get_double_array
Same as grib_set_double_array but allows setting of READ-ONLY keys like codedValues.
Use with great caution!!
Set a long value from a key. If several keys of the same name are present, the last one is set
@see grib_get_long
Set a long array from a key. If several keys of the same name are present, the last one is set
@see grib_get_long_array
Set a string value from a key. If several keys of the same name are present, the last one is set
@see grib_get_string
Set a string array from a key. If several keys of the same name are present, the last one is set
@see grib_get_string_array
Write a coded message in a file.