The "importtops" web service imports a CSV well top into the specified datasource.
A typical URL is http://myserver.mycompany.com:8080/INTGeoServer/api/ds/{datasourcetype}/v1/sources/{datasource}/tops/import with the POST method.
where
datasourcetype: type of a datasource, i.e. mongo, s3, etc.
datasource: unique id of a datasource
The following parameters are available:
importoptions : a JSON object representing import options. The following parameters are available:
topSetName: is the name of well top set to import a well top into (can be either existing or a new top set).
delimiter is the character delimiter, if not specified then "," will be used (does not work with 'whitespace and tab' option)
headerNameRow is the 1 based index of row where header first appears. This is an optional parameter.
dataValuesRow is the 1 based index of row where data first appears
tableName is the name of a well table. This is an optional parameter. The default is the name of the file.
overwrite indicates whether to override an existing well table. If overwrite is false and a well table already exists then an error will be thrown. This is an optional parameter. The default is false.
columnmappings : a JSON array representing well top data. The following parameters are available:
columnIndex is the 1 based index of column
mappingID is the column mappings id.
type is the data type of a column: string, double, long or date. This is an optional paramter.
unit: is a unit of measurement of a column. This is an optional parameter.
file: a file containing a being imported well table. This is required parameter.
An example import is shown below (pass multipart/form-data as Content-Type):
importoptions:
{
"topSetName": "TopSet5050",
"overwrite": true,
"headerNameRow": 1,
"dataValuesRow": 3,
"delimiter": ","
}
columnmappings:
[
{
"mappingID": "index",
"columnIndex": 1,
"dataType": "double",
"unit": "m"
},
{
"mappingID": "topName",
"columnIndex": 2,
"dataType": "string"
},
{
"mappingID": "wellName",
"columnIndex": 3,
"dataType": "string"
},
{
"mappingID": "xCoordinate",
"columnIndex": 4,
"dataType": "double"
},
{
"mappingID": "yCoordinate",
"columnIndex": 5,
"dataType": "double"
},
{
"mappingID": "zCoordinate",
"columnIndex": 6,
"dataType": "double"
},
{
"mappingID": "Source",
"columnIndex": 7,
"dataType": "string"
},
{
"mappingID": "CRS",
"columnIndex": 8,
"dataType": "string"
},
{
"mappingID": "label",
"columnIndex": 9,
"dataType": "string"
},
{
"mappingID": "interpreter",
"columnIndex": 10,
"dataType": "string"
}
]
Here is an example response. This response has been formatted to improve readability.
"data": {
"topset": {
"id": "ed5f894e-4795-4860-82b5-e2c559b3f0b4",
"links": [
{
"rel": "self",
"relEntity": "v1/schema/int/top",
"href": "/ivaap/api/ds/mongo/v1/sources/c9db3458-6698-49d9-ae8f-f407ce26ae2e/tops/import",
"children": false,
"hasProjectEntityChildren": false,
"isProjectEntity": false
},
{
"rel": "TopSet",
"name": "TopSet",
"relEntity": "v1/schema/int/topset",
"href": "/ivaap/api/ds/mongo/v1/sources/c9db3458-6698-49d9-ae8f-f407ce26ae2e/topsets/ed5f894e-4795-4860-82b5-e2c559b3f0b4",
"children": false,
"hasProjectEntityChildren": false,
"isProjectEntity": true
}
]
},
"linesRead": {
"numberOfLinesRead": 321
},
"topsCreated": {
"numberOfTopsLoaded": 321
},
"topsFailed": {
"numberOfTopsSkipped": 0,
"error": []
}
}
The fileName entry is the name of a being imported well top file.
The id entry is a unique id of a well top set a top has been imported to.
The links sections provides a HATEOAS link to the "Well Data Web Service (v3)" service.