Event Indexing Service
Description
The WATERS indexing engine allows applications to programmatically index features to the medium resolution National Hydrography Dataset and to create RAD-ready event records.
Capabilities:
Version 2.0-
Point Indexing - Creates a point event on the NHD linear feature.
-
Polygon/Area Intersection Indexing - Creates events from
NHD features intersecting with a provided polygon or multipolygon.
When indexing a portion of a waterbody having artificial paths not
also included in the selection, a point event is created on the closest
artificial path.
-
Traversal Indexing - Creates events between two points by
traversing the NHD flowline network using geometric analysis to create
connections between NHD features. Due to the intensive calculations
and potential for the indexer to wander long distances in search of
the connection between two points, this indexing type should only be
used over small distances or on subsets of the NHD network such as
beaches.
-
Point to Point Indexing - Utilizes the
Upstream/Downstream Navigation Service
to select all intervening features between two points. The points
must occur on traversable linear NHD features and be upstream or downstream
of each other.
-
Upstream Mainline Indexing - Utilizes the
Upstream/Downstream Navigation Service
to select all NHD features upstream along the NHD Plus defined mainline
of the flow. Use the flow distance and flow time parameters
to limit the amount of features chosen in the traversal.
-
Upstream with Tributaries Indexing - Utilizes the
Upstream/Downstream Navigation Service
to select all NHD features upstream. Use the flow distance and
flow time parameters to limit the amount of features chosen in the
traversal.
-
Downstream Mainline Indexing - Utilizes the
Upstream/Downstream Navigation Service
to select all NHD features downstream along the NHD Plus defined mainline
of the flow. Use the flow distance and flow time parameters
to limit the amount of features chosen in the traversal.
-
Downstream with Divergences Indexing - Utilizes the
Upstream/Downstream Navigation Service
to select all NHD features downstream. Use the flow distance
and flow time parameters to limit the amount of features chosen in
the traversal.
The output is a standardized event object intended to be ready for loading in the Reach Address Database. The service currently only returns the point, line and area events. The user is expected to load the metadata objects with the proper information regarding the indexing process before submission.
Usage Scenarios
Nonpoint Source Grants
|
Problem Statement
Need to collect the spatial extent of nonpoint source grant projects and allow them to be easily discovered by network upstream/downstream traces and other NHD tools. Desired InformationNHD RAD standard event table records based on a user defined, heads up digitized or HUC boundary selected area. Information Returned from ServiceNHD line and area event records for the user defined area. |
Beach Indexing
|
Problem Statement
Need to collect normalized beach location and size information from each beach manager and store the results in the NHD RAD. Desired InformationNHD RAD standard event table records based on either a user selecting the endpoints of the beach or from user collected points representing the endpoints of the beach. Information Returned from ServiceNHD line event records for coastline NHD reaches only which correspond to the coastline between the two endpoints. |
Input
Parameters
Attributes of the nhd_indexing_input object
| Parameter | Datatype | Description |
|---|---|---|
| pBatchId | Number | Meaningful identification number for the indexing submission.
All batch parameters are repeated in the output object. |
| pBatchName | String | Meaningful identification name for the submission. |
| pBatchDate | String | Meaningful date related to the submission. |
| pBatchDateMod | String | Modifier explaining the pBatchDate complex object. See the complex object modifier descriptions for more information. |
| pBatchProgram | Integer | Integer value indicating the program for which the batch of events has been created. See RAD Programs for values of each program. |
| pBatchComments | String | Comments related to the submission. |
| pBatchSmdate | String | Date of the most current reachsmdate to be used as
a check in the future to make sure the index submitter and the indexing
service are using the same NHD version. |
| pBatchSmdateMod | String | Modifier explaining the pBatchSmdate complex object. See the complex object modifier descriptions for more information. |
| pBatchResolution | Number | Numeric integer of the NHD resolution to be used.
For medium resolution NHD this will always be 3 while high resolution
is indicated with a 2. |
| pSourceOriginator |
String | Abbreviated name of the organization submitting the
event. |
| pSourceDatadesc | String | Attribute value being indexed. |
| pSourceFeatureid | String | The critical source_featureid key used to tie the indexing submission events to records in the source program database. |
| pFeaturedetailurl | String | The featuredetailurl value to use for the event. |
| pComidBase |
Number | The starting value from which the comid of events will
be sequentially numbered. |
| pCycleYear | String | For programs using a cycle year. |
| pStartDate | String | For programs using a start date. |
| pStartDateMod | String | Modifier explaining the pStartDate complex object. See the complex object modifier descriptions for more information. |
| pEndDate | String | For submitting events which are historical and no longer current. |
| pEndDateMod | String | Modifier explaining the pEndDate complex object. See the complex object modifier descriptions for more information. |
| pIndexingType |
String | Keyword indicating the type of indexing to perform.
If left empty, the indexer will try to guess the indexing type desired
based on the input geometry type. Current valid values are:
|
| pInputGeometry | String | The geometry used for indexing. Polygon indexing requires a polygon or multipolygon, point indexing requires a single point while point2point indexing requires a two element multipoint. Geometry must utilize Oracle SRID 8265 or 4269 to match NHD standards. |
| pInputGeometryMod | String | Modifier explaining the geometry format used in pInputGeometry. See the complex object modifier descriptions for more information. |
| pReachSelectionLower | Number | Lower threshold for pruning a reach during indexing. A lower threshold of 10 would require the indexing process to ignore any reaches where under 10% of the reach has been selected. |
| pReachSelectionUpper | Number | Upper threshold for expanding the selection to the entire reach. An upper threshold of 90 would require the indexing process to include the complete reach if at least 90% of the reach was selected. |
| pFeatureSelection | String | 'CLIP', 'WHOLE_FLWB' or 'WHOLE_REACH' flag indicating whether returned events will be clipped to the indexing object, return whole flowlines and/or waterbodies or return whole reaches. The default value is 'CLIP'. |
| pFeatureType | String | 'BOTH', 'FLOWLINE' or 'WATERBODY' flag indicating whether the indexing selection will return flowlines or waterbodies exclusively. This flag is meant for specific programs like BEACHES which do not include specific reach categories such as waterbodies. The default value is 'BOTH'. |
| pFcodeAllow |
String | Array of one or more fcodes to allow in the indexing output. The default value is a NULL array. |
| pFcodeAllowMod | String |
Modifier explaining the array format used in pFcodeAllow. See the complex object modifier descriptions for more information. |
| pFcodeDeny | String |
Array of one or more fcodes to exclude from the indexing output. The default value is a NULL array. |
| pFcodeDenyMod | String |
Modifier explaining the array format used in pFcodeDeny. See the complex object modifier descriptions for more information. |
| pFlowDistance | Number | Maximum distance traversed in kilometers for selecting features using Upstream/Downstream services. |
| pFlowTime | Number | Maximum flow time traversed in hours for selecting features using Upstream/Downstream services. |
| pTraverseDistance | Number |
Maximum distance a traversal indexing action will travel before stopping. The default value is 50 KM. |
| pTraverseTolerance | Number |
Distance in KM to use when making connections between flowlines. Intended to be used in cases where NHD features are not correctly touching. The default value is 0 meaning it should be used only in special circumstances. |
| pTraverseFcodeAllow | String |
Array of one or more fcodes to include in the indexing output. The default value is a NULL array. |
| pTraverseFcodeAllowMod | String |
Modifier explaining the array format used in pTraverseFcodeAllow. See the complex object modifier descriptions for more information. |
| pTraverseFcodeDeny | String | Array of one or more fcodes to exclude from the indexing output. The default value is a NULL array. |
| pTraverseFcodeDenyMod | String | Modifier explaining the array format used in pTraverseFcodeDeny. See the complex object modifier descriptions for more information. |
HTTP Service Notes
Additional parameters specific to HTTP services are listed in the WATERS HTTP Services documentation.SOAP Service Notes
The parameter listing for SOAP services is slightly different. Array parameters are not followed by a "mod" parameter as the array format is specified by the WSDL documentation. For SOAP services, the input geometry parameter is always Open Geospatial ConsortiumOutput
UML Diagram
Return Object
nhd_indexing_point object
| Column | Datatype | Description |
|---|---|---|
| comid | Number | The comid of event record. This is an unique integer identifying
the record. Note this is not related to the comid of any NHD feature. |
| eventdate | String | The date the event was created or updated. This value is taken
from the batch_date attribute in input object. |
| event_type | String | Integer value indicating the program for which the event has been created. See RAD Programs for values of each program. |
| reachcode | String | The reach code value of the NHD hydrologic feature the event occurs
upon. This value is derived from the NHD record used in indexing the event. |
| reachsmdate | String | Date that the NHD reach code was assigned thus tying the event to
a specific version of the NHD. This value is derived from the
reachsmdate stored in the nhdreachcode_comid table of the NHD dataset
used in indexing. |
| reachresolution | String | Value indicating the resolution of the NHD feature the event occurs upon. This value is derived from the reachresolution value in the input object. |
| featurecomid | String | Value derived from the featurecomid field in the input object. |
| featureclassref | String | Value derived from the featureclassref field in the input object. |
| source_originator | String | Abbreviated name of the organization submitting the event. Value derived from the source_originator field in the input object. |
| source_datadesc | String | Attribute value being indexed. Value derived from the source_datadesc field in the input object. |
| source_featureid | String | Foreign key to external program database. Value derived from the source_datadesc field in the input object. |
| featuredetailurl | String | Value derived from the featuredetailurl field in the input object. |
| offset | Number | Unimplemented/Unused locational feature which could be used to move
events a given distance left or right of a linear hydrology feature. |
| measure | Number | The measure of the point event on the linear hydrology reach feature. |
| cycle_year | String | The cycle year of the event data being submitted. |
| start_date | String | The start date of the event data being submitted. |
| end_date | String | The end date of the event data being submitted. |
| rid | String | The geometry of the event. |
| objectid | String | A unique integer identifying the record. |
| nhd_indexing_line | Array of Object | Object Type: nhd_indexing_line |
| nhd_indexing_area | Array of Object | Object Type: nhd_indexing_area |
| nhd_indexing_evt2meta | Array of Object | Object Type: nhd_indexing_evt2meta |
| nhd_indexing_metadata | Array of Object | Object Type: nhd_indexing_metadata |
Supporting Objects
Attributes of the nhd_indexing_line object
| Column | Datatype | Description |
|---|---|---|
| comid | Number | The comid of event record. This is an unique integer identifying
the record. Note this is not related to the comid of any NHD feature. |
| eventdate | String | The date the event was created or updated. This value is taken
from the batch_date attribute in input object. |
| event_type | String | Integer value indicating the program for which the event has been created. See RAD Programs for values of each program. |
| reachcode | String | The reach code value of the NHD hydrologic feature the event occurs
upon. This value is derived from the NHD record used in indexing
the event. |
| reachsmdate | String | Date that the NHD reach code was assigned thus tying the event to
a specific version of the NHD. This value is derived from the
reachsmdate stored in the nhdreachcode_comid table of the NHD dataset
used in indexing. |
| reachresolution | String | Value indicating the resolution of the NHD feature the event occurs upon. This value is derived from the reachresolution value in the input object. |
| featurecomid | String | Value derived from the featurecomid field in the input object. |
| featureclassref | String | Value derived from the featureclassref field in the input object. |
| source_originator | String | Abbreviated name of the organization submitting the event. Value derived from the source_originator field in the input object. |
| source_datadesc | String | Attribute value being indexed. Value derived from the source_datadesc field in the input object. |
| source_featureid | String | Foreign key to external program database. Value derived from the source_datadesc field in the input object. |
| featuredetailurl | String | Value derived from the featuredetailurl field in the input object. |
| offset | Number | Unimplemented/Unused locational feature which could be used to move
events a given distance left or right of a linear hydrology feature. |
| fmeasure | Number | The start measure of the point event on the linear hydrology reach feature. |
| tmeasure | Number | The end measure of the point event on the linear hydrology reach feature. |
| shape_length | Number | The length of line event feature in meters. |
| cycle_year | String | The cycle year of the event data being submitted. |
| start_date | String | The start date of the event data being submitted. |
| end_date | String | The end date of the event data being submitted. |
| shape | String | The geometry of the event. |
| objectid | String | A unique integer identifying the record. |
Attributes of the nhd_indexing_area object
| Column | Datatype | Description |
|---|---|---|
| comid | Number | The comid of event record. This is an unique integer identifying the record. Note this is not related to the comid of any NHD feature. |
| eventdate | String | The date the event was created or updated. This value is taken from the batch_date attribute in input object. |
| event_type | String | Integer value indicating the program for which the event has been created. See RAD Programs for values of each program. |
| reachcode | String | The reach code value of the NHD hydrologic feature the event occurs upon. This value is derived from the NHD record used in indexing the event. |
| reachsmdate | String | Date that the NHD reach code was assigned thus tying the event to
a specific version of the NHD. This value is derived from the
reachsmdate stored in the nhdreachcode_comid table of the NHD dataset
used in indexing. |
| reachresolution | String | Value indicating the resolution of the NHD feature the event occurs upon. This value is derived from the reachresolution value in the input object. |
| featurecomid | String | Value derived from the featurecomid field in the input object. |
| featureclassref | String | Value derived from the featureclassref field in the input object. |
| source_originator | String | Abbreviated name of the organization submitting the event. Value derived from the source_originator field in the input object. |
| source_datadesc | String | Attribute value being indexed. Value derived from the source_datadesc field in the input object. |
| source_featureid | String | Foreign key to external program database. Value derived from the source_datadesc field in the input object. |
| featuredetailurl | String | Value derived from the featuredetailurl field in the input object. |
| shape_area | Number | The area of line event feature in square kilometers. |
| cycle_year | String | The cycle year of the event data being submitted. |
| start_date | String | The start date of the event data being submitted. |
| end_date | String | The end date of the event data being submitted. |
| shape | String | The geometry of the event. |
| objectid | String | A unique integer identifying the record. |
Attributes of the nhd_indexing_evt2meta object
| Column | Datatype | Description |
|---|---|---|
| comid | Number | Unique numeric identification number for the event. |
| duuid | Number | Unique numeric identification number for the metadata record. |
Attributes of the nhd_indexing_metadata object
| Column | Datatype | Description |
|---|---|---|
| duuid | Number | Unique numeric identification number for the metadata record. |
| processdescription | String | Process used to create the event data. |
| processdate | String | Date the event data was processed. |
| attributeaccuracyreport | String | Attribute accuracy of event data. |
| logicalconsistencyreport | String | Logical consistency of event data. |
| completenessreport | String | Completeness description of event data. |
| horizpositionalaccuracyreport | String | Horizontal positional accuracy of event data. |
| vertpositionalaccuracyreport | String | Vertical positional accuracy of event data. |
| metadatastandardname | String | Metadata standard name. |
| metadatastandardversion | String | Metadata standard version. |
| metadatadate | String | Date metadata records was created or modified. |
| datasetcredit | String | Credit for the dataset. |
| contactorganization | String | Name of the organization responsible for the metadata record. |
| addresstype | String | Type of address given (mail/physical). |
| address | String | Address of contact person. |
| city | String | City of contact person. |
| stateorprovince | String | State of contact person. |
| postalcode | String | Zip Code or Postal Code of contact person. |
| contactvoicetelephone | String | Phone number of contact person. |
| contactinstructions | String | Special instructions for the contact person. |
| contactemailaddress | String | Email Address of contact person. |
HTTP Service Notes
The output format for this service is JSON with GEOJSON formatted geometries.
SOAP Service Notes
The SOAP service returns
OGC GML 2.1
formatted geometries.
Javascript Library
| Function Name |
|---|
| WATERS.Services.EventIndexingService |
HTTP Service
| Resource | Location |
|---|---|
| Runtime Endpoint | http://oaspub.epa.gov/waters10/waters_services/eventIndexingService |
Web Service (SOAP)
EPA hosted Oracle Application Servers currently utilize an older version of Oracle Containers for J2EE (OC4J). The SOAP endpoints generated for OC4J by Oracle Jdeveloper have several limitations that service users should be aware of. While many service parameters take a NULL value to indicate that a particular parameter is not applicable or not to used, the service endpoint may report an error if any numeric parameters are left empty. Users may choose to either utilize the "simple" service interfaces whereby all parameters are accepted as strings or users may enter numeric values of -9999 to indicate NULL.
| Resource | Location |
|---|---|
| Runtime Endpoint | http://iaspub.epa.gov/WATERSWebServices/OWServices |
| WSDL Endpoint | http://iaspub.epa.gov/WATERSWebServices/OWServices?WSDL |
Sample SOAP Request (Oracle 10.2.0.2 OC4J):
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://iaspub.epa.gov/WATERSWebServices/OWServices"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body>
<ns1:eventIndexingService>
<pBatchId xsi:type="xsd:decimal">1.0</pBatchId>
<pBatchName xsi:type="xsd:string">testing</pBatchName>
<pBatchDate xsi:type="xsd:dateTime" xsi:nil="true"/>
<pBatchProgram xsi:type="xsd:int">1</pBatchProgram>
<pBatchComments xsi:type="xsd:string">Test Comments</pBatchComments>
<pBatchSmdate xsi:type="xsd:dateTime" xsi:nil="true"/>
<pBatchResolution xsi:type="xsd:decimal">3</pBatchResolution>
<pSourceOriginator xsi:type="xsd:string">SOrig</pSourceOriginator>
<pSourceDatadesc xsi:type="xsd:string">SData</pSourceDatadesc>
<pSourceFeatureid xsi:type="xsd:string">SFid</pSourceFeatureid>
<pFeaturedetailurl xsi:type="xsd:string" xsi:nil="true"/>
<pComidBase xsi:type="xsd:decimal">1</pComidBase>
<pCycleYear xsi:type="xsd:string">2006</pCycleYear>
<pStartDate xsi:type="xsd:dateTime" xsi:nil="true"/>
<pEndDate xsi:type="xsd:dateTime" xsi:nil="true"/>
<pIndexingType xsi:type="xsd:string">polygon</pIndexingType>
<pInputGeometry xsi:type="xsd:string">POLYGON((-87.87792204587325 42.6705722006468,-87.87792204587325 42.679659104588985,-87.92392729489035 42.68066867856352,-87.92461394039829 42.66956246263497,-87.90195463864328 42.66981489867542,-87.87792204587325 42.6705722006468))</pInputGeometry>
<pInputGeometrySrid xsi:type="xsd:decimal">8265</pInputGeometrySrid>
<pReachSelectionLower xsi:type="xsd:decimal" xsi:nil="true"/>
<pReachSelectionUpper xsi:type="xsd:decimal" xsi:nil="true"/>
<pFeatureSelection xsi:type="xsd:string" xsi:nil="true"/>
<pFeatureType xsi:type="xsd:string" xsi:nil="true"/>
<pFcodeAllow xsi:nil="true" xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:decimal[0]"/>
<pFcodeDeny xsi:nil="true" xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:decimal[0]"/>
<pFlowDistance xsi:type="xsd:decimal">5.0</pFlowDistance>
<pFlowTime xsi:type="xsd:decimal" xsi:nil="true"/>
<pTraverseDistance xsi:type="xsd:decimal">5.0</pTraverseDistance>
<pTraverseTolerance xsi:type="xsd:decimal" xsi:nil="true"/>
<pTraverseFcodeAllow xsi:nil="true" xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:decimal[0]"/>
<pTraverseFcodeDeny xsi:nil="true" xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:decimal[0]"/>
<pTolerance xsi:type="xsd:decimal">0.05</pTolerance>
</ns1:eventIndexingService>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Sample Soap Response:
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:eventIndexingServiceResponse
xmlns:ns1="http://iaspub.epa.gov/WATERSWebServices/OWServices"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<return
xmlns:ns2="http://waters-waters/OWServices.xsd"
xsi:type="ns2:waters_waters_NhdIndexingOutputUser"
>
<evt2meta xsi:type="ns2:waters_waters_NhdIndexingEvt2metaList">
<array xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:Array" ns3:arrayType="ns2:waters_waters_NhdIndexingEvt2metaUser[0]">
</array>
</evt2meta>
<batchName xsi:type="xsd:string">testing</batchName>
<batchSmdate xsi:type="xsd:dateTime" xsi:nil="true"/>
<batchId xsi:type="xsd:decimal">1</batchId>
<lineEvents xsi:type="ns2:waters_waters_NhdIndexingLineList">
<array xmlns:ns4="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:Array" ns4:arrayType="ns2:waters_waters_NhdIndexingLineUser[1]">
<item xsi:type="ns2:waters_waters_NhdIndexingLineUser">
<featureclassref xsi:type="xsd:int" xsi:nil="true"/>
<startDate xsi:type="xsd:dateTime" xsi:nil="true"/>
<cycleYear xsi:type="xsd:string" xsi:nil="true"/>
<shape xsi:type="xsd:string"><gml:LineString srsName="SDO:8265" xmlns:gml="http://www.opengis.net/gml"><gml:coordinates decimal="." cs="," ts=" ">-87.9163693742,42.677299467 -87.9148811075,42.6767512003 -87.9130519075,42.676294267 -87.9117803742,42.6756086003 -87.9105403075,42.675128667 -87.9098891742,42.675014667 -87.9093931742,42.6749920003 -87.9088353075,42.6751294003 -87.9068209742,42.675976267 -87.9050855742,42.6770060003 -87.9043727742,42.6772808003 -87.9035049075,42.677303867 -87.9026369075,42.677235467 -87.9009321075,42.6776934003 -87.9004363075,42.678059467 -87.9004055075,42.678242467 -87.9003125075,42.678311067 -87.9002195742,42.6785398003 -87.8999405742,42.6787000003 -87.8992585742,42.6787460003 -87.8988557075,42.678631667 -87.8985143742,42.678357267 -87.8980803075,42.6781058003 -87.8972123075,42.6779458003 -87.8929343742,42.678015467 -87.8914153742,42.677947067 -87.8902063742,42.6779244003 -87.8872615076,42.678130667 -87.8859285742,42.6781308003 -87.8853395076,42.6778336003 -87.8851535076,42.677559067 -87.8851223076,42.6770560003 -87.8849053076,42.676735667 -87.8847191742,42.6764842003 -87.8845641742,42.676095267 -87.8845019742,42.6754778003 -87.8845949742,42.674951667 -87.8845947742,42.6741740003 -87.8839747742,42.6741054003 -87.8833859076,42.673968267 -87.8828587742,42.6736938003 -87.8823629076,42.6736024003 -87.8818669076,42.6736024003 -87.8805649742,42.674014267 -87.8801311076,42.6743574003 -87.8795421076,42.674631867 -87.8783641742,42.674906467 -87.8772793742,42.6752496003 -87.8758535742,42.675821467 -87.8750785742,42.675821467 -87.8748925076,42.6758444003 -87.8742725742,42.6755928003 -87.8732807076,42.674975267 -87.8724437743,42.6745406003 -87.8722577743,42.6745178003 </gml:coordinates></gml:LineString></shape>
<reachcode xsi:type="xsd:string">04040002000103</reachcode>
<comid xsi:type="xsd:decimal" xsi:nil="true"/>
<offset xsi:type="xsd:decimal">0</offset>
<sourceDatadesc xsi:type="xsd:string" xsi:nil="true"/>
<objectid xsi:type="xsd:int" xsi:nil="true"/>
<sourceOriginator xsi:type="xsd:string" xsi:nil="true"/>
<tmeasure xsi:type="xsd:decimal">100</tmeasure>
<sourceFeatureid xsi:type="xsd:string" xsi:nil="true"/>
<eventdate xsi:type="xsd:dateTime" xsi:nil="true"/>
<shapeLength xsi:type="xsd:decimal" xsi:nil="true"/>
<featuredetailurl xsi:type="xsd:string" xsi:nil="true"/>
<featurecomid xsi:type="xsd:int" xsi:nil="true"/>
<fmeasure xsi:type="xsd:decimal">0</fmeasure>
<endDate xsi:type="xsd:dateTime" xsi:nil="true"/>
<reachresolution xsi:type="xsd:int">3</reachresolution>
<geogstate xsi:type="xsd:string" xsi:nil="true"/>
<eventType xsi:type="xsd:int" xsi:nil="true"/>
<reachsmdate xsi:type="xsd:dateTime" xsi:nil="true"/>
</item>
</array>
</lineEvents>
<metadata xsi:type="ns2:waters_waters_NhdIndexingMetadataList">
<array xmlns:ns5="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns5:Array" ns5:arrayType="ns2:waters_waters_NhdIndexingMetadataUser[0]">
</array>
</metadata>
<areaEvents xsi:type="ns2:waters_waters_NhdIndexingAreaList">
<array xmlns:ns6="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns6:Array" ns6:arrayType="ns2:waters_waters_NhdIndexingAreaUser[0]">
</array>
</areaEvents>
<errorCode xsi:type="xsd:decimal">0</errorCode>
<batchProgram xsi:type="xsd:int" xsi:nil="true"/>
<batchDate xsi:type="xsd:dateTime" xsi:nil="true"/>
<pointEvents xsi:type="ns2:waters_waters_NhdIndexingPointList">
<array xmlns:ns7="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns7:Array" ns7:arrayType="ns2:waters_waters_NhdIndexingPointUser[0]">
</array>
</pointEvents>
<errorMessage xsi:type="xsd:string" xsi:nil="true"/>
<batchResolution xsi:type="xsd:int" xsi:nil="true"/>
<batchComments xsi:type="xsd:string">Test Comments</batchComments>
</return>
</ns1:eventIndexingServiceResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Database Service
| Database Instance | Schema | Resource |
|---|---|---|
| WATERS10 | ow_service | nhd_indexing_service.event_indexing_main |
Users with schema accounts on the EPA waters10 database instance may directly access the NHD event indexing service via a stored procedure interface. Input and output is managed via the objects described below. Callers need to create, submit, receive and interpret these objects for their own needs. Note that the upstream/downstream service code utilizes internal DDL statements such that the NHD event indexing service must be called as a PL/SQL procedure rather than embedded as a function within SQL.
Database Service Example:
-- Create a table to hold your results
CREATE TABLE indexing_results (input CLOB, output CLOB);
-- Run the indexing service
DECLARE
sdo_interest MDSYS.SDO_GEOMETRY;
obj_input ow_service.nhd_indexing_input;
obj_output ow_service.nhd_indexing_output;
clb_input CLOB;
clb_output CLOB;
BEGIN
-----------------------------------------------
-- Step 1
-- Define the area of interest
-----------------------------------------------
sdo_interest := SDO_GEOMETRY(
2003,
8265,
NULL,
SDO_ELEM_INFO_ARRAY(1,1003,1),
SDO_ORDINATE_ARRAY(-87.84,42.66,
-87.86,42.65,
-87.84,42.64,
-87.82,42.66,
-87.84,42.66)
);
-----------------------------------------------
-- Step 2
-- Create the input object
-----------------------------------------------
obj_input := ow_service.nhd_indexing_input();
obj_input.batch_id := 1;
obj_input.batch_program := 11; -- GRTS Program
obj_input.batch_resolution := 3; -- Medium Resolution NHD
obj_input.source_featureid := 'foo';
obj_input.source_originator := 'me';
obj_input.cycle_year := TO_DATE('04/01/2008','MM/DD/YYYY');
obj_input.start_date := TO_DATE('08/15/2008','MM/DD/YYYY');
obj_input.indexing_type := 'polygon';
obj_input.input_geometry := sdo_interest;
-----------------------------------------------
-- Step 3
-- Run the database service
-----------------------------------------------
-- Tolerance settings can be lowered if using high resolution NHD
-- but generally 0.05 should work for most applications
ow_service.nhd_indexing_service.event_indexing_main(
obj_input,
0.05,
obj_output
);
-----------------------------------------------
-- Step 4
-- Serialize the input and output into CLOBs
-----------------------------------------------
clb_input := XMLTYPE(obj_input).getClobVal();
clb_output := XMLTYPE(obj_output).getClobVal();
-----------------------------------------------
-- Step 5
-- Pop values into the table
-----------------------------------------------
EXECUTE IMMEDIATE
'INSERT INTO indexing_results VALUES(:p01,:p02)'
USING clb_input,clb_output;
COMMIT;
END;
-- Then inspect the results in the indexing_results table.
-- Note that empty attributes and child objects will not be represented in the serialized XML.
Changelog
![[logo] US EPA](http://www.epa.gov/epafiles/images/logo_epaseal.gif)