Image Server Interface

The Manifold Image Server interface is a .NET interface used with image server modules. Image server modules connect to image data sources and expose their data as image components that can be used together with other components inside Manifold projects. For example, there are image server modules for bringing image data into Manifold from various online mapping services such as Google Maps, Yahoo! Maps or Microsoft Virtual Earth.

 

A Manifold image server module should include one or more .NET objects exposing the Manifold Image Server interface. Each of the objects should have a public parameterless constructor.

 

Installing a Manifold image server module consists of installing the .NET assembly that contains .NET objects exposing the Manifold Image Server interface into the Manifold installation folder, and doing the necessary configuration required by the assembly. There is no configuration required on the Manifold side besides copying the assembly into the Manifold installation folder and restarting Manifold.

 

Connecting to a Manifold image server consists of creating an instance of the particular .NET object, setting its properties, retrieving the dimensions and supplementary information describing the target image, and requesting pixels of the target image by tiles.

 

An image server can choose to operate at one or more scale levels. The resolution of a particular scale level should be 2 times that of the next available scale level. All tiles have the same width and height, regardess of the scale level. Tile coordinates are required to be non-negative.

 

Image tiles can be in any of the following formats: BMP, ECW, GIF, J2K (JPEG 2000), JPG, PNG, TGA, TIF.

 

Images linked via the image server interface will use whatever coordinate system (projection) is returned by the image server module in use. If an invalid coordinate system is returned when linking an image Manifold will use the default coordinate system.

 

Interface Specification

 

The Manifold Image Server interface includes the following members:

 

IServer

 

String CoordinateSystem

Get the coordinate system of the image in Manifold XML format.

 

String DefaultImageType

Get default image type, such as ".jpg" or ".png".

 

String DefaultURL

Get default URL, such as "http://www.example.com/myserver.asp".

 

Boolean DownloadTile(Int32 x, Int32 y, Int32 scale, String filename)

Download the specified image tile and save it at the specified location in the file system.

 

String Error

Get last error message.

 

IRectangle GetRectPixels(Int32 scale, IRectangleD rect)

Convert the supplied rectangle from the coordinate system of the image to pixels. The XMax property of the returned rectangle should be equal to or greater than the XMin property, same for YMax and YMin. Returning a rectangle of (XMin=500, YMin=500, XMax=599, YMax=549) means that the queried image area is 100 pixels wide and 50 pixels high, at the supplied scale level.

 

IRectangle GetRectTiles(Int32 scale, IRectangleD rect)

Convert the supplied rectangle from the coordinate system of the image to tiles. The XMax property of the returned rectangle should be equal to or greater than the XMin property, same for YMax and YMin. Returning a rectangle of (XMin=5, YMin=5, XMax=7, YMax=5) means that the queried image area is 3 tiles wide and 1 tile high, at the supplied scale level.

 

String Name

Get the unique name of the image server module. Only alphanumeric characters, spaces, and ".", "-", ":", "_", "<", ">", "(", ")", "[", "]", "{", "}", "?", "!", "~", "@", "#", "$", "%", "^", "&", "|" characters are permitted.

 

String ProxyAddress

Get or set the address of the proxy server.

 

String ProxyPassword

Get or set the password for use with the proxy server.

 

String ProxyUserName

Get or set the user name for use with the proxy server.

 

Boolean ReverseY

Return True if the pixels and tiles with smaller values of the Y coordinate are on top of those with larger values of the Y coordinate (the Y axis points down), and False otherwise.

 

Int32 ScaleHi

Get the least detailed scale. Should return a value equal to or larger than ScaleLo.

 

Int32 ScaleLo

Get the most detailed scale. Should return a value equal to or less than ScaleHi.

 

String ScaleNames

Get names of scales, from most detailed to least detailed, separated by commas, for example, "1 meter,2 meters".

 

Int32 TileSizeX

Get the width of a single tile, in pixels.

 

Int32 TileSizeY

Get the height of a single tile, in pixels.

 

String URL

Get or set the URL for the target image.

 

(Supplementary interfaces)

 

IRectangle

 

Int32 XMax

Get maximum X coordinate.

 

Int32 XMin

Get minimum X coordinate.

 

Int32 YMax

Get maximum Y coordinate.

 

Int32 YMin

Get minimum Y coordinate.

 

IRectangleD

 

Double XMax

Get maximum X coordinate.

 

Double XMin

Get minimum X coordinate.

 

Double YMax

Get maximum Y coordinate.

 

Double YMin

Get minimum Y coordinate.

 

The definition of the main Image Server interface and supplementary interfaces resides in Manifold.ImageServer.dll.

 

All interfaces are defined in the Manifold.ImageServer namespace.

 

Notes

 

Implement all members of the Manifold Image Server interface, or the image server module will not be functional. Pay close attention to the meaning of each property and method.

 

Make sure to name your image server module in a unique way. A common technique is to use the name of your company or project as part of the name for an image server module, for example, Acme Corp Web Map. Do not use any characters that are not explicitly permitted.

 

Limit the amount of memory used by your image server module to a minimum. There is no need to cache image data, since Manifold already implements caching.

 

Play well with proxy servers. Do not ignore the values of the ProxyXxx properties supplied by Manifold.

 

Design your image server module to operate with minimal permissions. At the very least, your module should operate in the context of a normal user account. It is frequently beneficial to declare the permissions required by the module via .NET mechanisms, for use in limited-permission environments.

 

Design your image server module so it does not require any configuration. If you want the user to be able to customize the operation of the module, provide an interactive configuration tool. Consider storing configuration options in isolated storage, using per-user isolation.

 

Programmers should also visit the manifold.net website for any supplemental documentation or example implementations, if any are made available in the future.

 

See Also

 

Extensions

Geocoding Server Interface

Linked Images from Manifold Image Servers