How Express Server Software Improves Geospatial Image Delivery

Transcription

How Express Server SoftwareImproves Geospatial Image DeliveryA LIZARDTECH WHITE PAPERcontact:Jon Skiffington206-652-5211jskiffington@lizardtech.com

Written by Matt FleaglePublished June 2012Copyright 2012 Celartem Inc. dba LizardTech, 1008 Western Avenue, Suite 200, Seattle, WA 98104. Unauthorized use ordistribution prohibited. Access to and use of this code is permitted only under license from LizardTech. All rights reserved.LizardTech, MrSID, GeoExpress, Express Server, Spatial Express, and Express Suite are registered trademarks in the UnitedStates and LiDAR Compressor and the LizardTech, GeoExpress, Express Server, Spatial Express, Express Suite, LiDARCompressor, ExpressView and GeoViewer logos are trademarks, and all are the property of LizardTech. Unauthorized use isprohibited.ii

TABLE OF CONTENTSIntroduction . 1Express Server Overview . 2How Express Server Works . 3The Workflow . 4Storage . 4Image Formats . 4Catalogs. 5Protocols . 6Client Devices . 6Scene Extraction . 6Express Server APIs . 7The WMS and Web APIs. 7The JPIP API. 8Configuration Files . 10The Base Configuration File . 11The Catalog Configuration File . 12The JPIP Configuration File . 16Performance . 18Conclusions . 19Further Reading . 20Glossary . 20iii

iv

Abstract:Advancements in the collection of geospatial imagery in recent years have resulted in the increasingavailability of greater quantities of higher quality imagery, and that availability has been matched byincreasing demand as business and nonbusiness users have grown to expect high-quality geospatialimagery in more applications on more devices. What has not changed is that the bandwidth available fortransferring this imagery is limited, which means that, in general, delivery is the bottleneck in anyworkflow involving image repositories and end users. This paper describes a software solution that takesadvantage of the architecture of the wavelet-based MrSID and JPEG 2000 image formats to deliver highresolution imagery to more users, faster, on any device and over any connection.INTRODUCTIONThe role of geospatial imagery in civil and defense enterprise has increased steadily over the past twodecades. The integration of geospatial imagery into commercial software applications has been morerecent and dramatically swift. In both cases, the benefits users realize in the access to georeferencedsatellite or aerial images have rapidly solidified as essential, non-negotiable elements of logging on.Increasingly, if the purpose of an application has anything to do with location or locating, then it will needto integrate geospatial imagery.Moreover, technologies available for image collection continue to improve, so that higher resolution(“more detailed”) imagery and imagery having more than three bands (multispectral and hyperspectralimagery) is increasingly available and at lower cost, with the result that from a business perspective, itbecomes imperative to provide access to this “better and better” imagery.From a computing standpoint, the operational “cost” of handling geospatial imagery is high. That is,image data require a lot of numerical description, so image files are extremely large, the more so whenthere are additional bands. This presents a fundamental problem for digital image distribution because itforces a choice between the delivery of smaller images (lower resolution and less detail) and untenablyslow delivery of larger, more useful ones, the latter choice rendering it impossible to do any work with theimagery and the former defeating the purpose of collecting high resolution imagery in the first place.Solutions to the problem of imagery delivery can be seen as being divided between hardware solutionsand software solutions. With enough server hardware, the limitations of processors and bandwidth can beoverwhelmed by essentially chopping high-resolution imagery up into pieces small enough to bedistributed over networks and then reassembling them in the viewing client. Enormous server farmsenable popular image providers such as Google and Bing to distribute high resolution imagery quickly.The software solution addresses the data itself, generally through compression. While hardware-basedsolutions may incorporate compression and other software-based technologies, LizardTech ExpressServer image serving software (hereafter “Express Server”) is entirely a software solution. That is,Express Server significantly increases the speed at which existing web servers deliver high-resolutionimagery.1

How Express Server Software Improves Geospatial Image DeliveryThis paper’s purpose is to describe how Express Server achieves this improvement in deliveryperformance and to provide some benchmarking data showing some of the delivery speeds that can berealized with an Express Server workflow.EXPRESS SERVER OVERVIEWExpress Server is a software application for rapidly distributing large datasets of raster imagery that havebeen compressed to MrSID or JPEG 2000 format. Express Server enables an existing web server toprovide instant viewing of high-resolution aerial photographs, satellite imagery and other digital contenton both wireless and broadband devices. At its core Express Server is an engine that converts URLrequests from client devices into images for delivery. The engine includes portions of the GeoExpressSDK with its readers and writers and is accessed by WMS and web APIs.Figure 1: Basic Express Server yMicrostationArcGISServerArcMapJPIP ClientHTTPWeb ServerMicrosoft IIS or Apache Web ServerWMS APIExpress Server Image ServingSoftwaresoftwareImage DataWeb APIExpress Server alJPIP Server(optional)FileSystem

