dm_geojson Module

Contains subroutines to convert derived types to GeoJSON format (RFC 7946).


Uses

  • module~~dm_geojson~~UsesGraph module~dm_geojson dm_geojson module~dm_ascii dm_ascii module~dm_geojson->module~dm_ascii module~dm_error dm_error module~dm_geojson->module~dm_error module~dm_json dm_json module~dm_geojson->module~dm_json module~dm_kind dm_kind module~dm_geojson->module~dm_kind module~dm_string dm_string module~dm_geojson->module~dm_string module~dm_type dm_type module~dm_geojson->module~dm_type module~dm_util dm_util module~dm_geojson->module~dm_util module~dm_error->module~dm_ascii module~dm_error->module~dm_kind module~dm_json->module~dm_error module~dm_json->module~dm_kind module~dm_json->module~dm_util module~dm_dp dm_dp module~dm_json->module~dm_dp iso_fortran_env iso_fortran_env module~dm_kind->iso_fortran_env module~dm_string->module~dm_error module~dm_string->module~dm_kind module~dm_util->module~dm_error module~dm_util->module~dm_kind module~dm_dp->module~dm_error module~dm_dp->module~dm_kind module~dm_time dm_time module~dm_dp->module~dm_time module~dm_time->module~dm_error module~dm_time->module~dm_kind module~dm_time->module~dm_util unix unix module~dm_time->unix

Used by

  • module~~dm_geojson~~UsedByGraph module~dm_geojson dm_geojson module~dmpack dmpack module~dmpack->module~dm_geojson

Interfaces

Generic derived type add to GeoJSON Feature Collection functions.

  • private function geojson_feature_collection_add_node(collection, node) result(rc)

    Adds node to GeoJSON Feature Collection.

    The function returns the following error codes:

    • E_BOUNDS if collection is full.
    • E_INVALID if collection has not been created.

    Arguments

    Type IntentOptional Attributes Name
    type(geojson_feature_collection_type), intent(inout) :: collection

    GeoJSON Feature Collection type.

    type(node_type), intent(inout) :: node

    Node type.

    Return Value integer

  • private function geojson_feature_collection_add_sensor(collection, sensor) result(rc)

    Adds sensor to GeoJSON Feature Collection.

    The function returns the following error codes:

    • E_BOUNDS if collection is full.
    • E_INVALID if collection has not been created.

    Arguments

    Type IntentOptional Attributes Name
    type(geojson_feature_collection_type), intent(inout) :: collection

    GeoJSON Feature Collection type.

    type(sensor_type), intent(inout) :: sensor

    Sensor type.

    Return Value integer

  • private function geojson_feature_collection_add_target(collection, target) result(rc)

    Adds target to GeoJSON Feature Collection.

    The function returns the following error codes:

    • E_BOUNDS if collection is full.
    • E_INVALID if collection has not been created.

    Arguments

    Type IntentOptional Attributes Name
    type(geojson_feature_collection_type), intent(inout) :: collection

    GeoJSON Feature Collection type.

    type(target_type), intent(inout) :: target

    Target type.

    Return Value integer

public interface dm_geojson_from

Generic derived type to GeoJSON serialisation functions.

  • private function geojson_from_node(node) result(geojson)

    Returns node as allocatable string in GeoJSON format.

    Arguments

    Type IntentOptional Attributes Name
    type(node_type), intent(inout) :: node

    Node type.

    Return Value character(len=:), allocatable

    GeoJSON string.

  • private function geojson_from_sensor(sensor) result(geojson)

    Returns sensor as allocatable string in GeoJSON format.

    Arguments

    Type IntentOptional Attributes Name
    type(sensor_type), intent(inout) :: sensor

    Sensor type.

    Return Value character(len=:), allocatable

    GeoJSON string.

  • private function geojson_from_target(target) result(geojson)

    Returns target as allocatable string in GeoJSON format.

    Arguments

    Type IntentOptional Attributes Name
    type(target_type), intent(inout) :: target

    Target type.

    Return Value character(len=:), allocatable

    GeoJSON string.

public interface dm_geojson_write

Generic derived type to GeoJSON writer.

  • private function geojson_write_node(node, unit) result(rc)

    Writes node to file or standard output.

    Arguments

    Type IntentOptional Attributes Name
    type(node_type), intent(inout) :: node

    Node type.

    integer, intent(in), optional :: unit

    File unit.

    Return Value integer

  • private function geojson_write_sensor(sensor, unit) result(rc)

    Writes sensor to file or standard output.

    Arguments

    Type IntentOptional Attributes Name
    type(sensor_type), intent(inout) :: sensor

    Sensor type.

    integer, intent(in), optional :: unit

    File unit.

    Return Value integer

  • private function geojson_write_target(target, unit) result(rc)

    Writes target to file or standard output.

    Arguments

    Type IntentOptional Attributes Name
    type(target_type), intent(inout) :: target

    Target type.

    integer, intent(in), optional :: unit

    File unit.

    Return Value integer


Derived Types

type, public ::  geojson_feature_collection_type

Opaque GeoJSON Feature Collection type.


Functions

public function dm_geojson_feature_collection(collection) result(geojson)

Returns GeoJSON Feature Collection as GeoJSON string.

Arguments

Type IntentOptional Attributes Name
type(geojson_feature_collection_type), intent(inout) :: collection

GeoJSON Feature Collection type.

Return Value character(len=:), allocatable

GeoJSON string.

public function dm_geojson_feature_collection_create(collection, max_size) result(rc)

Creates new GeoJSON Feature Collection if given maximum size.

Read more…

Arguments

Type IntentOptional Attributes Name
type(geojson_feature_collection_type), intent(out) :: collection

GeoJSON Feature Collection type.

integer, intent(in) :: max_size

Max. size of Feature Collection.

Return Value integer

public function dm_geojson_feature_point(type, longitude, latitude, elevation, json) result(geojson)

Returns GeoJSON feature point of given DMPACK type, longitude, latitude, elevation, and type properties in JSON. The returned allocatable string is of the following form:

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: type

Point type (TYPE_NODE, TYPE_SENSOR, TYPE_TARGET).

real(kind=r8), intent(in) :: longitude

Point longitude (decimal).

real(kind=r8), intent(in) :: latitude

Point latitude (decimal).

real(kind=r8), intent(in) :: elevation

Point elevation.

character(len=*), intent(in) :: json

Point JSON data.

Return Value character(len=:), allocatable

GeoJSON string.


Subroutines

public subroutine dm_geojson_feature_collection_destroy(collection)

Destroys GeoJSON Feature Collection.

Arguments

Type IntentOptional Attributes Name
type(geojson_feature_collection_type), intent(inout) :: collection

GeoJSON Feature Collection type.