Map Visualization
You can customize the Map
visualization in Watson™ Explorer Content Miner by uploading your own map
file.
Prepare Your Map File
To customize the Map visualization, you need to prepare the map file and upload it to IBM Watson® Explorer
oneWEX. The supported file format is GeoJSON. The map's file extension
should be .json
or .geojson
.
Upload Your Map File
You can upload the map file from the UI.
See details.
These instruction use the swagger interface to submit REST API calls to IBM Watson Explorer oneWEX.
-
Go to https://<wexONE_server>/docs/. Click Authorize and enter your sign in credentials. Click Authorize and then click Done.
-
Open FileResource > POST /api/v1/fileResources Create a file resource. Click Try it out.
-
Update the body as shown below. Choose values for <map_name> and <map_description>.
{ "description": "<map_description>", "id": "string", "metadata": { "lastModified": 1531288825136 }, "name": "<map_name>", "tags": { "propertyNames": ["<propertyName1>", "<propertyName2>"], "saveToLocal": boolean }, "type": "map" }
-
propertyNames
Choose property names from the
properties
key in your GeoJSON file and set it to this parameter as a string array. Values of this parameter will be compared with the facet values of the collection. If you don’t set any values, all of the properties of your GeoJSON will be compared. -
saveToLocal
When you open the Map view in Content Miner, the uploaded file will be download and cached to the local storage of the browser. If you don’t want this, set saveToLocal to
false
. The default value istrue
.
-
-
Click Execute and confirm the server response code is 200.
-
Copy the value of the id field from the Response body.
-
Open FileResource > POST /api/v1/fileResources/{fileResourceId}/upload Update a file resource content. Click Try it out.
-
Enter the id from step 5 and click Choose File to browse to the file you want to upload.
-
Click Execute and confirm the server response code is 200.
Enable the Uploaded Map
You can choose which maps you'll use from the Facet
step of the create a new collection page or in the Facet
tab of the edit a collection page.
-
Choose Map type from the Visualization type drop down on the facet row you want to customize.
-
A drop down will be displayed, choose the map name you want to use.
-
Go to the guided analysis view and verify the uploaded map is displayed as expected.
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"name": "New York",
"postal": "NY",
"code": "US36"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[-89.59940914585667, 48.01027395282483],
[-89.48888455722101, 48.01343887860651]
]
]
}
},
{
"type": "Feature",
"properties": {
"name": "Texas",
"postal": "TX",
"code": "US48"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[-89.59940914585667, 48.01027395282483],
[-89.48888455722101, 48.01343887860651]
]
]
}
}
]
}
{
"description": "Test Map",
"name": "USA"
"metadata": {
"lastModified": 1549710245417
},
"tags": {
"propertyNames": [
"name",
"postal"
],
"saveToLocal": true
},
"type": "map"
}