beautypg.com

Pitney Bowes MapXtreme User Manual

Page 309

background image

Chapter 16: Spatial Objects and Coordinate Systems

Coordinate Systems

MapXtreme v7.1

316

Developer Guide

End Try
End Sub

L

If the EPSG or SRID code already exists, an exception will be thrown indicating this fact.

To determine if a coordinate system for the MapInfo, EPSG or SRID codespace is already
supported, call this method:

MapInfo.Geometry.CoordSys.Code(codespace).

This method returns the first (or only) occurrence of the codespace that matches or null, if it does not
exist.

Similarly, to return the first SRSName in the list that matches the input codespace, call this method:

MapInfo.Geometry.CoordSys.SRSName(codespace).

An SRSName (Spatial Reference System) represents the name of a coordinate reference system
written in GML (Geography Markup Language). This is typically, a friendly name for the coordinate
system, not a list of parameter values.

To get a list of all the codes and coordinate systems that are mapped to a particular coordinate
system, MapXtreme provides the following methods:

• MapInfo.Geometry.CoordSys.Codes(codeSpace)
• MapInfo.Geometry.CoordSys.SrsNames(codeSpace)

Keep in mind that the coordinate system information you added programmatically, will only be
maintained during the lifetime of the MapXtreme Session.

Register EPSG and SRID Codes to a Web or Desktop Configuration File

The second, and more permanent, way to add EPSG or SRID codes to MapXtreme, is by adding the
information to your web application’s Web.config file or your desktop application app.config

1

file. The

code below in bold shows the information to copy and paste into your config file. An explanation of
the code follows.


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


/>

1.

If your desktop application does not have an app.config file, you can create one by adding it to your project
from the Visual Studio Application Configuration File template.