Map Visualization

Applies to version 12.0.2.2 and subsequent versions unless specifically overridden 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

Applies to version 12.0.3 and subsequent versions unless specifically overridden 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.

  1. Go to https://<wexONE_server>/docs/. Click Authorize and enter your sign in credentials. Click Authorize and then click Done.

  2. Open FileResource > POST /api/v1/fileResources Create a file resource. Click Try it out.

  3. 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 is true.

  4. Click Execute and confirm the server response code is 200.

  5. Copy the value of the id field from the Response body.

  6. Open FileResource > POST /api/v1/fileResources/{fileResourceId}/upload Update a file resource content. Click Try it out.

  7. Enter the id from step 5 and click Choose File to browse to the file you want to upload.

  8. 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.

  1. Choose Map type from the Visualization type drop down on the facet row you want to customize.

  2. A drop down will be displayed, choose the map name you want to use.

  3. Go to the guided analysis view and verify the uploaded map is displayed as expected.

For example, you may upload a GeoJSON file like the following:
{
  "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]
          ]
        ]
      }
    }
  ]
}
When you upload the above file, you can input the following values in step 3 of Upload Your Map File.
{
  "description": "Test Map",
  "name": "USA"
  "metadata": {
    "lastModified": 1549710245417
  },
  "tags": {
    "propertyNames": [
      "name",
      "postal"
    ],
    "saveToLocal": true
  },
  "type": "map"
}