Supported with:
- Engine
- ArcView
- ArcEditor
- ArcInfo
- Server
Library dependencies: System, SystemUI, Geometry, Display, Server, Output, Geodatabase, GISClientAdditional library information: Contents,
Object Model Diagram
The ArcWeb library contains objects used for accessing ArcWeb Services. ArcWeb Services are hosted Web services that include map data and on-demand geospatial capabilities needed to add real-time locations, addresses, points of interest, dynamic maps, and routing directions to Web and wireless applications. Map data storage, maintenance, and updates are handled by ESRI, eliminating up-front map database, geospatial software, and ongoing maintenance expenses. For complete information on ArcWeb Services you should see the ArcWEb Services web site;
http://www.arcwebservices.com/v2006/help/index.htm.
ArcWeb Services has multiple APIs for developers, who are experinced with Web development and one or more of SOAP, REST, Mobile Toolkit, or OpenLS. This ArcObjects library was created by using COM Objects to wrap the ArcWeb Services functionality so for ArcGIS developers, who are familiar with programming ArcObjects. By exposing this functionality with ArcObjects, ArcGIS developers can quickly understand and use the new functionality provided. Since these ArcObjects are available in all of the supported environments, developers will be able to intergrate these capabilities into their existing products, using their development environment.
If you think of ArcWeb Services as a remote database, you can see some similaites. With a dataabse you would be logging into it, and then choosing the dataset or layer to work with. This can also be done with ArcWeb Services, while you do the same which has multiple datasets, and data layers, but also a variety of GIS functionality or services. The objects that implement this functionality are grouped into a number of library subsystems. These library subsystems are:
The objects that implement this functionality are grouped into a number of library subsystems. These library subsystems are:Connection Objects
Utilizing ArcWeb Services requires that a connection be established first. The ArcObjects used for this are include both user-interface and non GUI connection object. The ArcwebConnection Object is used mainly to establish and end the connection. The ArcwebConnection dialogs provide simple dialogs to use in setting up the connection. The connection is the simplest part of the system since it is just a matter of opening a session with the AtcWeb Services, maintaining the connection, and closing the connection when finished. It is important to ensure that your customization, is prepared for and can recover from a disconnection with the server, since the ArcWeb Services has a inactivity timeout policy. The connection can also be an issue when your application may access data or functionality that is restricted to certain users.
Non-GUI connection
The ArcWeb Services library contains a connection object that can be instantiated and the used to connect and disconnect without any user interface. This object can also be used do perform the connection in conjunction with your own customized connection GUI.
[VB.NET]
Dim pAWConnect As IArcWebConnection
Dim pcancel As ITrackCancel
pAWConnect = New ArcWebConnection
pcancel = New CancelTracker
pAWConnect.Connect("yourusername", "yourpassword", False, pcancel)
MessageBox.Show(pAWConnect.Valid)
[C#]
IArcWebConnection pAWConnect = new ArcWebConnectionClass() ;
ITrackCancel pcancel = new CancelTrackerClass();
pAWConnect.Connect("yourusername", "yourpassword", false, pcancel);
Boolean bvalid = pAWConnect.Valid;
String stest = bvalid.ToString();
MessageBox.Show(stest);
Connection with ESRI's GUI
The ArcWeb services library contains a ConnectDialog class which can be used to prompt the user for a username and password, and perform the connection.
[VB.NET]
Dim pAWConnDialog As IArcWebConnectDialog
Dim bConnected As Boolean
pAWConnDialog = New ArcWebConnectDialog
bConnected = pAWConnDialog.DoModal(Me.Handle)
[C#]
IArcWebConnectDialog pAWConnDialog = new ArcWebConnectDialogClass();
Boolean bConnected = pAWConnDialog.DoModal( 0);
AddressFinder Objects
Address Finder Service offers geocoding and reverse geocoding for your Internet applications. You can use Address Finder Web Service to input a street address, phone number, or IP address and receive a candidate list and associated x,y coordinates. You can also use this Web Service to input x,y coordinates and receive a street address. The addressfinder objects include objects for the input, the options, the addressfinder object, and the results from the finder. The options provides the abitlity to set the datasource, snaptype, number of results to return, and whether to use partial address. The AddressfinderMapping object is used to provide the linkage between a table of addresses to find and the fields in the table that contain the address information. The ArcWebAddressFinder object has 5 different find methods which each use a different type of input to return a location(s) or address. There are 2 methods for retrieving information on the data so the available datasources for the finder can be found at runtime
Results are typically a Location with Address or just an Address.
AddressFinder Datasources
ArcWeb Services has vast amounts of data content available. In order to determine the best datasource for your address finding operation one needs decide whether to use public data or not, and if the country or part of world is contained by the datasource. The ArcWebDataSourceInfo contains the requested information about a geocoding data source. Use the GetSupportedDataSources to get the list of datasource that support address finding, which can be with the GetDataSourceInfo method to determine the properties of the datasource. These properties will be useful in determining the best datasource(s) to use. The properties of the datasource will include: a list of countries supported by the data source, if extended postal codes (for example, zip + 4) are supported by the data source, if partial addresses are supported by the data source, if reverse geocoding is supported by the data source, a list of reverse geocoding snap types supported by the data source. The possible snap types are "house", "intersection", or "range". House returns the nearest interpolated full street address; intersection returns the nearest intersection; and range returns the nearest street segment address range. Snap types apply to reverse geocoding (not forward geocoding).
[VB.NET]
Dim pAWAddress As IArcWebAddress
Dim pAWAddFinder As IArcWebAddressFinder
Dim pAWAFOptions As IArcWebAddressFinderOptions
Dim pAWLocationInfo As IArcWebLocationInfo
Dim pAWLocation As IArcWebLocation
pAWaddress = New ArcWebAddress
pAWAddFinder = New ArcWebAddressFinder
pAWAFOptions = New ArcWebAddressFinderOptions
pAWAFOptions.DataSource = "ArcWeb:TA.Streets.US"
'Use the Address Object to specify the address to find
pAWaddress.HouseNumber = 380
pAWaddress.City = "Redlands"
pAWaddress.Country = esriArcWebCountry.esriArcWebCountryUnitedStates
pAWaddress.Street = "New York"
pAWaddress.PostalCode = "92373"
pAWLocationInfo = pAWAddFinder.FindLocationByAddress(pAWaddress, pAWAFOptions, Nothing)
If Not pAWLocationInfo Is Nothing Then
pAWLocationInfo.EnumArcWebLocation.Reset()
pAWLocation = pAWLocationInfo.EnumArcWebLocation.Next
If Not pAWLocation Is Nothing Then
' display info using pAWLocation.Point.X
End If
End If
[C#]
IArcWebAddress pAWaddress = new ArcWebAddressClass();
IArcWebAddressFinder pAWAddFinder = new ArcWebAddressFinderClass();
IArcWebAddressFinderOptions pAWAFOptions = new ArcWebAddressFinderOptionsClass();
pAWAFOptions.DataSource = "ArcWeb:TA.Streets.US";
//Use the Address Object to specify the address to find
pAWaddress.HouseNumber = "380";
pAWaddress.City = "Redlands";
pAWaddress.Country = esriArcWebCountry.esriArcWebCountryUnitedStates ;
pAWaddress.Street = "New York";
pAWaddress.PostalCode = "92373";
IArcWebLocationInfo pAWLocationInfo = pAWAddFinder.FindLocationByAddress(pAWaddress, pAWAFOptions, null);
if ( pAWLocationInfo != null)
{
pAWLocationInfo.EnumArcWebLocation.Reset();
IArcWebLocation pAWLocation = pAWLocationInfo.EnumArcWebLocation.Next();
if ( pAWLocation != null)
{
// display info using pAWLocation.Point.X
}
}
PlaceFinder Objects
Place Finder Web Service offers "find a place" functionality for your Internet applications. Use this Web service to input a place name and receive a ranked candidate list of place names and associated coordinates. Place Finder Web Service recognizes more than three million place names including geographic regions (such as continents, states, cities), natural features, and major landmarks and points of interest.
Place Finder Web Service allows you to perform the following functions:
Input place name
Constrain search by geographic area or place type
Define the number of records to return
Filter by country
Define the type of search
There are 2 methods for retrieving information on the data so the available datasources for the finder can be found at runtime similar to those listed above with the address finder.
The PlaceFinderOptions class is used with the PlaceFinder class to define the search.
[VB.NET]
The following samples illustrate how to use the place finder objects to return a location given a placename as input.
Dim pCancel As ITrackCancel
Dim pArcWebPlaceFinder As IArcWebPlaceFinder
Dim pAWPFOptions As IArcWebPlaceFinderOptions
Dim pAWdataSourceInfo As IArcWebDataSourceInfo
Dim pawlocationinfo As IArcWebLocationInfo
Dim pAWLocation As IArcWebLocation
pCancel = New CancelTracker
pArcWebPlaceFinder = New ArcWebPlaceFinder
pAWPFOptions = New ArcWebPlaceFinderOptions
pAWPFOptions.DataSource = "ArcWeb:ESRI.Gazetteer.World"
pAWdataSourceInfo = New ArcWebDataSourceInfo
pAWLocationinfo = pArcWebPlaceFinder.Find("Yucaipa, ca", pAWPFOptions, pCancel)
pAWLocationinfo.EnumArcWebLocation.Reset()
pAWLocation = pAWLocationinfo.EnumArcWebLocation.Next
[C#]
ITrackCancel pCancel = new CancelTrackerClass() ;
IArcWebPlaceFinder pArcWebPlaceFinder = new ArcWebPlaceFinderClass() ;
IArcWebPlaceFinderOptions pAWPFOptions = new ArcWebPlaceFinderOptionsClass();
pAWPFOptions.DataSource = "ArcWeb:ESRI.Gazetteer.World";
IArcWebDataSourceInfo pAWdataSourceInfo = new ArcWebDataSourceInfoClass();
IArcWebLocationInfo pAWLocationinfo = pArcWebPlaceFinder.Find("Yucaipa, ca", pAWPFOptions, pCancel);
pAWLocationinfo.EnumArcWebLocation.Reset();
IArcWebLocation pAWLocation = pAWLocationinfo.EnumArcWebLocation.Next();
RouteFinder Objects
You can generate driving directions between multiple locations with Route Finder Web Service. This Web service accepts x,y coordinate inputs for two or more locations, along with routing preferences, and returns a route map and textual driving directions for the suggested route. Your route can also include turn-by-turn maps, traffic hazards, and "traveling salesperson routing" (optimizing the order of your route stop midpoints).
Route Finder Web Service allows you to perform the following functions:
Create list of coordinate pairs for start, end, and midpoints for a route
Specify description for points of a route
Specify returned route as textual driving directions, map image, turn-by-turn maps, or a combination
Determine whether to avoid traffic delays or other hazards
Determine if the geometry is returned
Customize the look of the route
Choose the language of the driving directions
Request traveling salesperson routing where your mid-point route stops are arranged in the most optimal order
[VB.NET]
Dim pAWRouteFinder As IArcWebRouteFinder
Dim pAWRFOptions As IArcWebRouteFinderOptions
Dim pEnumAWRStops As IEnumArcWebRouteStops
Dim pAWRInfo As IArcWebRouteInfo
Dim pARDirections As IArcWebDirections
pAWRouteFinder = New ArcWebRouteFinder
pAWRFOptions = New ArcWebRouteFinderOptions
pEnumAWRStops = New EnumArcWebRouteStops
pAWRFOptions.DataSource = "ArcWeb:TA.Streets.NA"
'Create a group of stops to use as the route
pEnumAWRStops.Add(MakeStop(-117.186, 34.0563, "Redlands"))
pEnumAWRStops.Add(MakeStop(-117.0445, 34.0407, "Yucaipa"))
pEnumAWRStops.Add(MakeStop(-116.964127, 33.9723765, "Palm Springs"))
pAWRInfo = pAWRouteFinder.FindRoute(pEnumAWRStops, pAWRFOptions, Nothing)
pAWRInfo.Directions.Reset()
pARDirections = pAWRInfo.Directions.Next
'Loop through the directions so they can be displayed
Do Until pARDirections Is Nothing
'use to display in table etc. pARDirections.DescriptiveDirections
pARDirections = pAWRInfo.Directions.Next
Loop
[C#]
IArcWebRouteFinder pAWRouteFinder = new ArcWebRouteFinderClass();
IArcWebRouteFinderOptions pAWRFOptions = new ArcWebRouteFinderOptionsClass();
IEnumArcWebRouteStops pEnumAWRStops = new EnumArcWebRouteStopsClass();
pAWRFOptions.DataSource = "ArcWeb:TA.Streets.NA";
//Create a group of stops to use as the route
pEnumAWRStops.Add(MakeStop(-117.186, 34.0563, "Redlands"));
pEnumAWRStops.Add(MakeStop(-117.0445, 34.0407, "Yucaipa"));
pEnumAWRStops.Add(MakeStop(-116.964127, 33.9723765, "Palm Springs"));
IArcWebRouteInfo pAWRInfo = pAWRouteFinder.FindRoute(pEnumAWRStops, pAWRFOptions, null);
pAWRInfo.Directions.Reset();
IArcWebDirections pARDirections = pAWRInfo.Directions.Next();
//Loop through the directions so they can be displayed
while (pARDirections !=null)
{
//use to display in table etc. pARDirections.DescriptiveDirections
pARDirections = pAWRInfo.Directions.Next();
}
The MakeStop routine has been used to simplify the code, it’s contents are provided below.
This can be useful if you are creating a lot of stops as input into your route.
[VB.NET]
Public Function MakeStop(ByVal x As Long, ByVal y As Long, Optional ByVal indescription As String = "") As ArcWebRouteStop
Dim ppoint As IPoint
ppoint = New Point
ppoint.PutCoords(x, y)
Dim pstop As IArcWebRouteStop
pstop = New ArcWebRouteStop
pstop.Point = ppoint
pstop.Description = indescription
MakeStop = pstop
End Function
[C#]
private IArcWebRouteStop MakeStop( double x , double y , String indescription )
{
IPoint ppoint = new PointClass();
ppoint.PutCoords(x, y);
IArcWebRouteStop pstop = new ArcWebRouteStopClass();
pstop.Point = ppoint;
pstop.Description = indescription;
return pstop ;
}
Spatial Query Objects
Spatial Query Web Service performs query and proximity searches such as "find nearest", "find within a distance", and "tell me about this area". You can use Spatial Query Web Service to find all features nearby a location or area and to determine the nearest specified number of features to a specified location or area. You can also use Spatial Query Web Service to determine the characteristics and features for a specified location. Spatial Query Web Service allows you to perform the following functions: Find nearest features to a point, line, polygon, or extent Find features within a specified geometry Generate a list of attributes or field names, and their descriptions, for a point, line, polygon, envelope or data source Constrain query by field name, SQL WHERE clauses, total number of records, geography and so on.
Report Objects
You can use the Report Web Service to create a demographic report or a print-quality thematic map for a specified area in the United States. For a given study area or trade area, the Report Web Service applies a spatial query (if needed), obtains the necessary raw data for the report, aggregates it, and returns the aggregated results in PDF, Excel, or XML format.
The available data for these reports and thematic maps includes:
Detailed 2005/2010 demographic reports from ESRI.
The Tapestry Segmentation Area Profile report from the ESRI Tapestry segmentation system.
Comprehensive Consumer Expenditures reports from ESRI.
Census 2000 data available in a summary report and a 1990-2000 comparison profile report.
Traffic Profile report showing nearby traffic counts from MPSI/DataMetrix.
National aerial photo coverage and satellite imagery from GlobeXplorer and Pixxures.
Other thematic maps of the areas being analyzed.
The Report Web Service offers the following capabilities:
Define up to three areas to analyze per report.
Define an area by a ring around a coordinate.
Define an area by a list of counties, ZIP Codes, census tracts, and such.
Define an area by user-defined polygons.
Customize the subtitle, site/area information, and other header information.
Get the aggregated data results in PDF, Excel, or XML format.
Create a thematic map in PDF format that contains 300 dpi images and prints as a presentation-quality document.
Define a study area by selecting one or combining several states, counties, places, congressional districts (CDs), core based statistical areas (CBSAs), county sub-divisions (CSDs), designated market areas (DMAs), ZIP Codes, or census tracts.
There are many services (data sources) you can use to create your reports and thematic maps. See Service Finder for a complete list of Report Web Service services.
See the ESRI reports main page for more information and sample reports. The data aggregation method used for the reports provides much more accurate results than a simple overlay or buffer operation. Data is calculated for each trade area using a weighted block centroid geographic retrieval methodology. See the ESRI reports and maps FAQs for more information on how this methodology differs from a simple overlay or area proportional method.