This page describes the resource management API's for 3DM Publisher.
Please familiarize yourself with the basics first before continuing.
A Resource models a physical resource, or an abstract resource with children (a resource group).
Properties:
| Property | Required | Type | Description |
|---|---|---|---|
| id | * | number | Unique identifier. |
| name | * | string | User-friendly name of the resource. |
| description | string | Description of the resource. | |
| file | * | string | File system path to the main file of the resource. |
| type | * | string | Type of the resource (usually the file extension). |
| thumbnail_image | string | The resource thumbnail. | |
| tags | string | Tags of the resource, serialized to a string. | |
| is_basemap | number | Is the resource a basemap? (1 is true, 0 is false) | |
| is_dem | number | Is the resource a DEM/Terrain? (1 is true, 0 is false) | |
| is_lref | number | Is the resource a Linear Reference? (1 is true, 0 is false) | |
| resource_metadata | Array<ResourceMetadata> | Metadata of the resource. | |
| resource_link | Array<ResourceLink> | Links to child resources. | |
| created_at | string (ISO 8601) | Date of creation of the resource. | |
| modified_at | string (ISO 8601) | Date of last modification of the resource. | |
| refreshed_at | string (ISO 8601) | Date of last reload of the resource. |
Resource Type is defined by:
type property)content_type metadata field)The most-used Resource Types:
| Resource | Resource Type | Resource Content Type |
|---|---|---|
| Vector Data (ovf) | ovf | - |
| Vector Data (ovt) | ovt | - |
| Vector Data (odb) | odb | - |
| Image (omi) | omi | - |
| Image (otm) | otm | - |
| Point cloud (opc) | opc | - |
| Point cloud (3dtiles) | 3dtiles | pointcloud |
| Mapping Resource (mobile) | omr | - |
| Mapping Resource (oblique) | omr | oblique |
| Mapping Resource (aerial) | omr | uas |
| … |
Possible values for Resource status:
ready- File is ready for use.missing - File was not found on the filesystem.
Properties ending on _image are Base64-encoded JPEG images on create, but will be URL's to the image cache on retrieval.
A Resource Group is also just a Resource object.
It has the following defining characteristics:
file set to file.omp (for Mapping Resource) or file.ogp (for all other types).type set to omp (for Mapping Resource) or ogp (for all other types).group_child_type metadata field set to the child resource typegroup_child_content_type metadata field set to the child resource content_type
The Resource Group Type is defined by the group_child_type and group_child_content_type metadata fields.
| Property | Type | Description |
|---|---|---|
| name | string | Name of this metadata field. |
| value | string | Value of the metadata field. |
| Property | Type | Description |
|---|---|---|
| child_resource | Resource | Reference to the child resource (only the id field is required). |
This operation retrieves all resources and resource groups.
Fields: see Model: Resource
GET /api/3/resource
[ { "id": 14, "name": "BE Project", "storage_space": { "id": 1 }, "file": "D:/Data/Run/orbit_mm_run.omr", "type": "omr", "num_bytes": 110, "created_at": "2022-01-03 10:00:32", "modified_at": "2023-04-25 07:21:19", "refreshed_at": "2023-04-25 07:21:19", "status": "ready", "tags": "[]", "is_basemap": 0, "is_dem": 0, "is_lref": 0, "resource_metadata": [ { "name": "panorama_timestamp", "value": "false" }, { "name": "pointcloud_intensity", "value": "false" }, { "name": "dtm_available", "value": "false" }, { "name": "planar_timestamp", "value": "false" }, { "name": "pointcloud_timestamp", "value": "false" }, { "name": "trajectory_timestamp", "value": "false" }, { "name": "pointcloud_rgb", "value": "false" }, { "name": "ortho_available", "value": "false" }, { "name": "mesh_available", "value": "false" } ] }, ... ]
Fields: see Model: Resource
POST /api/3/resource
{ "name": "test", "file": "test" }
{ "id": 199, "name": "test", "storage_space": { "id": 1 }, "file": "test", "type": "", "created_at": "2024-11-27 09:29:37", "modified_at": "2024-11-27 09:29:37", "refreshed_at": "2024-11-27 09:29:37", "status": "missing", "tags": "[]", "is_basemap": 0, "is_dem": 0, "is_lref": 0 }
The following fields can be updated:
Fields: see Model: Resource
POST /api/3/resource/151
{ "name": "BEGE MM06 test" }
No content
When deleting a resource, it is also removed from all resource groups and publications.
DELETE /api/3/resource/151
No content
{ "code": "not_found", "message": "Resource with id '151' was not found." }
Creating a resource group is similar to creating a Resource.
To create a resource group, you need to specify the correct properties. See Model: Resource Group for more information on these requirements.
Resource Type of child resources that are added, must match the Resource Group Type.Fields: Model: Resource
POST /api/3/resource
{ "name": "Test", "file": "file.omp", "type": "omp", "tags": "[]", "resource_metadata": [ { "name": "collection_start", "value": "2024-11-27" }, { "name": "collection_stop", "value": "2024-11-28" }, { "name": "group_child_type", "value": "omr" }, { "name": "group_child_content_type", "value": "oblique" } ], "resource_link": [ { "child_resource": { "id": 15 } }, { "child_resource": { "id": 157 } } ] }
{ "id": 200, "name": "Test", "storage_space": { "id": 1 }, "file": "file.omp", "type": "omp", "created_at": "2024-11-27 09:32:57", "modified_at": "2024-11-27 09:32:57", "refreshed_at": "2024-11-27 09:32:57", "status": "ready", "tags": "[]", "is_basemap": 0, "is_dem": 0, "is_lref": 0, "is_wfs": 0, "is_wms": 0, "resource_metadata": [ { "name": "group_child_type", "value": "omr" }, { "name": "collection_stop", "value": "2024-11-28" }, { "name": "group_child_content_type", "value": "" }, { "name": "collection_start", "value": "2024-11-27" } ] }
Updating a resource group is the same as Operation: Update Resource so all the same fields can be updated.
Specific to a Resource Group are :
Resource Group Type is set by updating specific properties and metadata types as described in Model: Resource Group.Resource Type that matches the Resource Group Type.
Fields: Model: Resource
Fields: Model: Resource Group
Fields: Model: Resource Link
POST /api/3/resource/123
{ "resource_link": [ { "child_resource": { "id": 15 } }, { "child_resource": { "id": 157 } } ] }
No content
Deleting a resource group is the same as Operation: Delete Resource.
This operation will check if a resource exists on disk and update dynamic fields and metadata.
num_bytesstatusresource_metadata from the metadata.xml file, when it exists.resource_metadata by merging metadata of the child resources.
GET /api/3/resource/[resourceId]/refresh
No content