Sharing Data

advertisement
What You Will Need
• ArcGIS 9.2 (ArcView, ArcEditor, ArcInfo)
• ArcGIS Data Interoperability 9.2 extension
(evaluation copy available)
• Sample dataset downloaded from ArcUser Online
Sharing Data
Between CAD and GIS Environments
Sharing data between CAD and
GIS formats is a common data
interoperability challenge for ArcGIS
users. This tutorial demonstrates
advanced techniques for moving
data to and from a CAD environment
using the data model transformation
capabilities available with the ArcGIS
Data Interoperability extension.
Based on Feature Manipulation
Engine (FME) technology from ESRI
Canada Limited business partner
Safe Software, Inc., the ArcGIS Data
Interoperability extension adds spatial
extract, transform, and load (ETL)
capabilities to ArcGIS, enabling users
to work with data in many different
formats. In ArcGIS 9.2, the ArcGIS
Data Interoperability extension has
been architecturally refreshed to
allow translations to and from any
Interoperability format.
In this tutorial, data will be prepared
for use in a CAD environment and the
target export format is MicroStation
Design format (also referred to as DGN
or IGDS). The source data is stored in
A better way to work with data in different formats
By Tyson Haverkort, Safe Software, Inc.
Getting Started
Before starting this tutorial, download the sample
dataset, Waterworks.zip, from the ArcUser
Online Web site and unzip the archive. For this
tutorial, the data is extracted to C:\ArcGIS\
ArcUser. If the ArcGIS Data Interoperability
extension is not already installed and licensed,
an evaluation copy for this extension can be
obtained from www.esri.com/extensions.
Creating the Spatial ETL Tool
First, you will need to create the spatial ETL
tool. Once the tool is created, Workbench will
be launched. This is the environment that is
used to model the translation.
1. Start ArcCatalog and enable the ArcGIS
Data Interoperability extension by selecting
Tools > Extensions. Check the box beside
Data Interoperability. If ArcToolbox is not
visible in ArcCatalog, add it by clicking the
Show/Hide ArcToolbox window button.
2. Create a new user toolbox by rightclicking the ArcToolbox node and
selecting New Toolbox. Name the new
toolbox ArcUserTutorial. Right-click the
ArcUserTutorial toolbox, select New, then
select Spatial ETL tool. This will launch
the Create Translation Workspace wizard.
3. Click the ellipses button (…) to launch
the Formats Gallery. From the Formats
Gallery, type “esri” in the search box. This
will filter the list down to ESRI formats.
Choose the format ESRI Geodatabase (Filebased), click OK, and click Next.
4. From the Locate Source Data screen,
browse to the Waterworks.gdb file
geodatabase. Click Next.
5. From the Select Destination Format
screen, launch the Formats Gallery again
by clicking the ellipses button (…). In
the search text box in the lower left, type
“DGN”. Choose the format MicroStation
Design, then click OK to return to the
wizard. Click Next.
6. From the Specify Destination Settings
screen, click Settings to display the
Design File Output Settings dialog box.
Click the ellipses button (…) for the Cell
Library File text box. When prompted,
browse to C:\Program Files\ArcGIS\Data
Interoperability Extension\design\default.
cel and click Open. Click OK to accept
the settings and return to the wizard. Click
Next to complete the wizard, then click
Finish to launch Workbench.
Setting Up the Fanout
The ArcGIS Data Interoperability extension can
write out multiple datasets based on the value
of an attribute. This is a very powerful feature
called dataset fanout. In the geodatabase, there
are two feature classes called Waterworks. Both
feature classes have an attribute called TILE.
This is a reference to the map sheet from which
the data originated. Writing all data out to a
single DGN file may not be practical for CAD
users. To address this, a different DGN file will
be written out for each map sheet or TILE.
1. In the Navigation pane, expand the
Destination Dataset node labeled <Not
Set>[IGDS]. Under this, expand the
a file-based geodatabase. The same
procedure can be applied using ArcSDE.
Choose ESRI Geodatabase (File-based) from the Formats Gallery.
54 ArcUser October–December 2006
www.esri.com
Hands On
Parameters node.
2. Double-click the Destination Design
File node (marked with a purple “gear”).
When prompted for the path to use to create
the destination data, specify C:\ArcGIS\
ArcUser\DestinationData\test.dgn. Notice
that the Destination Dataset is now labeled
test[IGDS].
3. Right-click test[IGDS] and select
Fanout Dataset. This will launch the Edit
Fanout Parameters dialog box.
4. Set the Fanout Prefix to C:\ArcGIS\
ArcUser\DestinationData and use TILE
as the attribute to fan out on. Leave the
Fanout Suffix as the default (.dgn). Click
OK. Note that the icon has changed to
indicate that a fanout is present.
Labeling the PIPE Features
The attribute data will not be immediately
available to the CAD users because they will
not be able to attach the database to the CAD
drawings. To accommodate these uses, the
information will be presented graphically. The
pipe’s diameter will be placed in a label at the
midpoint of each pipe.
1. Create a new destination feature type
by copying and pasting. Right-click the
destination feature type labeled 1 and select
Duplicate. A new destination feature type
called 3 will be created. The Workbench
has many tools to transform geometry and
attributes during a translation. These tools
are called Transformers.
2. In the Navigation pane, click the Gallery
tab. In the Search text box, type “label”. This
will filter all the transformers, and show
only the ones that are related to labeling
features. Double-click LabelPointReplacer
to add it to the Workbench canvas. The
LabelPointReplacer will read a feature and
change its geometry to a point that can be
used to create text.
3. Click the green PIPES output port
(arrow) and drag it to the INPUT port
on the LabelPointReplacer transformer.
This connects the PIPES output to the
LabelPointReplacer. Different colored
Properties buttons indicate that the
Properties of the transformers are in
different states. Blue means that all the
Properties have been verified and are valid.
Browse to C:\Program Files\ArcGIS\Data
Interoperability Extension\design\default.cel
and click Open.
Yellow indicates that the Properties are
valid but have not been verified and may be
incorrect. Red (with an exclamation point)
signifies that there are required parameters
that have not been filled in.
4. In this case, the Properties button
on the LabelPointReplacer is red. Click
Properties on the LabelPointReplacer.
When the Parameters dialog box appears,
pick ANNO_DIAM as the attribute to label
with, and set the Label Height to 4. Click
OK to accept the settings. Notice that the
Properties button has now changed to blue.
Connect the LABELPOINT output to the
destination feature class labeled 3.
Transforming the PIPE Features
Exporting the pipes is straightforward. The
DIAMETER attribute of the PIPES feature
type will be used to specify the width of each
line involved so pipes can be easily identified
www.esri.com
In the Search text box, type “label”. This will
filter all the transformers and show only the
ones that are related to labeling features.
Double-click LabelPointReplacer to place it
on the canvas.
without relying on attributes. The same process
could be used to modify the pipe colors or
symbols.
Format attributes describe the structure or
symbology of the data. User attributes describe
the feature itself. For example, a line in a
CAD file could be described as red (a format
attribute). That same red line could have user
attributes that describe it as a two-lane highway.
Some of the more common format attributes
are available by default, while others must
be exposed from the Properties dialog box.
The Format attribute igds_weight is available
by default. Notice that the igds_weight port
(arrow) on the destination feature type is red,
which means that, currently, there are no values
being passed into these feature attributes.
Continued on page 56
ArcUser October–December 2006 55
Sharing Data Between CAD and GIS Environments
Continued from page 55
1. Click the plus symbol (+) to expand
the attribute lists for the PIPES source and
destination feature types.
2. Connect the DIAMETER attribute
from the source to the igds_weight on the
destination feature type 1.
Transforming the VALVE Features
The next task is to take the geodatabase points
and create DGN cells from them. Three
classifications represent the size categories for
the valves in this dataset—R1, R2, and R3.
The same symbol will be used, but the size and
color of the symbol will change based on the
classification.
1. Sort the pipes based on their value for
VALVESIZE by adding an AttributeFilter
from the Gallery (double-click to place it
on the canvas).
2. Delete the connection from the
VALVES Source to Destination feature
type 2, then connect the VALVES source
to the input port on the transformer.
3. Open the Properties dialog box of the
AttributeFilter by clicking the ellipses
button. Set the Attribute to Filter By to
VALVESIZE. Enter the Possible Attribute
Values as R1, R2, and R3. Click OK.
These values are case sensitive. (Note: if
all variations of the VALVESIZE were
unknown, the Import button could be used
to read the source data and populate this
table automatically.) Notice that three
output ports, labeled R1, R2, and R3, have
now been added to the AttributeFilter.
4. Expand the attributes for the destination
feature type 2. Click Properties and select
the Format Attributes tab. Expose igds_
cell_name, igds_cell_size, igds_color, and
igds_type by checking the boxes beside the
attributes. Some of these format attributes
will have static values assigned to them,
while others will have values passed into
them based on the AttributeFilter.
5. Add threeAttributeCreator transformers
to the canvas. Connect the output from each
AttributeCreator to each of the R1, R2, and
R3 AttributeFilter inputs, respectively.
a.
Click Properties of the
AttributeCreator connected to R1. In
the Properties dialog box, create an
attribute called igds_cell_size and set
the value to 400. Then create another
attribute called igds_color and set the
value to 2. Click OK to close the dialog
box.
b. Connect the R1 AttributeCreator to
the destination feature type 2. Notice
that the two ports with the same names
on the destination feature type have now
turned green. This means that values are
Use the LabelPointReplacer to place the pipe’s diameter label at the midpoint of each pipe.
Connect the DIAMETER attribute from the source to the igds_
weight on the destination feature type 1.
Sort the pipes based on their value for
VALVESIZE by adding an AttributeFilter from
the Gallery.
56 ArcUser October–December 2006
www.esri.com
Hands On
Right-click igds_type and select Set to
Constant Value. Enter igds_cell as the value.
being passed to them. This happens
automatically because the new attributes
that were created have the same name
as the existing format attributes. If one
was spelled incorrectly or the letter
case was different, the ports would not
automatically connect. They would
have to be manually connected similar
to the destination feature type 1.
c. Open the Properties dialog box for
R2. Create an attribute called igds_
cell_size with a value of 200. Create
another attribute called igds_color with
a value of 3. Click OK to close the
dialog box.
d. Open the Properties dialog box
for R3. Create an attribute called
igds_cell_size with a value of 100 and
another attribute called igds_color with
a value of 5. Click OK to close the
dialog box.
e. Connect all the AttributeCreators to
the destination feature type 2.
6. All the valves will use the same cell, so
this information can be set in a constant.
On the VALVES destination feature type,
right-click the igds_cell_name attribute.
Select Set to Constant Value. When
prompted for a value, enter STRLIT.
Note that this value is case sensitive. This
is the name of the cell that exists in the
cell library named default.cel that was
specified when the workspace was set up
(see step 6 under the section Creating the
Spatial ETL Tool on page 54). A different
cell library can be specified at any time
by expanding the Parameters node in the
Navigation pane and double-clicking Cell
Library File. However, if the cell name that
is specified in the constant doesn’t exist in
the cell library, no cells will be created.
7. Before the cells can be created, the
igds_type must be specified. If it is not
specified, the extension will assume the
igds_type is point, and no cells will be
created. Right-click igds_type and select
Set to Constant Value. Enter igds_cell as
the value. Notice that there are still several
format attributes that will not have values.
To compare the
original geodatabase
with the newly created
DGN files, all tiles
must be viewed in a
single window. This
can be done by creating
an Interoperability
Connection.
In the Interoperability
Connection dialog box,
select MicroStation
Design as the format.
These format attributes have been exposed
automatically by Workbench and can be
left as is. Select File > Save to save the
tool.
Running the Tool
Now that the tool has been created, it is ready
to be run. This is the point where the actual
translation occurs.
1.To run the tool, simply click Play. The
Destination Design File must be specified, but
the values entered here are irrelevant since the
output folder has already been specified as part
of the fanout parameters.
2.From ArcCatalog, browse to the destination
folder and confirm that there are seven DGN
files.
Validating the Data
The DGN files are visible through the
ArcCatalog Browse Tree. To compare the
original geodatabase with the newly created
DGN files, all tiles must be viewed in a single
window. This can be done by creating an
Interoperability Connection.
1. In ArcCatalog, double-click the
Interoperability Connection node. In the
Interoperability Connection dialog box,
www.esri.com
select MicroStation Design as the format.
2. To specify the dataset, click the
Multifile Selector button (with the plus
sign), click the Add Folder button, and
browse to the location of the destination
DGN files. Click OK. Click OK again to
create the Interoperability Connection.
3. The connection will be named using
the first DGN file that is read. Expand
the connection. Click the Preview tab in
ArcCatalog to cache the connection data,
then right-click the connection and select
Refresh. This step will remove any empty
feature classes. Notice that the data is the
union of all the map sheets. If additional
validation is required, the Interoperability
Connection can be viewed in ArcMap and
overlaid with any other ArcGIS feature
classes. Once satisfied, the data can be sent
to the CAD team, where any necessary
changes will be performed.
Conclusion
The ArcGIS Data Interoperability extension
provides powerful functionality that can help
bridge the gap between data users of all kinds.
Through the new spatial ETL tool, complex
data transformations are now possible.
ArcUser October–December 2006 57
Download