Panoramas API
Panoramas API documentation. This API is used in the panorama and point cloud viewer of the geoportal and MapiaStreets.
Model
Campaigns
The mapia_panoramas_project table defines different Mobile Mapping campaigns. For example, Panoramas 2018, Panoramas 2020, etc.
Field | Definition |
---|---|
id | Autogenerated ID |
code | Campaign code, for example, pano-2020 |
name | Campaign name, for example, Panoramas 2020 |
Panoramas
The mapia_panoramas_panorama table contains all the information about the panoramas:
Field | Definition |
---|---|
id | Autogenerated ID |
file_name | Image name. If the full path is provided (starts with http), it directly accesses the image. Otherwise, it goes to the default directory and adds the path. Example: https://(…)/apps/giscube-admin/plugins/mapia_panoramas/files/(file_folder)/file_name |
file_type | Image type (extension) |
file_folder | Directory where the images are located. If the full path is provided (starts with http), it directly accesses the image. Otherwise, it goes to the default directory and adds the path. Example: https://(…)/apps/giscube-admin/plugins/mapia_panoramas/files/file_folder |
source_id | User-defined ID, can be used for sorting panoramas |
date | Date and time of the panorama capture |
altitude | Altitude above sea level of the panorama |
roll | Angle with respect to the longitudinal axis |
pitch | Angle with respect to the transversal axis |
pan | Angle with respect to the vertical axis (orientation with the north) |
geom | Geometry, coordinates of the point |
project_id | Project defined in the mapia_panoramas_project table, where different MoMa campaigns are defined, for example |
category | String to define a category, for example, different floors of a building |
Laterals
The mapia_panoramas_lateral table contains all the information about the lateral images:
Field | Definition |
---|---|
id | Autogenerated ID |
file_name | Image name. If the full path is provided (starts with http), it directly accesses the image. Otherwise, it goes to the default directory and adds the path. Example: https://(…)/apps/giscube-admin/plugins/mapia_panoramas/files/(file_folder)/file_name |
file_folder | Directory where the images are located. If the full path is provided (starts with http), it directly accesses the image. Otherwise, it goes to the default directory and adds the path. Example: https://(…)/apps/giscube-admin/plugins/mapia_panoramas/files/file_folder |
file_type | Image type (extension) |
pan | Orientation of the image with respect to the North |
panorama_id | ID of the panorama to which it belongs |
Point Clouds
The mapia_panoramas_pointcloud table contains all the information about the point clouds on the server:
Field | Definition |
---|---|
id | Autogenerated ID |
code | Descriptive code of the point cloud |
name | Point cloud name |
file_folder | Directory where the point clouds are located |
geom | Geometry, polygon containing the point cloud |
project_id | Project defined in the mapia_panoramas_project table, where different MoMa campaigns are defined, for example |
Local Point Clouds
The mapia_panoramas_localpointcloud table contains all the information about the local point clouds:
Field | Definition |
---|---|
id | Autogenerated ID |
code | Descriptive code of the point cloud |
name | Point cloud name |
file_folder | Directory where the local point clouds are located |
geom | Geometry, polygon containing the point cloud |
project_id | Project defined in the mapia_panoramas_project table, where different MoMa campaigns are defined, for example |
Authentication
This is a public API, no authentication is required.
Endpoints
The panorama project is treated as an external module to giscube-admin, so it will be added as a plugin. There is an endpoint to retrieve the defined campaigns. For each campaign, there are endpoints to get the panoramas, point clouds on the server (currently not used), and local point clouds.
Campaigns
Endpoint that returns all the defined campaigns.
URL
|||| |-------|-------
"results": [
{
"code": "pano-2020",
"name":"Panorames 2020",
"description":null,
"zone":null,
"date_start":null,
"date_end":null,
"folder_panorama":"pano-2020",
"folder_images":"pano-2020",
"folder_point_cloud":null,
"layer_panorama":null
},
{...}
]
Panoramas
The panoramas endpoint depends on the campaign in which we want to perform the search (by entering the campaign code in the URL). Panoramas are obtained based on a coordinate and a search radius.
URL
Endpoint | plugins/mapia_panoramas/api/projects/{code}/panoramas/ | |
Example | https://xxxxxxx.xxxxxxx.xxx/apps/giscube-admin/plugins/mapia_panoramas/api/projects/pano/panoramas/ |
Parameters
The search parameters for this API are as follows:
Parameter | Definition | Required | Example |
---|---|---|---|
p | Coordinates (lat, lng) of the point we are searching for | * | p=41.3997,2.1133 |
r | Search radius in meters | * | r=15 |
c | Search those that have the same category | c=planta_1 |
The API returns all the panoramas that are within the search radius (r), sorted by distance from the point (p).
Example | https://xxxxxxx.xxxxxxx.xxx/apps/giscube-admin/plugins/mapia_panoramas/api/projects/pano-2020/panoramas/?p=41.47379866069745,2.089445418340398&r=15 |
Result
[
{
"id": 11596,
"project": "pano-2020",
"category": null,
"file_name": "Track_C-Sphere-144.jpg",
"file_type": null,
"file_folder": "201028",
"source_id": 11596,
"date": "2020-10-28T07:01:13Z",
"altitude": 122.654,
"roll": -358.432473,
"pitch": 4.585543,
"pan": -93.647597,
"geom": {
"type": "Point",
"coordinates":[
2.089445418340398,
41.47379866069745
]
},
"laterals": [
{
"file_name": "Track_C-CAM1-144_2020.10.28_08.01.13(278).jpg",
"file_type": null,
"file_folder": "201028/Track_C01",
"pan": -48.647597000000005
},
{...},
{...}
]
},
{...},
{...}
]
Point Clouds (currently not used)
Endpoint that returns the point clouds that are located at a specific coordinate.
URL
Endpoint | plugins/mapia_panoramas/api/projects/{code}/point_cloud/ | |
Example | https://xxxxxxx.xxxxxxx.xxx/apps/giscube-admin/plugins/mapia_panoramas/api/projects/pano-2020/point_cloud/ |
Parameters
The search parameters for this API are as follows:
Parameter | Definition | Required | Example |
---|---|---|---|
p | Coordinates (lat, lng) of the point we are searching for | * | p=41.3997,2.1133 |
The API returns all the point clouds that contain the specified coordinate (the polygons that contain the point).
Result
The result is an array with the defined campaigns.
"results": [
{
"id": '',
"project": '',
"code": '',
"name": '',
"file_folder": '',
"geom" '':
},
{...}
]
Local Point Clouds
Endpoint that returns the local point clouds that are located at a specific coordinate.
URL
Endpoint | plugins/mapia_panoramas/api/projects/{code}/local_point_cloud/ | |
Example | https://xxxxxxx.xxxxxxx.xxx/apps/giscube-admin/plugins/mapia_panoramas/api/projects/pano-2020/local_point_cloud/ |
Parameters
The search parameters for this API are as follows:
Parameter | Definition | Required | Example |
---|---|---|---|
p | Coordinates (lat, lng) of the point we are searching for | * | p=41.3997,2.1133 |
The API returns all the local point clouds that contain the specified coordinate (the polygons that contain the point).
Result
The result is an array with the defined campaigns.
"results": [
{
"id": '',
"project": '',
"code": '',
"name": '',
"file_folder": '',
"geom" '':
},
{...}
]