{"id":607,"date":"2013-01-10T14:17:27","date_gmt":"2013-01-10T19:17:27","guid":{"rendered":"http:\/\/www.gis.mtu.edu\/?p=607"},"modified":"2015-05-01T09:08:37","modified_gmt":"2015-05-01T13:08:37","slug":"how-to-determine-the-number-of-streams-entering-and-exiting-lakes-using-nhd-data","status":"publish","type":"post","link":"https:\/\/www.gis.mtu.edu\/?p=607","title":{"rendered":"How to determine the number of streams entering and exiting lakes using NHD data"},"content":{"rendered":"<h3 id=\"DetermininglakeinflowsandoutflowsinNHDdata-Obtaindata\"><span style=\"text-decoration: underline;\"><strong><em>Obtain data<\/em><\/strong><\/span><\/h3>\n<p>Download a pre-staged file geodatabase for HUC subregion(s) of interest from\u00a0<a href=\"http:\/\/nhd.usgs.gov\/data.html\" rel=\"nofollow\">http:\/\/nhd.usgs.gov\/data.html<\/a>\u00a0and extract the contents of the download.<\/p>\n<h3 id=\"DetermininglakeinflowsandoutflowsinNHDdata-Preparedata\"><span style=\"text-decoration: underline;\"><strong><em>Prepare data<\/em><\/strong><\/span><\/h3>\n<p>In ArcGIS, add the feature classes\u00a0<strong>NHDWaterbody<\/strong>,\u00a0<strong>NHDFlowline<\/strong>, and\u00a0<strong>WBD\\HU8<\/strong>\u00a0to your map. If you wish to work with lakes and ponds only, either perform a definition query on\u00a0<strong>NHDWaterbody<\/strong>to show only Type = Lake\/pond (&#8220;FType&#8221; = 390) or select all FType = 390 and write the records out to a new feature class.<\/p>\n<p>Remove the feature type &#8220;artificial\u00a0path&#8221; from the feature class\u00a0<strong>NHDFlowline<\/strong>. Artificial paths are created by NHD staff to simulate connections between inflows and outflows from water bodies (rivers entering and leaving lakes). Leaving these features in the data set will result in duplicate entries and an artificially (2x) high number of inflows and outflows. To remove these features from your analysis, you may either select all elements not flagged as ArtificialPath and write out to a new feature class, or perform a definition query to exclude them (&#8220;FType&#8221; &lt;&gt; 558).<\/p>\n<p>You can create a new file geodatabase to hold your exported files and the results of your analysis\u00a0<strong>or<\/strong>\u00a0write the new data to the pre-staged geodatabase you downloaded above. Either option is fine.<\/p>\n<h3 id=\"DetermininglakeinflowsandoutflowsinNHDdata-Performanalysis\"><span style=\"text-decoration: underline;\"><em><strong>Perform analysis<\/strong><\/em><\/span><\/h3>\n<h4 id=\"DetermininglakeinflowsandoutflowsinNHDdata-Intersectriversandlakes\"><strong><em>Intersect rivers and lakes<\/em><\/strong><\/h4>\n<p>Open the\u00a0<strong>Intersect (Analysis)<\/strong>\u00a0tool and add your two layers (<strong>NDHFlowline<\/strong>\u00a0and\u00a0<strong>NHDWaterbody<\/strong>) as prepared above as\u00a0<strong>Input Features<\/strong>. Change the\u00a0<strong>Output Type (optional)<\/strong>\u00a0from\u00a0<strong>INPUT<\/strong>\u00a0to\u00a0<strong>POINT<\/strong>. This tool will create points wherever NHDFlowline features (rivers and streams) enter or exit lakes and ponds. Save your output file with a name that makes sense (e.g., include the HUC ID and InflowOutflow:\u00a0<strong>NHD_403_InflowOutflow<\/strong>).<\/p>\n<h4 id=\"DetermininglakeinflowsandoutflowsinNHDdata-AddwaterbodyIDinformationtoyourpointfile\"><strong><em>Add waterbody ID information to your point file<\/em><\/strong><\/h4>\n<p>To obtain counts for each lake (total inflows and outflows) each lake will need a unique name. Unfortunately, many NHD lakes are unnamed and lake names are not unique (Examples?\u00a0search\u00a0for &#8220;Wolf Lake&#8221;, &#8220;Mud Lake&#8221;, or &#8220;Deer Lake&#8221; in any lakes database). Because of these &#8216;features&#8217; of the data, generating a unique name isn&#8217;t as\u00a0simple\u00a0as it might be. A workable suggestion: add a\u00a0<strong>new field<\/strong>\u00a0to the\u00a0<strong>lakes<\/strong>\u00a0(<strong>NHDWaterbody<\/strong>) attribute table\u00a0named\u00a0<strong>UniqueName<\/strong>, type of\u00a0<strong>Text<\/strong>\u00a0and\u00a0<strong>length<\/strong>\u00a0of\u00a0<strong>50<\/strong>\u00a0characters. Ensure you have no records selected, and use the field\u00a0calculator\u00a0to populate the\u00a0<strong>UniqueName<\/strong>\u00a0field with the expression\u00a0<strong>[<a href=\"https:\/\/docs.mtu.edu\/pages\/createpage.action?spaceKey=services&amp;title=GNIS_NAME&amp;linkCreation=true&amp;fromPageId=6259319\">GNIS_NAME<\/a>] &amp; &#8220;_&#8217;NHD&#8217;_&#8221; &amp;\u00a0[<a href=\"https:\/\/docs.mtu.edu\/pages\/createpage.action?spaceKey=services&amp;title=OBJECTID&amp;linkCreation=true&amp;fromPageId=6259319\">OBJECTID<\/a>]<\/strong>\u00a0\u00a0Replace &#8216;<strong>NHD<\/strong>&#8216; with the three-digit HUC prefix of the watershed you are working in (Lake Michigan is 403). The output will consist of something like &#8220;Wescott Lake_403_7&#8221; for records with a lake name, and &#8220;_403_17&#8221; for records where the lake was unnamed.<\/p>\n<p>Next, perform a spatial join on your\u00a0<strong>InflowOutflow<\/strong>\u00a0points layer (created in the\u00a0<strong>intersect<\/strong>\u00a0step above).<strong>\u00a0Right-click<\/strong>\u00a0on this layer, and choose\u00a0<strong>Joins and Relates &gt; Join.\u00a0<\/strong>Set the join type to\u00a0<strong>&#8220;Join data from another layer based on spatial location&#8221;<\/strong>\u00a0and choose your\u00a0<strong>lakes<\/strong>\u00a0layer (<strong>NHDWaterbody<\/strong>\u00a0with the\u00a0<strong>UniqueName<\/strong>\u00a0field added) as the layer to join to your points. Under\u00a0<strong>2.\u00a0<\/strong>in the<strong>\u00a0Join Data<\/strong>window, set the relationship to\u00a0<strong>is closest to it.<\/strong>\u00a0(leaving the relationship set to the default it falls inside will result in\u00a0<strong>no results<\/strong>\u00a0(the points are not in the lakes, but on their borders). Name your output layer as something that makes sense (InflowOutflow_Lake_names) and save it in your file geodatabase.<\/p>\n<h4 id=\"DetermininglakeinflowsandoutflowsinNHDdata-Summarizeresults\"><strong><em>Summarize results<\/em><\/strong><\/h4>\n<p>Open the\u00a0attribute\u00a0table of your output file (<strong>InflowOutflow_Lake_Names<\/strong>). Find the\u00a0<strong>UniqueName<\/strong>\u00a0field and sort it (either ascending or descending) and look a the results. You should find multiple instances of many records (lakes with more than one inlet or outlet). All\u00a0<strong>Distance<\/strong>\u00a0values should be\u00a0<strong>0<\/strong>.<\/p>\n<p><strong>Right-click<\/strong>\u00a0on the field\u00a0<strong>UniqueName<\/strong>\u00a0and choose\u00a0<strong>Summarize<\/strong>. Choose the\u00a0<strong>output destination<\/strong>\u00a0(your file geodatabase unzipped or created above) and click\u00a0<strong>OK<\/strong>. Answer\u00a0<strong>Yes<\/strong>\u00a0when prompted to add the summary table to the map. The resulting table will have one record for each lake (as found in\u00a0<strong>UniqueName<\/strong>) and a\u00a0<strong>Count_UniqueName<\/strong>\u00a0value that summarizes the number of records of each\u00a0<strong>UniqueName<\/strong>\u00a0in your\u00a0<strong>InflowOutflow_Lake_Names<\/strong>\u00a0database. This\u00a0<strong>Count<\/strong>\u00a0value shows the number of streams entering or leaving each lake.<\/p>\n<h4 id=\"DetermininglakeinflowsandoutflowsinNHDdata-(Optional)LabellakeswithInflow\/Outflowcounts\"><strong><em>(Optional) Label lakes with Inflow \/ Outflow counts<\/em><\/strong><\/h4>\n<p>As a last step you can join the summary table (created in the last step) to your lakes layer (<strong>NHDWaterbody<\/strong>) to label each lake with its total inflows and outflows. This join should be on the common field\u00a0<strong>UniqueName<\/strong>. Be sure to\u00a0<strong>Join attributes from a table<\/strong>, not\u00a0<strong>Join data from another layer based on spatial location<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Obtain data Download a pre-staged file geodatabase for HUC subregion(s) of interest from\u00a0http:\/\/nhd.usgs.gov\/data.html\u00a0and extract the contents of the download. Prepare data In ArcGIS, add the feature classes\u00a0NHDWaterbody,\u00a0NHDFlowline, and\u00a0WBD\\HU8\u00a0to your map. If you wish to work with lakes and ponds only, &hellip; <a href=\"https:\/\/www.gis.mtu.edu\/?p=607\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,4],"tags":[64,38,80,79],"class_list":["post-607","post","type-post","status-publish","format-standard","hentry","category-how-to","category-information","tag-how-to-2","tag-howto","tag-hydro","tag-nhd"],"_links":{"self":[{"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=\/wp\/v2\/posts\/607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=607"}],"version-history":[{"count":3,"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=\/wp\/v2\/posts\/607\/revisions"}],"predecessor-version":[{"id":609,"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=\/wp\/v2\/posts\/607\/revisions\/609"}],"wp:attachment":[{"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gis.mtu.edu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}