02.06.2013 Views

Baldwin County Wetland Conservation Plan - Alabama Department ...

Baldwin County Wetland Conservation Plan - Alabama Department ...

Baldwin County Wetland Conservation Plan - Alabama Department ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Baldwin</strong> <strong>County</strong> <strong>Wetland</strong> <strong>Conservation</strong> <strong>Plan</strong> Final Summary Document<br />

This piece of code identifies the wetland polygons which were subjected to fire, prepares a place in<br />

the database for data that conveys this information, adds the data to the database, and refreshes the<br />

on-screen view.<br />

Programmed macros will also allow wetland polygon attributes to be searched for key<br />

information, such as HGM classification. The following code contains a structured query language<br />

(SQL) statement which searches the database for the requested information:<br />

'*********************************************************************************************<br />

***Public Sub SelectFeaturesSQL() Declare variables, set<br />

active<br />

Dim pMxDoc As IMxDocument map layer, search table<br />

Dim pMap As Imap using SQL statement.<br />

Dim pActiveView As IActiveView<br />

Dim pFeatureLayer As IFeatureLayer<br />

Dim pFeatureSelection As IFeatureSelection<br />

Dim pQueryFilter As IQueryFilter<br />

Dim pLayer As ILayer<br />

Set pMxDoc = Application.Document<br />

Set pMap = pMxDoc.FocusMap<br />

Set pActiveView = pMap<br />

Set pLayer = pMxDoc.FocusMap.Layer(2)<br />

If Not TypeOf pLayer Is IFeatureLayer Then Exit Sub<br />

Set pFeatureLayer = pLayer<br />

Set pFeatureSelection = pFeatureLayer<br />

Set pQueryFilter = New QueryFilter<br />

Dim s1 As String<br />

Dim sQs As String<br />

s1 = "d"<br />

sQs = "HGM LIKE '%" & s1 & "%'"<br />

pQueryFilter.whereClause = sQs<br />

pFeatureSelection.SelectFeatures pQueryFilter, esriSelectionResultNew, False<br />

pActiveView.Refresh<br />

End Sub<br />

'*********************************************************************************************<br />

***<br />

This code selects all polygons that contain a lower case “d” in the HGM classification, which is an<br />

indicator of ditched wetlands. This programming can be coupled with other code to attach data to<br />

the selected polygons attributes.<br />

The last example of critical code for the model is essentially an “if then” scenario. A<br />

procedure was written to examine the acreage of wetland polygons and to then assign values to the<br />

attribute table accordingly (e.g., if a polygon is < 1 acre, then it scores 2; >1 acre scores 4; >10 acres<br />

scores 6; >100 acres scores 8). This is a primary component of each model. The following code<br />

accomplishes this task:<br />

'*********************************************************************************************<br />

***Public Sub PopulateAcres_Rate() Declaration of variables.<br />

Dim pDoc As IMxDocument<br />

Dim pMap As IMap<br />

Dim unknFeatLayer As IFeatureLayer<br />

Dim unknFeatClass As IFeatureClass<br />

23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!