Showing posts with label arcgis online. Show all posts
Showing posts with label arcgis online. Show all posts

Sunday, November 1, 2009

Using the ArcGIS Server REST API in .NET applications

Over the past year I've handled a number of questions regarding the use the ArcGIS Server REST API in a .NET application. It can be done quite effectively, but isn't explicitly promoted by ESRI since the REST API is primarily designed to be consumed by pre-packaged Web clients like the ArcGIS JavaScript, Flex, and Silverlight/WPF APIs. However, using REST programmatically in a .NET application context without installing an ESRI product can make for some powerful and focused yet lightweight solutions. In addition, if you need to do something relatively simple you don't have to generate a load of client-side proxy classes like you do with SOAP.

I've included a simple code example below to highlight how easy it is to integrate ArcGIS Server services via REST in your .NET app. The example uses an ArcGIS Online geocode service to geocode an address and return a location.

Download the sample here.


There are a few items to consider when using ArcGIS services via REST in .NET:

  1. You will construct the url that will execute an operation on the server. Inputs to the operation are included in the url as parameters with values. Add a reference to the System.Web.dll and use the HttpUtility class to encode parameter values in the url.
  2. In most cases you will return results in JSON (JavaScript Object Notation) format. Add a reference to the System.Web.Extensions.dll (included with .NET 3.5, separate install for .NET 2.0) and use the JavaScriptSerializer class to deserialize JSON results into a dictionary you can use more effectively.

This example can easily be modified for use in a .NET CLR trigger for SQL Server to geocode address information upon entry into a table -or- in a batch process to geocode addresses in a database -or- show a location in a WinForm or WPF desktop client. The same idea can cross over into other ArcGIS Server services such as querying layers in a map or executing a geoprocessing service. In any case, you'll find the simplicity of the REST API refreshingly simple for those scenarios where you need to plug a little GIS into your app. One parting note, if you use ArcGIS Online services via REST, you'll need to follow the subscription model for the Web Mapping APIs. For example if you geocode more than 1000 addresses, you'll need to purchase a subscription.

Thursday, September 24, 2009

"Price check on Bing Maps"

Over the past couple months, I've chatted with a number of people interested in using Bing Maps services in their applications; map-centric and otherwise. If they had any questions or wanted to purchase a license, I always mentioned that they could contact Microsoft directly. This got me wondering, if someone did contact Microsoft with questions about purchasing a Bing Maps license, what would they experience? Simple enough to try – so I called their contact number listed on their licensing page.

I was directed to the voice mail of someone on the sales staff. His voice mail greeting provided his email address, so I decided to send him an email with a single question to get the ball rolling. Literally 7 minutes later I got a response… I was impressed. He needed more information, so I provided it and waited for a response. The following day I sent an email asking for an update and he called me within 5 minutes. Evidently he called my main work number and made his way to my desk… quick, resourceful… again I was impressed. After a lengthy conversation, a few interesting details about the licensing and cost of Bing Maps became apparent. Let’s start with the first question:

After the 90-day evaluation period, do I have to purchase a license to continue using Bing Maps imagery, geocode, and route services?

No, but the use case is very limited. You can continue to use Bing Maps staging services beyond the 90-day evaluation period if the application is:
1) available publicly, on the Internet, without restriction
2) completely non-commercial, meaning you make no money on its use, directly or indirectly

Note you still have to abide by the limits defined for the 90-day evaluation. So this pretty much covers soccer moms trying to organize team events on a map or allows your friendly fantasy football commissioner to show folks how to get to his house for the draft. Granted the Bing Maps imagery services will still have “Staging” plastered on each tile, so the map may not be very pleasing. Outside of this, all other scenarios require a license. This includes all internal applications (commercial or non-commercial, Web or desktop), all commercial applications, and all government applications. Logically this leads to the next question…

How much is a license to use Bing Maps?

Short answer…the standard package is $8000 for 1,000,000 transactions. This is the minimum to get started. The transactions sit a pool for use with all Bing services: imagery, geocode, routing, search, etc. So…

What is considered a transaction?

It depends on the service. The best place I’ve found to get detailed information on this is the
transaction report description for Bing Maps. In general, use the following as a guide:

8 map tiles = 1 map transaction
1 geocode = 1 transaction
1 route = 1 transaction

In the end, I was both impressed and satisfied with the responsive Bing Maps customer service. The guy I spoke with was clear, concise and real; he knew the technical details and presented it well. I’m definitely more comfortable referring folks to Bing Maps now that I know first hand what they’ll experience. I still find it interesting that if you are using a licensed ArcGIS product or API you can purchase access to Bing Maps through ArcGIS Online for significantly less - $2500 for 1,000,000 transactions (see the
price sheet). The only difference is ESRI customer service provides you with a Bing Maps account and you can purchase transactions in smaller blocks (100,000). In your application you still work with Bing services directly. We'll see what happens moving forward, but for now ESRI customers appear to have some options when buying into Bing Maps.