Exporting MasterMap to various file formats

This guide will cover all steps that are required to export a MasterMap layers to .shp format. Exporting to different formats requires small changes in the DataPump script files. All of these changes will be explained in the further part of this documentation.

1. Acquiring the connection string for the DataPump script

As first we need to find a connection string for our MasterMap layers. In order to find it please open a web.config file. For LIVE environments this file is located inc:\inetpub\wwwroot\map\web.config

 

Please be extremely cautious while working with web.config file!

Editing and saving web.config file will force Earthlight to go down for around 10 minutes. In this case we just need to copy part of a text so it won’t affect the file and Earthlight will not be stopped. We strongly suggest to copy this file to a different location and use the copied version.

 

In the web.config file please find a <connectionStrings> </connectionStrings> section. This section contains paths to all repositories. Please be aware that your connection strings order and values may be different from these presented in this guide.

We need to find a connection string for SpaceMap Repository. This is where MasterMap files are stored.

In this case the connection string is:
data source=d:SDriveEarthlightDataSpaceMap Repository;DirectAccess=true;cartridge=SpaceMap
Please note that we’ve ignored double quote " characters at the beginning and the end of connection string in the web.config file.

2. Creating a DataPump script

Now we are ready to create a .script file for the DataPump. This is how it should look.

  1. Note that the <Source> section contains the connection string to SpaceMap repository. However there is a new entry added at the end of the connection string: ;table name=BOUNDARYLINE . More information can be found in the description of mark number 2.

  2. DataPump is able to export only one table per action. In order to export many tables you need to add new action for each table to the existing script or create a separate script for each table. To inform DataPump which table should be exported in each action you need to enter its name in ;table name=xxxxxx .

    You can always check what are the table names by going to the location entered in the connection string. In this instance:
    data source=d:\SDrive\EarthlightData\SpaceMap Repository\;DirectAccess=true;cartridge=SpaceMap
    it is
    d:\SDrive\EarthlightData\SpaceMap Repository\

    The first table name is BOUNDARYLINE. That’s why we have added ;table name=BOUNDARYLINE entry in the source section of our DataPump script:

     

    1
    <Source>data source=d:\SDrive\EarthlightData\SpaceMap Repository\;DirectAccess=true;cartridge=SpaceMap;table name=BOUNDARYLINE</Source>

     

     

  3. <Desination> tag allows you to enter the location, file name and the file extension of the exported MasterMap table. In this instance:

    <Destination>d:\Temp\BOUNDARYLINE.shp</Destination>

    it will create a BOUNDARYLINE.shp file in the d:\Temp folder.

    If you want to change the exported file format to for example .tab just please change the file extension: <Destination>d:\Temp\BOUNDARYLINE.tab</Destination>

 

1
2
3
4
5
6
7
8
9
<?xml version="1.0"?>
<Script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Actions>
    <Action xsi:type="Load">
      <Source>data source=d:\SDrive\EarthlightData\SpaceMap Repository\;DirectAccess=true;cartridge=SpaceMap;table name=BOUNDARYLINE</Source>
      <Destination>d:\Temp\BOUNDARYLINE.shp</Destination>
    </Action>
  </Actions>
</Script>

 

3. Executing the DataPump script.

When the script is ready you can now execute it with DataPump. To do so please follow the description of Script Execution on demand on: Basic usage