Connecting to Smallworld

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

  • FME 2017.x

Introduction

This article introduces the basic steps for connecting to you Smallworld database using FME.

The Smallworld VMDS database must have a connection service configured so that FME can communicate with the database and read or write objects. In Smallworld 5.x, the connection service is started automatically.

It is useful to view Smallworld data using the FME Data Inspector because this allows you to:

  • Inspect the data prior to translation
  • Determine how FME “sees” or “represents” the Smallworld data
  • Determine what data structures need to be created to successfully import data back into a Smallworld VMDS.

 

Step-by-step Instructions

Follow these steps to test the connection to the Smallworld database, and inspect the Cambridge data in the FME Data Inspector.

 

1. FME Data Inspector

Start FME Data Inspector and select: File > Open Dataset.

Enter the Reader parameters

Format: Smallworld 4/5
Coord. System:

OSGB-GPS-2015

opensmallworlddataset.jpg

 

2. Enter Database Connection Parameters

Click on the Parameters button and enter the Smallworld database connection parameters:

Server Host: localhost
Server Port: 30000
Service: FME
Username: (blank)
Password: (blank)


k1Q_uQUEoWnck2at2HttWA6PBd40dxmVcbqrei1QSX5KLmLR4bHXykXCeQMtrn-Uk9h8C86xC8S5CWFugbP_2mF2AvOvLeQ-rSAw9EYAjy__s60stvtO9dmzIv6P9JHPX2LQfvM

 

3. Open Table List

Still in the Parameters dialog, click on the browse button next to Table List2qaeKCQwLWyCYZ7pcO4x6vtUOeeAmq9Iab9klkTh_c3sHd0Fh2klw5eSdPIns8jUEResdDsmTfNI5gLhS-aIOoeQZHH13TvhJd_carevdDMKMBbDxXWlvlKIxxsFD8laY6-AHNc

 

4. Select Tables to View

The Select Feature Types dialog appears.

In the Filter text box, enter “electric” or “gis” to filter the list of feature types.

Select each of these feature types:

  • electricity.cable
  • electricity.joint
  • electricity.substation
  • electricity.supply_point
  • gis.min_road

Use the Filter field to help you find the feature types in the list, if you think it helps.

LItnCAsyC5gxvZOcHGRDCTWSvjTilmjvmJYtZ47BNa2PJTvWv6Mjcs4_at9YSFSkWivL5N6YPXDbfu2j9f_tLDI72lXx8_6VMSiWZhCyZ4eXjn-DwtdO4Jub9qQycoJ5rGuualU

Click OK to close the Select Feature Types dialog

 

5. Use Search Envelope

Check the Use Search Envelope and enter:

Minimum X: 545000
Minimum Y: 259000
Maximum X: 547000
Maximum Y: 261000


These search envelope values are in the source data units of measure – meters in this case since the Smallworld application coordinate system is British National Grid (meters).

Note: In Smallworld 4 and earlier, the search envelope parameters would very likely have been in the Smallworld 'world' coordinate system. For the Cambridge database, these would be mm, in the BritishNatGrid_mm coordinate system

You’ll probably use these values again so select Defaults – Save as My Defaults.

Click OK to close the Parameters dialog. Click OK again, to open the dataset in FME Data Inspector

fmedatainspector.jpg

 

If you don’t see the background map of the City of Cambridge then you probably need to configure Background Maps in FME Data Inspector OR you forgot to set the coordinate system in the Smallworld reader parameters dialog.

 

6. FME Data Inspector Background Maps

Select Tools -> FME Options. Under Background Map Format select a map and under Parameters… select Terrain. Other background maps are available, such as MapQuest, but these require you to set-up a free or paid for account and enter an API Key or login.

 

7. Data Inspection

Select the inspection tool and click on the various features to see how FME represents the Smallworld objects with individual attributes and geometry in the Table View and the Feature Information window. In the Feature Information window, note the Name property on the feature geometries.

Note: for the purposes of compatibility with Smallworld 4 and earlier, FME still displays the sworld_geometry{} list attribute. These are no longer needed when working with Smallworld 5.

More about the geometry Name property later.

Check the Display Control tab in FME Data Inspector to see the list of feature types.

 

Display Multiple Geometries

