Supported with: ArcGIS Engine, ArcGIS Desktop, ArcGIS Server
Library dependencies: System, SystemUI, Geometry, GeoDatabase
Additional library information: Contents, Object Model Diagram
This content is also available in a version that specifically targets .NET developers. Click on the link below to view it.
.NET overview of the ArcWeb assembly
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 experienced 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 database 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:
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.
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.
Private Sub Command1_Click() Dim pAWConnect As IArcWebConnection Dim pCancel As ITrackCancel Set pAWConnect = New ArcWebConnection Set pCancel = New CancelTracker pawconnect.Connect "username","password", true, pCancel End Sub
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.
Private Sub Command1_Click() Dim pAWConnDialog As IArcWebConnectDialog Dim bConnected As Boolean Set pAWConnDialog = New ArcWebConnectDialog bConnected = pAWConnDialog.DoModal(Form1.hwnd) End Sub
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 ability 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.
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).
The following sample illustrates how to use the address finder objects to return a location given an address as input.
Dim pAWaddress As IArcWebAddress
Dim pAWAddFinder As IArcWebAddressFinder
Dim pAWAFOptions As IArcWebAddressFinderOptions
Dim pEnumAWAFInfo As IEnumArcWebAddressFinderInfo
Dim pAWLocationInfo As IArcWebLocationInfo
Dim pAWLocation As IArcWebLocation
Set pAWaddress = New ArcWebAddress
Set pAWAddFinder = New ArcWebAddressFinder
Set pAWAFOptions = New ArcWebAddressFinderOptions
pAWAFOptions.DataSource = "ArcWeb:TA.Streets.US"
'Use the Address Object to specify the input
pAWaddress.HouseNumber = 380
pAWaddress.City = "Redlands"
pAWaddress.Country = esriArcWebCountryUnitedStates
pAWaddress.Street = "New York"
pAWaddress.PostalCode = "92373"
Set pAWLocationInfo = pAWAddFinder.FindLocationByAddress(pAWaddress, pAWAFOptions, Nothing)
If Not pAWLocationInfo Is Nothing Then
pAWLocationInfo.EnumArcWebLocation.Reset
Set pAWLocation = pAWLocationInfo.EnumArcWebLocation.Next
If Not pAWLocation Is Nothing Then
MsgBox pAWLocation.Point.x
End If
End If
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:
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 following sample illustrates how to use the place finder objects to return a location given a place name as input.
Dim pArcWebPlaceFinder As IArcWebPlaceFinder
Set pArcWebPlaceFinder = New ArcWebPlaceFinder
Set pAWPFOptions = New ArcWebPlaceFinderOptions
m_pAWPFOptions.DataSource = "ArcWeb:ESRI.Gazetteer.World"
Set m_pAWDataSourceInfo = New ArcWebDataSourceInfo
'Please add testing code here
Set pAWLocationinfo = pAWPlacefinder.Find("Yucaipa, ca", pAWAFOptions, ptc)
pAWLocationinfo.EnumArcWebLocation.Reset
Set pAWLocation = pAWLocationinfo.EnumArcWebLocation.Next
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:
Dim pAWRouteFinder As IArcWebRouteFinder
Dim pAWRFOptions As IArcWebRouteFinderOptions
Dim pEnumAWRStops As IEnumArcWebRouteStops
Dim pAWRInfo As IArcWebRouteInfo
Dim pARDirections As IArcWebDirections
Set pAWRouteFinder = New ArcWebRouteFinder
Set pAWRFOptions = New ArcWebRouteFinderOptions
Set 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.564127, 33.7723765, "Palm Springs")
Set pAWRInfo = pAWRouteFinder.FindRoute(pEnumAWRStops, pAWRFOptions, Nothing)
Debug.Print pAWRInfo.Directions.Next.DescriptiveDirections
pAWRInfo.Directions.Reset
Set pARDirections = pAWRInfo.Directions.Next
'Loop through the directions so they can be displayed
Do Until pARDirections Is Nothing
Debug.Print pARDirections.DescriptiveDirections
Set pARDirections = pAWRInfo.Directions.Next
Loop
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.
Public Function MakeStop(x As Long, y As Long, Optional indescription As String) As ArcWebRouteStop Dim ppoint As IPoint Set ppoint = New Point ppoint.PutCoords x, y Dim pstop As IArcWebRouteStop Set pstop = New ArcWebRouteStop pstop.Point = ppoint pstop.Description = indescription Set MakeStop = pstop End Function
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.
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:
The Report Web Service offers the following capabilities:
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.