Event data acquisition API - mapserv.eventdata
Note
This document has been machine translated.
The event data distribution API can obtain event data that matches the specified conditions.
JSON-RPC v2.0 is used as the execution method.
Supported versions
xData Platform: 1.0 or higher / xData Edge: 1.0 or higher
Common specification of event data
The event data has the following common columns.
| Column Name | Data Type | Details |
|---|---|---|
| start_datetime | timestamp with time zone | Target data start time |
| end_datetime | timestamp with time zone | Target data end time |
| location | geometry | Target data region |
Following these columns, the actual data is stored in columns unique to each event.
Endpoint
https://<api-server-endpoint>/api/v1/evwhapi/jsonrpc
Request Example
{
"jsonrpc": "2.0",
"method": "mapserv.eventdata",
"params": {
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [[
[139.7, 34.9], [139.7, 36.1], [140.9, 36.1],
[140.9, 34.9], [139.7, 34.9]
]]
},
"properties": {
"table": "riskmap.riskmap_probability",
"columns": ["start_datetime", "risk"],
"conds": {
"and": [
{
">=": ["start_datetime", "2020-05-05 13:00:00"]
},
{
"<": ["end_datetime", "2020-05-05 15:00:00"]
}
]
}
}
},
"id": "mapserv_eventdata"
}
Parameter
Request parameters are described in GeoJSON Feature format.
Geometry is a spatial region to be searched for. The type can be Polygon, Line, Point, or Collection of these.
For Properties, specify the following parameters:
| Parameter Name | Data Type | Details | Default Value |
|---|---|---|---|
| table | string | Table name of the event data | Required |
| columns | [string] | List of columns to be retrieved | [] (All columns) |
| conds | object | Conditions for searching records | {} (No condition) |
Output Sample
Return Values
GeoJSON (FeatureCollection) is returned. Each record of event data is stored as a Feature.
Each feature's geometry is the GeoJSON representation of the geom.
In the properties, the table name will be stored in table, and the rest is stored as a set of column names and their values.
Description
The spatial and non-spatial attributes of event data can be obtained by specifying the conditions. Compared to other APIs, complex search conditions can be specified.
- Event data stored in the table specified by
tableis targeted. - The record whose
geomcolumn and thegeometrypart of the request intersects will be obtained. - If
columnsis specified, only the columns are returned. However, thegeomcolumn is always returned as a GeoJSON geometry. - If
condsis specified, records satisfying allgeometryandcondsconditions are returned. condsis written in JsonLogic notation.
The available operators of JsonLogic are as follows:
- {"=":[A,B]} A is equal to B
- {"<>":[A,B]} A is not equal to B
- {">":[A,B]} A is larger than B
- {">=":[A,B]} A is larger than or equal to B
- {"<":[A,B]} A is smaller than B
- {"<=":[A,B]} A is smaller than or equal to B
- {"!":[A]} Not A
- {"and":[A,B,...]} All A,B,... are satisfied
- {"or":[A,B,...]} At least one of A,B,... is satisfied
- {"in":[A,[B]]} A is included in [B]
- {"min":[A]} The minimum value of [A]
- {"max":[A]} The maximum value of [A]
Note: A and B are column name or constants. The string constant same as the column names cannot be specified.
Very large GeoJSONs may be returned if there are many records
that meet the condition, or if the spatial attributes stored in geom
have a complex shape.