Smallworld objects often have multiple geometry columns, for example centreline & annotation. FME can preserve the multiple spatial column structure, or simplify the geometries.

When you configure the Smallworld reader, the Service parameter lets you select whether you will preserve multiple spatial columns or have FME simplify the geometries. The Service parameter options are:

  • FME: Simplify geometries
  • FMENOFACTORY: Preserve multiple spatial columns

 

Service: FME

Using Service: FME simplifies the Smallworld objects so that they are more compatible with most other GIS and CAD formats. Smallworld objects that contain multiple geometries are split into separate features with different FME feature types, one feature type for each geometry. For example, the Smallworld rail_line object with line and annotation geometries will become the FME feature types gis.rail_line_centre_line and gis.rail_line_annotation. Similarly a Supply Point object will be split into two features, electricity.supply_point_location and electricity.supply_point_label.

 

Service: FMENOFACTORY

The FMENOFACTORY service produces the “raw” Smallworld objects and preserves the multiple spatial columns. The multiple spatial columns from the Smallworld objects are represented as aggregates on the FME features.

Displaying the “raw” Smallworld objects in FME Data Inspector is one way to determine how you need to structure the data in FME Workbench so that it will upload to Smallworld successfully. It’s also useful if you’re replicating your data to a database such as Oracle which has multiple spatial columns.

In the previous example you used the default parameter Service: FME. The next example illustrates Service: FMENOFACTORY.

 

1. Start FME Data Inspector

Back in FME Data Inspector, Select File > Open Dataset.

Enter the Reader parameters

Format: Smallworld 4/5
Coord. System: OSGB-GPS-2015


2. Enter Database Connection Parameters

Click on the Parameters button and enter the Smallworld database connection parameters:

Server Host: localhost
Server Port: 30000
Service: FMENOFACTORY
Username: (blank)
Password: (blank)


RBlI3AWz3K2DC9gbNBhmUlZcaab0cNIbpj1YPw5rycx5XwpbOSbUgzReYwo5C2QhJ_Oe1JN7to2MBIfRoLCeJ1R-Quj4AoIuZg73-N9qGxlsigPOU7SYJpTg6_yltyxjHMcRFT8

 

3. Open Table List

Still in the Parameters dialog, click on the browse button next to Table List

 

4. Select Tables to View

The Select Feature Types dialog appears. Notice that only the main table names are available from this service.

Choose the same objects as before:

  • electricity.cable
  • electricity.joint
  • electricity.substation
  • electricity.supply_point
  • gis.min_road

Click OK to close the Select Feature Types dialog

Select the same Search Envelope values as before:

Minimum X: 545000
Minimum Y: 259000
Maximum X: 547000
Maximum Y: 261000


Click OK to close the Parameters dialog

Click OK again, to open the dataset.

 

6. Inspect the Dataset

Use the table view or the inspection tool to select an electricity.supply_point feature. You can see the feature attributes and the geometry. The geometry of the feature is an fme_aggregate with two parts, a location and a label (listed under IFMEAggregate):

fmenofactory.jpg

 

The geometry parts of a feature will vary, depending on the object you select. For linear features such as the electricity.cable, the Smallworld chain and sectors are represented in FME as a path and segments (sometimes called a complex edge in network applications). The path is equivalent to the Smallworld chain and each sector is represented as a segment of the FME path. Select the cable:

known_as = Union Lane LV

This is a multi-sector chain in Smallworld (a path geometry in FME).

If your Smallworld geometries also contain circular arcs, they will be preserved. Other types of arc (elliptical, spline, etc.) are stroked.
 

Smallworld Geometry

The Smallworld geometry representation in FME is made-up from four parts:

  • Smallworld geometry field (geometry name and type)
  • FME geometry aggregate
  • FME geometry name
  • sworld_geometry{} list attribute (only for compatibility with Smallworld 4 and earlier)

The geometry Name property tells us which spatial column the geometry originated from in the Smallworld database. The Name property is used to link the FME geometry to the Smallworld geometry field when writing objects to Smallworld. In the Supply Point example above the FME Aggregate has two parts:

Part 0 FME Text label
Part 1 FME Point location

 

fmenofactory2.jpg

 

Note that the sworld_geometry{} list is included only for compatibility reasons and is no longer needed when working in Smallworld 5.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.