A LizardTech White PaperExpress Server works with Microsoft IIS and Apache web servers to extract image scenes from MrSIDand JPEG 2000 imagery – including multi- and hyperspectral data – that is stored in file systems (asindividual images or as spatially indexed mosaics) or in an Oracle database and deliver them to viewingclients in a variety of formats. It’s the wavelet-based MrSID and JPEG 2000 formats that enable ExpressServer to deliver imagery so quickly, as we’ll see later.In addition to its own API, Express Server supports version 1.1 of the OGC Web Map Service (WMS)standard and, through the JPIP Server, the JPEG 2000 Interactive Protocol (JPIP). Express Server’s JPIPServer is an optional component with a separate engine technology for progressively streaming imageryfrom a server to a client to support image use in bandwidth-constrained environments.HOW EXPRESS SERVER WORKSWhen an image request comes in to an IIS or Apache web server, that web server recognizes the requestas belonging to one of the Express Server APIs. The Express Server engine then: determines what reader is to be usedlocates and opens the image after consulting the various cachesextracts the requested scene based on requested parameters such as level (resolution), width andheight, and upper left coordinatesengages an image writer based on the specified output formatdelivers the imageThe figure below illustrates this workflow.Figure 2: Express Server Workflow3

How Express Server Software Improves Geospatial Image DeliveryThe WorkflowExpress Server uses the HTTP protocol to deliver imagery to computers and laptops, tablets, phones andother handheld devices – any client device that hosts a web browser or that can be used to work with aGIS. The network connection can be wireless or conventional and can be of any bandwidth.Images are stored on file systems or in an Oracle database to which Express Server has access. ExpressServer supports MrSID, JPEG 2000 and NITF formats as source imagery. These image formats have theextensions .sid, .jp2 and .ntf. Express Server keeps track of these images – singly and in groups – ascatalogs, which can be browsed and explored. A catalog can be an array of folders with images in them,or, more typically, a single, indexed image called a mosaic that is made from a number of smaller images.Catalogs are managed by the Express Server administrator.Express Server receives a WMS request, a web API request, or a JPIP request (request for a JPIPconnection); these protocols sit on top of the HTTP protocol. They are simply different ways ofrequesting imagery. The components of a request may represent a query as to what catalogs are availablefor viewing, or it may ask for a particular catalog. The precise composition of the URL request isdetermined by the protocol being used and the associated API. Similarly, the first “scene” returned byExpress Server is determined by a number of factors shaped at the client end.In a web browser, a thumbnail of the catalog is usually the first returned image. When a user clicks thethumbnail, the image is typically opened at a low resolution for overview. Depending on the client’stoolset, a rectangular portion of this overview image may be drawn for “zooming into” or a click on theimage will return image data from the next larger resolution or “zoom” level and recenter the scene on thecoordinates corresponding to the location of the click.In a WMS environment, image catalogs are returned as layers whose bounds correspond to the extents ofthe map the user is creating or working with in their particular GIS application. As with web browsers,scene extraction and return over the WMS protocol follows the workflow of the particular application.The JPIP protocol is significantly different in that what is being delivered to the client is not images oreven pixels but wavelet coefficients representing regions of images at desired resolutions. JPIP thusrequires a more sophisticated client that can receive and translate these transmissions before the user cansee any image at all.STORAGEImagery served by Express Server need not reside on the same hardware as the Express Serverinstallation. It can be stored in any network file system or in an Oracle database that Express Server haspermission to access.IMAGE FORMATSFor source imagery, Express Server supports MrSID, JPEG 2000 and NITF. MrSID and JPEG 2000 areboth wavelet-based formats that facilitate the efficiencies of raster data storage and distribution that highcompression enables. Extracted scenes from MrSID imagery in particular are returned extremely quickly.Because their wavelet-based algorithms naturally and automatically result in multiple resolutions of an4

