AddDataBaseMap

AddDataBaseMap adds a new data base map to a specified MapFrame object.

Syntax

object.AddDataBaseMap(ImportFileName, ImportOptions)

Parameter

Type

Default

Description

ImportFileName

String

 

Required; This provides the path and file name including the file extension. An error is returned if a raster image is specified.

ImportOptions

String

""

Optional; This provides the import options string to specify the data import options as well as Base from Data layer specific import options. See Remarks section for more information.

Remarks

In addition to the data import options, the ImportOptions string includes five additional optional parameters when creating a base map from data.

Parameter

Type

Default

Description

DataBaseFirst

Integer

First row of worksheet

Optional; specifies the first row of data to include in the base layer

DataBaseLast

Integer

Last row of worksheet

Optional; specifies the last row of data to include in the base layer

DataBaseFrequency

Integer

1

Optional; specifies which rows included between the first and last row

DataBaseXCol

String

First column

Optional; specifies the column containing the X coordinates

DataBaseYCol

String

Second column

Optional; specifies the column containing the Y coordinates

Example

This example demonstrates how to create a map of data points and add layers with options.

Sub Main

 

Dim Surfer As Object

Set Surfer = GetObject(,"Surfer.Application")

Surfer.Visible = True

 

Set doc = Surfer.Documents.Add

 

Set map2 = doc.Shapes.AddDataBaseMap(Surfer.Path+"\samples\demoslice.bln")

map2.Name = "map including demoslice.bln layer as points"

 

Set dataLayer2 = doc.Shapes.AddDataBaseLayer(Map:=map2, ImportFileName:=Surfer.Path+"\samples\demogrid.dat", ImportOptions:="DataBaseXCol=2;DataBaseYCol=1")

dataLayer2.Name = "demogrid.dat as points with X and Y cols switched"

 

Set dataLayer3 = doc.Shapes.AddDataBaseLayer(Map:=map2, ImportFileName:=Surfer.Path+"\samples\demogrid.dat", ImportOptions:="DataBaseFirst=20;DataBaseLast=40;DataBaseFrequency=5")

dataLayer3.Name = "demogrid.dat as points with filtered rows"

 

End Sub

Used by: Shapes collection