| Product(s): | WaterGEMS, SewerGEMS, CivilStorm, StormCAD, StormCAD, HAMMER, WaterCAD |
| Version(s): | 08.11.XX.XX and higher |
| Area: | Output and Reporting |
How do I convert my model elements into shapefiles? (for example for use in a GIS application)
Or:
Is there a way I can generate polygon shapefiles if I do not have a Map application such as ArcGIS? For example if I need a population or boundary layer for use in Loadbuilder.
The OpenFlows products can convert modeling elements to shapefiles that can be used in our ModelBuilder tool, as background layers, or in any software that can open or work with shapefiles, such as ArcGIS or AutoCAD. Note though that this needs to be done separately for each element type via the Flextables. Meaning, there will not be a single file, but rather a collection of separately exported shapefiles for each element type (from each respective flextable)
A Note on spatial reference / georeferencing (PRJ file): starting with version 24.00.02.2X and higher, the OpenFlows products will also export a .PRJ file containing the coordinate system, if a coordinate system has been specified in the model.
1. Open up the flextable corresponding to the element type you would like to export. (View > Flextables> Double click on the flextable you want to open) If you do not already have these elements in the drawing, lay them out first. For example if you want to generate polygon shapefiles, lay out catchments (SewerGEMS, SewerCAD, CivilStorm, StormCAD, PondPack) or pump stations (WaterCAD, WaterGEMS, HAMMER).
Note: if you need to export all model elements to Shapefiles, you will need to open each element type Flextable one by one and perform the export.
2. Edit your flextable so it has all the fields that you want displayed in your shapefile. If you don't want to modify the predefined flextables, consider creating a new flextable (under View > Flextables > Tables - Hydraulic Model for example) with only the fields you want to export.
3. In the upper-left corner of the flextable, click the first icon (see below). Also note that when exporting flextables to shapefiles the shapefile will only contain the fields displayed in the flextable.
4. Name the shapefile and then click save.
5. Adjust the shapefile field names if necessary. The field names need to follow the shapefile field name rules, which include a limited number of characters (~9-10).
6. Click the ok button and your shapefile will be created. Repeat these steps for other element types as needed.
Note that currently (as of 24.00.01.05) the underlying database used by the OpenFlows products is not coordinate system aware so a .PRJ file (with the spatial reference / coordinate system information) is not exported from the Flextable. Only the .shp, .shx and .dbf file are exported, which contain the X and Y coordinates and other metadata. This is true even if you're using the ArcGIS integrated version.
if you need to export all model elements to Shapefiles, you will need to open each element type Flextable one by one and perform the export.
A quicker way to export all element types at once can be submitted (or voted upon) in our Idea Portal.
Also consider setting up a sync out in ModelBuilder to a format such as Geodatabase, where multiple layers (elements types) can be mapped in one sync-out.
If you have a need to export multiple models to shapefile, the situation is similar to above (all elements) in that we do not currently have a built-in feature for this so it would need to be done one-by-one, or you would need to program a WaterObjects tool to accomplish this (BDN membership required).
Consider the reason why you want to export multiple models to shapefile, in case there is a better way to accomplish what you need. You can set up ModelBuilder connections directly to the GIS while working in the WaterGEMS for ArcGIS Pro integrated version (if your GIS uses ArcGIS Pro) and perform a "sync out" to send the desired model data back to the GIS, which may be easier than your shapefile approach. However you would still need to open and sync-out each model one by one.
If each model represents an area of a large system, you could consider merging them into one model using submodel imports.
Building a model using ModelBuilder
How do I determine what projection a model has been set to?