A LizardTech White Paperimage within the compressed image file itself – from the full resolution image down to a low-resthumbnail – both formats provide the high image quality required by geospatial professionals yet obviatecostly and time-consuming “image pyramiding”.MrSID images are identified by generation and may be MrSID Generation 2 (MG2 ), MrSIDGeneration 3 (MG3 ) or MrSID Generation 4 (MG4 ). There are important differences among them.MG2, the oldest version, has a 2-gigabyte file-size limit and does not support lossless compression. MG3introduced support for lossless compression and a number of other features including reprojection, colorbalancing, despeckling and encoding areas of interest, and removed the 2-GB size limit.MG4 is the most recent evolution of the MrSID format. In addition to mosaicking datasets together, colorbalancing raster imagery, and manipulating data in other ways as do MG2 and MG3, MG4 enablesgeospatial professionals to losslessly compress 3-banded and multispectral (including hyperspectral)geospatial data so that they can make full use of the most up-to-date imagery. MG4 also introducedsupport for alpha bands, which remove the problem of speckling in the transparency areas of mosaics.The following table illustrates the differences between versions of the MrSID format and JPEG 2000.Table 1: Support for Common Requirements in LizardTech File FormatsSituation/RequirementSupported by Output File FormatMG2MG3MG4JPEG2000 Advanced encoding (reprojection, color balancing, despeckling, area of interestencoding, etc.) Output file size greater than 2 GB Lossless output Mosaic that has MrSID tiles as input Lossy output with maximum 3 bands, cropping but no advanced encoding, output lessthan 2 GB*Multispectral input Optimization Alpha band Signed datatypes (e.g. s8, s16) Arbitrary band mapping Per-band compression NITF (National Imagery Transmission Format) is a suite of standards for the exchange, storage, andtransmission of digital-imagery products and image-related products within the U.S. Department ofDefense and the Federal Intelligence Community. NITF supports compression to JPEG 2000 format.By default Express Server delivers extracted scenes as JPEG images. Other options for final deliveryformat are PNG (.png), GIF (.gif), TIFF (.tif and .tiff) and Bitmap (.bmp).CATALOGSExpress Server treats every image as partly or wholly constituting a catalog. The catalog is the basicedifice used by Express Server to organize images and house information about them and instructions5

How Express Server Software Improves Geospatial Image Deliveryabout how to treat them. A catalog of images is made accessible to Express Server through its inclusion inan editable XML file called a catalog configuration file. For the purposes of WMS, a catalog is the samething as a layer.The catalog configuration file instructs Express Server in how to treat catalogs. It informs Express Server,for example, of all the catalogs available to it, and specifies not only basic properties of each catalog suchas its name, location and description, but also things like the requirement of a watermark, the maximumsize of an image request, and the size and format of thumbnails generated by Express Server for images inthat catalog. Whether and how a catalog is spatially indexed – a requirement if the catalog is to bepublished as a WMS layer – is also controlled via the catalog configuration file.The catalog configuration file can have any number of catalogs listed in it. We’ll see an example of acatalog’s listing in the catalog configuration file later on when we look at some of that file’s moreinteresting elements.PROTOCOLSExpress Server rapidly distributes large geospatial images using the WMS or JPIP standard, so very littletime must be spent customizing applications or retraining users. These interfaces and Express Server’sown web API sit atop the HTTP protocol.The Web Map Service standard (WMS) provides a simple HTTP interface for requesting georeferencedmap images from one or more distributed geospatial databases. A WMS request defines the geographiclayer(s) and area of interest to be processed. The response to the request is one or more georeferencedmap images (returned as JPEG, PNG, etc.) that can be displayed in a WMS-enabled GIS application.The JPIP client/server communication protocol is defined in Part 9 of the JPEG 2000 suite of standards,(ISO/IEC 15444-9). JPIP progressively streams the wavelet coefficients for a requested part of a picture,which saves bandwidth, computer processing on the server, and time. It allows for speedy viewing of alarge image in low resolution or a higher-resolution part of that same image. Using JPIP, it is possible tostream large images (for example 1 gigapixel) to relatively lightweight hardware such as PDAs.CLIENT DEVICESBecause it is standards-based, Express Server’s architecture enables image delivery quickly to virtuallyany client viewer, regardless of the device or the amount of bandwidth. Express Server’s output is simplyan image, delivered via the HTTP protocol, readable by any of the web browsers with which even thesmallest devices with a viewing screen now come equipped. Express Server also supports Web MapService (WMS), which is supported by virtually all GIS applications.Scene ExtractionWhat enables Express Server to serve image data so quickly is that its design takes advantage of twoaspects of the wavelet-based MrSID and JPEG 2000 compression formats: a multiresolution image fileand selective decompression.6

