AddRasterBaseLayer

AddRasterBaseLayer adds a new base (raster) layer to the specified MapFrame object. Returns a RasterBaseLayer object. The AddRasterBaseLayer method creates a base (raster) layer. To create a base map from vector data, use AddVectorBaseLayer.

Syntax

object. AddRasterBaseLayer( Map, ImportFileName, ImportOptions )

Parameter

Type

Default

Description

Map

MapFrame

required; It specifies the MapFrame object in which the base layer is added.

ImportFileName

String

required; It provides the path and file name including the file extension. An error is returned if a vector data file is specified.

ImportOptions

String

""

optional; It provides the import options string. See below for specific options for the various file types.

Remarks

ImportFileName must include a file extension. See the following links for more details on ImportOptions.

Extension

File Type

AN? ACR-NEMA

Medical Image [.AN1] [.AN2]

BMP

No import automation options are available.

DICOM3

Medical Image [.DIC] [.DCM]

ECW

ERMapper [.ECW]

EMF

Windows Enhanced Metafile [.EMF]

GIF

No import automation options are available.

GSI

Golden Software Interchange File [.GSI]

JPG

No import automation options are available.

PDF

Adobe Portable Document Format [.PDF]

PLT

Golden Software PlotCall [.PLT]

PNG

No import automation options are available.

PNM/PPM/PGM/PBM

No import automation options are available.

RGB SGI-RGB

No import automation options are available.

SID

LizardTech MrSID Image [.SID]

SUN

No import automation options are available.

TGA

No import automation options are available.

TIF

No import automation options are available.

WMF

Windows Metafile [.WMF]

X AVS

No import automation options are available.

Example 1

This example demonstrates how to create a contour map coordinate system named MapFrame followed by its corresponding contour map named ContourLayer from the grid file named Diablo.grd. It then adds the base layer in the same map frame with the AddBaseLayer method.

'declare the MapFrame object and create a new map frame

Dim MapFrame As Object

Set MapFrame = Shapes. AddContourMap(GridFileName:=SurferApp.Path+"\Samples\Diablo.grd")

 

'declare the ContourLayer object and set the reference to the contour layer

Dim ContourLayer As Object

Set ContourLayer = MapFrame.Overlays(1)

 

'declare the RasterBaseLayer object and create a new base layer

Dim RasterBaseLayer As Object

Set RasterBaseLayer = Shapes.AddRasterBaseLayer(Map:= MapFrame, _

ImportFileName:=SurferApp.Path+"\Samples\Diablo_Sat.tif")

Example 2

This example demonstrates how to add a base layer to a map while specifying file import options.

'create a new base layer

Plot.Shapes.AddRasterBaseLayer(Map:= MapFrame, _

ImportFileName:=file_directory+"q1914ne.sid",ImportOptions:="Scale=16")

Example 3

This script displays all the methods and properties in the Shapes collection.

Used by: Shapes collection

See Also

RasterBaseLayer Object

VectorBaseLayer Object

Base Map