GASWorkS™ Example Importing SHP Files

GASWorkS™ Example
Importing SHP Files
Introduction
The following provides instructions for creating a model from a set of shape (shp) files. A shape file is used
to exchange geographic and attribute information between a Geographic Information System (GIS) and other
applications. The shape file format specification is published Environmental Systems Research Institute
(ESRI).
Two shape files are required to create a complete GASWorkS model - an arc type shape file containing the
linework for the main line pipes, and a point type shape file containing the meter locations. The model is
created by first importing the main features, and then importing the customer features. The customer service
lines can either be assigned based on information in the shape file or automatically assigned by GASWorkS.
The main linework and the customer service lines often require some clean-up after importing and
assignment.
A “shape file” actually consists of several files which contain information about a geographic feature. The
files are generally created by exporting data from a GIS, but can be created by other applications as well. At
a minimum, the files associated with a shape file will include a file containing the location (xy) information,
a file containing attribute information, and an index file which links the two files. The xy file ends in a “.shp”
extension. This file is saved in a binary (machine language) format as described in the shape file
specification. The attribute file ends in a “.dbf” extension. This file is saved in a dBase 3 format. The
contents of this file varies. The index file ends in a “.shx” extension. Similar to the shp file, this file is saved
in a binary (machine language) format as described in the shape file specification published by ESRI. Other
files may also be included, but are not used by GASWorkS.
A shape file can contain only one type of geographic feature. For example, only line/arc style features, only
point style features, only polygon style features, or only annotation features. A shape file cannot contain a
combination of features. For example it cannot contain both mains and meter locations.
Only a pipe shape is required to create a basic GASWorkS model. At a minimum, the pipe attribute file
should contain at least a field for the pipe size/type value. It can also contain other information, including
but not limited to an identification number and actual length. If a unique identification number is included
it can be used to link the GASWorkS results back to GIS data. When a pipe shape file is imported, the
hydraulic length is calculated based on the coordinate locations contained in the shp file. Sometimes the
geographic length does not actually represent the hydraulic length (however, in most cases it does). If the
geographic and hydraulic lengths are not the same, the computed value can be manually overwritten by the
User after the import is complete. Or if an actual length field is included in the attribute file, the computed
length can be replaced by the attribute value.
Bradley B Bean PE
ENGINEERING & SOFTWARE
Revision - 001, Copyright 2015, All Rights Reserved.
1
GASWorkS™ Example
Importing SHP Files
If a customer shape file is available, it can be used to create customer features in GASWorkS. At a minimum,
the customer attribute file should contain a unique identification number. This number can be used to link
a billing or “load” file to assign the customer usage values. The attribute file can also contain other
information including load/usage values, address, and ID number of the supplying main. If the supply main
ID is included, the customer will automatically be assigned to the main with a matching ID number during
the import process. If no pipe ID is included, the customers will be assigned to the nearest mains when the
model is first opened.
Summary
In this example, a model will be created from a set of
shape files. The shape files consist of a pipe shape file
to create the piping network, and a customer shape file
to create the customer features. The system contains
one supply point and several regulators.
Steps
The following assumes that GASWorkS has already
been started. If a model is already open, close it now
using the Close menu item from the File menu list. Use
the following procedure to work this example...
1) Set The Default Units And Values
! Select the Set Defaults menu item from the Utilities
menu list. The Default Data Values screen will appear.
! On the Dimensional Units tab and the Gas
Properties tab, set the various values as
appropriate.
! On the Hydraulic Data tab, enter or select
the following values:
Pipe Size/Type = 99. (This will allow you to easily identify any pipes where a size/type
value is not entered in the attribute file.)
• Set the remaining values as appropriate.
Bradley B Bean PE
ENGINEERING & SOFTWARE
Revision - 001, Copyright 2015, All Rights Reserved.
2
GASWorkS™ Example
Importing SHP Files
! Select the Close command button to exit the screen and save the values.
2) Import The Pipe Shape File
! Select the Import/Export menu item from the Utilities menu list. The Import/Export specification screen
will appear.
! Select the SHP Pipe item from the File Type list. Select the Import command button. The File
Selection screen will appear.
! Use the Drives and Directories lists to navigate to the directory containing the desired
shape file, SHP_90_P.shp. When the file is found, double-click on the file name to select
the file. The file will be displayed in both the Source and Target file selection lists. Select
the Continue command button.
! The Fuzzy Tolerance screen will appear. Enter an appropriate value in coordinate units
(usually 5 feet or less) - enter 1 for this example. Select the Continue command button.
! The Pipe Database File Format screen will appear. This screen tells GASWorkS which
item in the attribute file represents which item in the GASWorkS data model. Select the
Clear command button to remove any previous settings.
! Make the new item assignments by clicking next to the GASWorkS item, then
double-click on the attribute item in the data field list. At a minimum the ID
Number and Size/Type Code should be assigned. The Available Fields list contains
all of the fields found in the attribute file. For this example, set the following:
Diameter (Size/Type) = SIZE_TYPE
Hydraulic Type = HYD_TYPE
Link ID Number = LINK_ID
! After the desired items have been assigned, select the Continue command button. The
import process will begin. The status of the process will be displayed on the Import/Export
screen.
! After the import process is complete, select the Close command button. If the import was
successful, the model can now be opened.
Bradley B Bean PE
ENGINEERING & SOFTWARE
Revision - 001, Copyright 2015, All Rights Reserved.
3
GASWorkS™ Example
Importing SHP Files
3) Open The New Model
! Select the Open menu item from the File menu list. The File Selection screen will appear. Select the file
named shp_90_p.hdr, then select the Continue command button.
! If the model is not automatically displayed, select the View/Edit menu item from the Graphics menu list
to display the model.
! Resize the image using the Maximize GDI Window command in the GDI Command List. Then zoom the
image to fill the display using the Zoom To Fit icon from the View Controls toolbar.
4) Set Some Graphic Settings
! Select the Settings menu item from the Graphics menu list. The Graphic Settings screen will appear.
! In the Settings list, select the following values:
Coordinate Units = Feet
• Check the remaining values for appropriateness.
! Select the Close command button to exit the screen and save the values.
5) Check The Model
! Zoom into a portion of the model where a pipe length is known. Display the length of the line by selecting
the Edit Pipe Data icon from the Data Edit Commands toolbar.
! If the distance is correct, proceed with cleaning up the model using the GDI edit tools. If the scale is not
correct, you will need to rescale the original data using the source application and then re-import the data.
Note - As an alternative to re-scaling the source data, you can rescale the model using the GASWorkS scaling
routine, select the Calculate XY’s menu item on the Miscellaneous submenu of the Utilities menu list. If only
pipe data is going to be imported, you can use that routine to rescale the model now. If customer data is going
to also be imported, use the routine to rescale the model after the customers have been added.
! Check the pipe connectivity using the Create Trace icon from the Graphic Utility Commands toolbar.
! Check the pipe size assignments using the color coding routine (the Set Feature Colors icon from the
Display Controls toolbar) or the text display routine (the Set Text Options icon from the Display Controls
toolbar).
Bradley B Bean PE
ENGINEERING & SOFTWARE
Revision - 001, Copyright 2015, All Rights Reserved.
4
GASWorkS™ Example
Importing SHP Files
6) Add Regulators & Set Supply Pressures
In some cases, the regulators must be entered manually. In this example regulators were imported and
assigned, based on the value of the HYD_TYPE data item. Although the regulator assignments were made,
the set pressure and the known/unknown settings of the outlet nodes need to be manually entered.
! Use the Edit Node Data icon on the Data Edit Commands toolbar to enter the supply pressure values and
indicate that the pressure values are Known (unchecked) for the supply nodes. At least one pressure value
must be set before the model can be solved.
! Use the Edit Pipe Data icon on the Data Edit Commands toolbar to enter the set pressure values for each
regulator and enter the appropriate known/unknown settings at the outlet (From) nodes at each regulator.
In cases where regulators are not entered and if multiple operating pressure levels are present in the model,
the regulators separating the levels must be manually entered. Generally the pressure value for the outlet node
of the regulators should be set as Known. Use the Edit Pipe Data and Edit Node Data commands to enter
and set the regulator values as appropriate.
7) Import (Merge) The Customer Shape File
! Select the Import/Export menu item from the Utilities menu list. The Import/Export specification screen
will appear.
! Select the SHP Customer item from the File Type list. Select the Merge command button. The
File Selection screen will appear.
! Use the Drives and Directories lists to navigate to the directory containing the desired
shape file, SHP_90_C.shp. When the file is found, click on the filename to select the file.
The file will be displayed in both the Source and Target Filename data fields. In the Target
File section, locate the name of the model created by importing the pipe shape file. When
the file is located, click on the filename. The name will be displayed in the Filename data
field. Select the Continue command button.
! The Fuzzy Tolerance screen will appear. Enter an appropriate value in coordinate units
(usually 5 feet or less) - enter 1 for this example. Select the Continue command button.
! The Customer Database File Format screen will appear. This screen tells GASWorkS
which item in the attribute file represents which item in the GASWorkS data model.
! Select the Clear command button to remove any previous settings.
Bradley B Bean PE
ENGINEERING & SOFTWARE
Revision - 001, Copyright 2015, All Rights Reserved.
5
GASWorkS™ Example
Importing SHP Files
! Make the new item assignments by clicking next to the Customer Items, then
double-click on the attribute item in the Available Fields list. At a minimum the ID
Number should be assigned. The Available Fields list contains all of the fields
found in the attribute file. For this example, set the following:
Link ID Number = LINK_ID
Load Per Unit = TOTAL_Q
! After the desired items have been assigned, select the Continue command button.
The import process will begin. The status of the process will be displayed on the
Import/Export screen.
! After the processing is complete, select the Close command button. If the import was
successful, the model can now be reopened.
8) Re-Open The Model
! Select the Open menu item from the File menu list. The File Selection screen will appear. Select the file
named shp_90_p.hdr, then select the Continue command button.
! If the model is not automatically displayed, select the View/Edit menu item from the Graphics menu list
to display the model.
! If the Supply ID Number was not assigned, a prompt will appear asking whether to assign the customer
services lines. If the message is displayed, select the Yes command button to assign the supply main and
“service lines”.
! After the service lines have been assigned, the model will be displayed.
9) Check The Customer Assignments
! Use the Zoom and Pan commands to move around the model image to check the customer assignments.
Each “service line” is drawn from the customer symbol to the main supplying it. Revise the customer
assignments as appropriate.
! Correct the customer assignments using the Reassign Supply Main icon from the Customer Data
Commands toolbar.
! After the customer assignments have been checked and corrected, the customer loads need to be assigned
(if they weren’t during the import process).
Bradley B Bean PE
ENGINEERING & SOFTWARE
Revision - 001, Copyright 2015, All Rights Reserved.
6
GASWorkS™ Example
Importing SHP Files
10) Assign The Customer Loads
If the customer loads were not assigned during the import process (they were in this case), the loads need to
be assigned before the model can be solved. You can use the GASWorkS Mass Update routine, the Edit
Multiple Customers command, or the Edit Customer Data routine to set the customer loads as appropriate.
If the Mass Update routine is used, enter the new load value in Cfh.
The loads can also be assigned by attaching a copy of the customer billing file to the model using the
Customer Attribute Data File features. See the User’s Manual for additional information on using this
feature.
! After the loads have been set using one of the above methods, use the Update External Loads menu item
from the submenu Customer Data, from the Utilities menu list. Select the OK command button to clear the
message.
! After the loads have been assigned and updated, the model is ready to solve.
11) Solve The Model
! Select the Solve icon in the lower right hand corner of the GDI window. The Solution Data screen will
appear.
! On the Base Conditions tab, review the values for appropriateness.
! Select the Solve command button. The GASWorkS Solution Log will appear when the solution
is complete. Review the results, then select the Close command button to exit the log.
12) Review The Results
! Review the solution results by displaying the flow arrows, and pressure values. If the flow arrows aren't
displayed, select the Display Flow Arrows icon from the Display Controls toolbar.
! Display the pressure values by selecting the Set Text Options icon from the Display Controls toolbar. In
the Node Items list, select the Pressure item. Select the Apply command button to update the display. Are
the pressures OK? You may want to turn off the display of the load values and customer symbols to make
the display easier to see.
Bradley B Bean PE
ENGINEERING & SOFTWARE
Revision - 001, Copyright 2015, All Rights Reserved.
7
GASWorkS™ Example
Importing SHP Files
Notes & Considerations
! When a shape file is imported into GASWorkS, the features maintain the same coordinate location values
as in the original file. If the original coordinates are latitude and longitude (or some other non-planar system),
it is generally best to project the data to a plane system, such as the state plane coordinate system. A
consistent coordinate system needs to be maintained, if other data is to be added to the original model.
! When a shape file is imported into GASWorkS, all of the features contained in the file are converted to
the designated GASWorkS feature. It is important that a shape file only contains information that represent
the associated data feature. For example, a pipe shape file should only contain linework representing the
piping system. Linework associated with details or other drawn features should not be included in the pipe
shape file. A customer shape file should not contain extraneous point locations.
! When a pipe shape file is imported into GASWorkS, a node is automatically created at each pipe end. If
a node already exists within the “fuzzy” tolerance of a pipe end, the existing node is used. This allows
slightly “dirty” linework to be imported so that the pipe ends are “snapped” together. Although GASWorkS
provides tools for cleaning up the data after it has been imported, it is best that the source linework be
topologically correct in the data system. That is that the line ends should be snapped together, short segments
should be joined as appropriate, and lines should be broken at lateral connections.
! In addition to the GASWorkS Import routine, it also provides a Merge routine. The Import routine creates
a new GASWorkS model from the imported data. The Merge routine adds data to or updates data in an
existing GASWorkS model.
! GASWorkS uses a third party (Microsoft) database management software to handle the dBase attribute
data files. A requirement of this software is that the filename must be less than eight characters. If a shape
file has a name longer than eight characters, it must be renamed before it can be imported into GASWorkS.
Remember to change the name of all the files in the shape set.
! Similar to the filename requirement, the data field names should not contain spaces. Underscores are
commonly used to represent spaces in the field names. If an ID field is included in a customer shape file, and
it is used to link to a load or billing file, it is especially important that the field name not contain spaces in
either the attribute file or the linked file.
! The attribute file associated with a shape file can be opened and manipulated by many database or
spreadsheet applications. There is one record in the attribute file for each record in the location file. If you
manipulate the file with an outside application be careful not to add, delete, or reorder the records in the file.
Bradley B Bean PE
ENGINEERING & SOFTWARE
Revision - 001, Copyright 2015, All Rights Reserved.
8
GASWorkS™ Example
Importing SHP Files
! GASWorkS uses a pipe size/type code to establish the pipe diameters. GASWorkS maintains a table of
pipe properties. The table lists the inside diameter values (and other values) associated with each size/type
code. When a diameter is required, the size/type code is looked up in the Pipe Property Table. If a match is
found, the diameter from the table is used. If the code is not found, the code is converted to a numeric value,
and that value is used as the inside diameter value. The codes included in the shape attribute file should
correspond to the values contained in the Pipe Property Table. If they do not, either the Pipe Property Table
can be revised, or the values can be changed using the Mass Update routine after the file has been imported.
Bradley B Bean PE
ENGINEERING & SOFTWARE
Revision - 001, Copyright 2015, All Rights Reserved.
9