A LizardTech White PaperConventional image serving schemes require the construction of image pyramids, which are expensive interms of money, time and storage. Image pyramids comprise copies of each image at various resolutionsso that when a client requests an image or a scene at a particular resolution a close approximation can bedelivered. Image pyramids take up an enormous amount of storage space in addition to the cost in time tocreate them, and must be completely recreated each time an image is altered. With MrSID and JPEG 2000encoding, images are compressed (losslessly, as a best practice) such that numerous resolution levels ofan image, from icon and thumbnail all the way up to the full original resolution, are the natural result ofcompressing the image.Because of the way the actual bits representing the image are stored, any portion of an image can bedecompressed at any resolution level without the necessity of decoding the entire image. Express Serveris built specifically to take advantage of this selective decompression feature of MrSID and JPEG 2000,extracting the requested scene quickly and converting it to an image scene in one of several outputformats. Depending on cache settings, which we’ll discuss later on in this paper, subsequent requests forimage data from the same areas of the same images will not require decompression at all, so that overtime the delivery of scenes from a given image repository can become even faster.Express Server APIsExpress Server responds to a request formulated according to one of three APIs: the WMS API, the webAPI, or the JPIP API. The request is in the form of a URL.THE WMS AND WEB APISThough the syntax of the requests is different, the WMS API is functionally equivalent to the web API.Express Server’s web API enables web browsers to make requests for images or scenes from imagesaccording to various specified parameters. The URL request can be formed either through the clicking ofgraphic elements or by manual entry in the URL field. The WMS API essentially does the same thing, butWMS was created as a standard means of importing data in diverse locations into a GIS. The WMS APIenables geospatial applications to pull in Express Server catalogs as layers.A catalog is WMS-enabled (available for WMS requests) when it is spatially indexed. This means thatExpress Server understands how to fit all the images in a catalog into a mosaic and has assigned thecatalog a coordinate reference system (CRS) in the form of an EPSG code. Instead of having to open eachimage in the catalog to find out where it belongs in the world and in the mosaic, Express Server consults asingle index file that contains this information for all the images in the catalog.The following two requests both return a summary of available catalogs on an Express Server installationhosted at “demo.lizardtech.com”. The first is a WMS API request, the second a web API request.Express Server supports version 1.1.1 of the OGC WMS specification via the GetCapabilities andGetMap ows?SERVICE WMS&REQUEST ch/iserv/browse?style noneThe reply sent back by Express Server is an XML document (which in the web API gets turned into anhtml page displaying thumbnails of the available catalogs). The above URLs are live and will each return7

How Express Server Software Improves Geospatial Image DeliveryXML output. A user will not normally see the XML, but a look at some XML excerpts will show someinteresting items.Below is the return from a WMS “GetCapabilities” request showing one catalog. Note that it isreferred to as a “layer”, and that the extents are described in terms of a “bounding box”. Layer opaque "1" Name Florida /Name Title Florida /Title SRS EPSG:26917 /SRS LatLonBoundingBox maxx "-81.248255" maxy "29.572644" minx "-82.908008"miny "26.740052" / BoundingBox SRS "EPSG:26917" maxx "475315.500000" maxy "3271459.500000"minx "315151.500000" miny "2958993.500000" resx "1.00000000" resy "-1.00000000" / ScaleHint max "92681.900024" min "1.414214" / /Layer Note: For more information about how the various XML elements are used in WMS requests and what their valuessignify see the Further Reading section at the end of this document.Below is the same catalog listed in the return from a web API “browse” request. Item georgn 3.500000" name "Florida"srs "EPSG:26917" / Following is a WMS request to open the catalog which it identifies as the layer called “Florida”. We’vebroken up the URL into rows so it can be viewed more /ows?SERVICE WMS&VERSION 1.1.1&REQUEST GetMap&LAYERS Florida&SRS EPSG:26917&BBOX 207753.9,2958993.5,582713.1,3271459.5&WIDTH 600&HEIGHT 500&FORMAT image/jpeg&TRANSPARENT FALSEIn the web API, the same catalog is requested using the “getimage” command, as v/getimage?cat Florida&item iserv-catalog-index&rgn 207753.9,3271459.5,582713.1,2958993.5&geo true&wid 600&hei 500&method scale&oif jpegThe above examples demonstrate the basic methods by which clients retrieve imagery and informationfrom Express Server. They are live examples that both open the same Florida mosaic.THE JPIP APIThe JPEG 2000 Interactive Protocol, or JPIP, is a specification for progressively streaming imagery froma server to a client to support image use in bandwidth-constrained environments.8

