Civil3D : FEMA Floodplain and EPA Watershed Dynamo Scripts

 Civil3D : FEMA Floodplain and EPA Watershed Dynamo Scripts

Written by Andy Carter,PE | December 29, 2020



Download the Script

Download the Civil3D Dynamo scripts from my GitHub repository. 

https://github.com/andycarter-pe/Civil3D_WebService_Dynamo/archive/main.zip




Video Walkthrough (3 minutes)





Web Services for Drainage

There are several federal web services that are currently providing geospatial data that is essential for your design projects.  As a civil engineer that specializes in hydrologic and hydraulic design, I need to know the watershed delineation for the site  as well as the limits of the FEMA regulated floodplains.

For watershed delineations, the EPA WATER's service (Watershed Assessment, Tracking & Environmental Results System) provides for the request and delivery of pre-calculated watersheds and stream centerlines for the continental United States.


When you need FEMA floodplain limits on and adjacent to your subject site, most folks these days use FEMA's National Flood Hazard Layer (NFHL).  Typically, this is ingested through an image overlay map service that is used in either Google Earth, ArcGIS Pro or QGIS.



Dynamo: Getting AutoCAD Linework

I have created a couple of Dynamo scripts that makes a web request to these federal servers to get the needed AutoCAD linework for your drawing.  Here is a rough breakdown of what is going on:

  1.  User sets up a Civil3D drawing in the desired Coordinate Reference System (CRS)
  2.  User draws and selects ACAD item for spatial input
  3.  Dynamo converts items coordinates to Latitude/Longitude
  4.  Dynamo builds a URL to request the data from the REST endpoint as JSON
    1. Example  https://hazards.fema.gov/gis/nfhl/rest/services/public/NFHL/MapServer/27/query?&geometry=-97.786,30.352,-97.782,30.356&f=pjson
    2. Example  https://ofmpub.epa.gov/waters10/NavigationDelineation.Service?pNavigationType=UT&pStartComid=5781811&pOutputFlag=BOTH&pAggregationFlag=TRUE
  5.  JSON data is parsed with Dynamo to get linework
  6.  Lat/Long coordinates converted to local CRS 
  7.  Linework drawn inside AutoCAD / Civil3D

Stop (Collaborate and Listen)!

Prior to even thinking about using this script, you will need to install the Civil3DToolkit package for Dynamo.  This package is provided by Autodesk and provides functionality necessary for my scripts to work.



Download the Script

Download the Civil3D Dynamo scripts from my GitHub repository. 

https://github.com/andycarter-pe/Civil3D_WebService_Dynamo/archive/main.zip









Some Warnings

The scripts are "as is" and are provided without warranty of any kind.  You can modify any script but, if you do, know that you are required to provide me proper credit.

Please comment below if you have questions or issues.  While I can't provide support, I would like to know what issues y'all are seeing.





8 comments:

Unknown said...

Very Nice Andy. Thanks.

Unknown said...

This is Awesome! Thanks for sharing! Much quicker to get the linework than our previous methods.

Unknown said...

Definitely Cool....If you're into C3D, Dynamo and Open Channels like me, that is....

unknown said...

Just discovered this very cool tool, thank you very much for your time and effort into this and your willingness to share.

I downloaded your Dynamo scripts and the Civil3DToolkit then restarted Civil 3D but each one returns "Run completed with errors" when ran. Any suggestions are greatly appreciated.

Thank you

Jerry said...

I was able to use this last week(8-12-24) but FEMA changed the url and now I can't figure out how to update it... would be great if someone could update this!!

Andy Carter, PE said...

Yup... the FEMA REST endpoint changed. The new endpoint is an ESRI service located at https://hazards.fema.gov/arcgis/... as I have paying clients/research this free work will not likely happen quick. Sorry.

Unknown said...

I second the "wish someone could update this". Thanks Andy for acknowledging the FEMA url change. I tried changing the "gis" to "arcgis" per your comment, but it didn't seem to help. Hoping the change is easy and we can get a working version again. It sure is helpful.

Unknown said...

I managed to figure it out. Edit the URLs in the "Web Request" groups to:
https://hazards.fema.gov/arcgis/rest/services/public/NFHL/MapServer/27/query?geometry=
Change the number to match the node it is in (i.e., 27 to 16 for the BFE's)