1 / 19

A Sample Print Web Service Utilizing ArcGIS Server and ArcObjects

A Sample Print Web Service Utilizing ArcGIS Server and ArcObjects. Cheryl Spencer, IndyGIS Marianne Cardwell, Woolpert. Overview. IndyGIS background Current web service use Why the need for a print web service? Business reasons Technological reasons Nuts and bolts

annayoung
Download Presentation

A Sample Print Web Service Utilizing ArcGIS Server and ArcObjects

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Sample Print Web Service Utilizing ArcGIS Server and ArcObjects Cheryl Spencer, IndyGIS Marianne Cardwell, Woolpert

  2. Overview • IndyGIS background • Current web service use • Why the need for a print web service? • Business reasons • Technological reasons • Nuts and bolts • Components of the Print Web Service • How components are used • Challenges & Lessons Learned

  3. IndyGIS Background • Numerous internal applications and public applications • ArcGIS Server purchased in 2004 • Currently migrating to version 9.2 • Until recently have used ArcGIS Server behind the scenes to perform spatial analysis (non-map centric applications)

  4. Current Web Services • Address Validator • Geocode • Point In Polygon • Find Nearest • Find Within Radius • Polygon Analysis • Buffer • …and Print

  5. Example Applications Using Web Services

  6. Business Reasons for a Print Web Service • Target audience – Developers • Reusable print component can be used for all ArcGIS Server applications developed • Plug and Play • Saves time…and money • Consistent user experience when printing from a variety of applications.

  7. Technological Reasons for a Print Web Service • Current ArcGIS Server technology does not provide for map printing functionality. • Printing the page using the browser’s print functionality does not provide very good quality print-outs. • Web service clearly separates out the print logic from the rest of the code. • Print WS returns ArcMap-styled PDF map, including all elements one can expect in a map: scale, North arrow, legend, map, overview map, as well as text elements.

  8. Components of the Print Web Service

  9. How components are used • The first step is to create a layout in ArcMap. • The second step is to export the layout to an XML file.

  10. XML Configuration File • Custom ArcMap tool wizard created to convert an ArcMap layout to an XML document using a custom schema. • Schema is read by Print Web Service to recreate the layout.

  11. XML Configuration File

  12. Example Use of Print Web Service • A web site utilizing an ArcGIS Server map control can use the Print WS to request a PDF map. • Multiple parameters are requested, including the map description(s), map scale, map extent, text elements, and XML configuration file name.

  13. Sample Web Interface

  14. Print Web Service Process • Get all parameters ready for the Web Service call: Public Function ExportForUrl(ByVal textElements As TextElement(), _ ByVal pageConfigName As String, _ ByVal pageSize As String, _ ByVal pageOrientation As String, _ ByVal extent As Envelope, _ ByVal webMapScale As Double, _ ByVal mapServices() As MapService, _ ByVal overviewMapServices() As MapService, ByVal graphicElements() As GraphicElement, ByVal limitLegendLayers As Boolean, _ ByVal legendLayers() As String) As String

  15. Print Web Service Process (cont’d) • Print WS goes through the following steps: • Create a Server Object Manager • Create an empty Server Context • Create (a) new IMap(s) • Add layers to the map (re-created from MapDescription) • Add graphics to the map

  16. Print Web Service Process (cont’d) • Set up the page layout and the extent of the map • Add all the page elements to the layout. These include: • Map frames • Legends • North arrows • Scale bars • Text elements • Neatlines • Pictures • Scale texts • Export the map to PDF.

  17. Challenges • ArcObjects does not always respond the same way in a Web Service as it does in the Desktop environment. Don’t make too many assumptions. • Legend was tricky. Spent a lot of time trying to get it right and required a lot of manual coding to resize it to the correct dimensions. • Graphic layers with transparencies are not supported in ArcObjects (ArcMap) whereas they are in ArcGIS Server map controls (think of buffer overlays). Solution was to export the graphics to temporary shapefiles to apply transparency.

  18. Lessons Learned • Do your homework. • Document! • Make it flexible. • Put thought into web service signature. • Think about error handling. • Consider wrapping fine-grained ArcObjects calls into separate DLLs.

  19. Questions?

More Related