A LizardTech White PaperPart 9 of the JPEG 2000 set of standards (ISO/IEC 15444), JPIP uses the same data structures as the fileformat to incrementally deliver pieces of the image to a requesting client, with no algorithmic overhead topreprocess or transcode the image. Each of these delivered pieces is fully “indexed” in that the JPEG2000 decoder knows “where” in the image that data belongs in terms of its spatial position, resolution,and quality contribution.At any point in the process of downloading the data from the server, the smart client can translate thebytes currently available to some approximation of the image. If only a small number of bytes have beentransferred the image will be of low resolution and/or low quality; as the user “idles” over a scene, moredata is transferred and the representation of the image increases in resolution and quality.Express Server’s JPIP API is an optional component that works with any JPIP viewing client.In a JPIP transaction, the viewing client sends a request for a connection along with some informationabout how large of a “chunk” of image data it wants to receive at a time and a summary of what it knowsabout the imagery it hopes to view. The server sends back a channel ID number and opens a transfersession. The channel ID number identifies the session and is used by the client in each subsequent requestfor more data.Because Express Server’s JPIP server component streams wavelet coefficients instead of sending imagesthere is always something to render in a JPIP viewer. Image detail is filled in as it arrives. This can betaken advantage of in several ways depending on the capabilities of the viewing client. For example, theimage data might be requested in such a way that priority is placed on rendering the entire image at lowquality before more detail is rendered in any given portion of the image, or the opposite might berequested: an area of interest can be specified that receives priority as the data is being delivered, andwhere the maximum image detail is filled in first. In practice, a user might open the image as a layer in aGIS application and, before the image renders at full quality, draw a rectangle specifying an area ofinterest. At that point, Express Server stops filling in the entire image and focuses on supplying imagedata for just that area of interest.Let’s compare two requests for data that Express Server might receive from a JPIP viewer, with someimportant parts highlighted:http://localhost:9013/jpip?fsiz 482,813,closest&roff 0,0&rsiz 482,813&stream 0&context jpxl 0 &len 2000&cid JPH FFFC70D8428336C1:http://localhost:9013/jpip?fsiz 4849,6497,closest&roff 3228,2480&rsiz 267,169&stream 0&context jpxl 0 &len 2000&cid JPH FFFC70D8428336C1Note: For more information about how the various XML elements are used in JPIP requests and what their valuessignify see the Further Reading section at the end of this document.Let’s look at the parts we’ve highlighted. In both URLs you can see the channel ID number (cid) at theend. Also, the desired chunk size or “length” of the stream (len) is 2000 bytes in both. You’ll notice thatin the first URL, fsiz (the size of the entire image) and rsiz (the size of the region of interest) are thesame – 482 pixels on the x axis and 813 on the y axis – and that the roff (region offset) has a value ofzero, which means that there is no particular region of interest being specified. The region starts in the9

How Express Server Software Improves Geospatial Image Deliveryupper left corner of the image (0,0) and is the same size as the image. In this case the detail for the entireimage will be filled in at an even rate.But in the second URL (see Figure 3 below) there is an offset of 3228 pixels on the x axis and 2480 on they axis and the size of the area of interest is only a small part of the image – 267 pixels by 169 pixels. Inthis case Express Server will send the detail for that smaller region first.Figure 3: A JPIP Region of Interest4849roff 3228,248024802673228Region ofInterest1696497rsiz 267,169fsiz 4849,6497This is just one application of the capabilities of the JPIP protocol in Express Server software.Configuration FilesConfiguration files are XML files that are edited by an administrator to set up an Express Serverinstallation, direct its behavior, and specify how imagery is made available for delivery. In the current andprevious versions of Express Server, these configuration files must be edited “by hand” (using an XMLeditor to directly alter the XML), but future versions of Express Server will employ a graphical userinterface that will enable editing the configuration files by means of easy-to-use checkboxes, drop-downmenus and text fields.There are three main configuration files. The base configuration file, ”iserv-cfg.xml”, governs certainoperating characteristics of Express Server. The JPIP configuration file, “jpiphost.exe.config”,controls how the JPIP Server operates. The catalog configuration file, “cat-cfg.xml” defines the imagecatalogs and their properties.10

A LizardTech White PaperXML files are composed of elements and subelements. Some elements may not appear in the file unlessand until an administrator changes a parameter from its default setting.Note: The names of the configuration files, as well as some of their elements and properties and their organization,may change in future versions of Express Server. The names and sample files used in this document are correct as ofversion 7.0.THE BASE CONFIGURATION FILEThe base configuration file (“iserv-cfg.xml”) instructs Express Server i

Imagery served by Express Server need not reside on the same hardware as the Express Server installation. It can be stored in any network file system or in an Oracle database that Express Server has permission to access. IMAGE FORMATS For source imagery, Express Server supports MrSID, JPEG 2000 and NITF. MrSID and JPEG 2000 are