Configuring custom raster handlers – Pitney Bowes MapXtreme User Manual

Page 317

Advertising
background image

Chapter 17: Working with Rasters and Grids

Configuring Custom Raster Handlers

MapXtreme v7.1

324

Developer Guide

Note that this value is read from and stored in the ClientMetadata of the table. If a value exists in a
.TAB file's metadata it will be read in and recognized. If WriteTabFile is called the value will be
persisted into the begin_metadata section of the .TAB file. This property is equivalent to
TableInfo.ClientMetadata["\\PreferredRasterHandler"].

Configuring Custom Raster Handlers

You can configure your MapXtreme application to use a different raster handler than the ones
included in the distribution of MapXtreme or to support an entirely new raster type. You can also
change the precedence in which raster handlers are used.

In the default installation of MapXtreme, all raster handlers are placed in <program files>\Common
Files\MapInfo\MapXtreme\7.x.x\RasterGridHandlers. This is also the location of the file mirasteru.dll.
This is the recommended installation location of any other raster handlers that you use in your
application. If you use the default location, no other configuration steps are necessary.

If you want to put your custom raster handler in a non-default location, then you must specify the
location of your custom raster handler in an application configuration file for a desktop application, or
in the Web.config file for a web application. To do this, define a <Path> or a <SpecialPath> element
under <ApplicationDataPaths>, then copy the selected raster handler to that folder.

For example, to configure a desktop application custom raster handler in the non-default
MyAppData directory, you could use the following .config file.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<configSections>

<section name="MapInfo.CoreEngine"

type="MapInfo.Engine.ConfigSectionHandler, MapInfo.CoreEngine,
Version=6.8.0.536, Culture=neutral,
PublicKeyToken=93e298a0f6b95eb1" />

</configSections>
<MapInfo.CoreEngine>

<ApplicationDataPaths>

<SpecialPath>

<Personal>MyAppData</Personal>

</SpecialPath>
<Path>c:\MyAppData</Path>

</ApplicationDataPaths>

</MapInfo.CoreEngine>

</configuration>

In this example, the <Personal> tag is a special place defined in the user’s My Documents. This
would refer to a folder called MyAppData in My Documents. Within the <ApplicationDataPaths> tag,
use either the <SpecialPath> or the <Path> tags. Using both would mean that the raster handler
could be put in either "MyAppData" folder. While this would not be an error, it probably is not what
you intend to accomplish. Since this is a non-default configuration, you must also place the
mirasteru.dll in that same directory.

Advertising