All Cadcorp SIS API Methods

InsertDataset Method

Description

Inserts a dataset into the current SWD.

Syntax

Visual Basic
Public Function InsertDataset( _
   ByVal dataset As String, _
   ByVal pos As Integer _
) As Integer

Parameters

dataset

The path to the filename of the dataset to insert.

If the dataset class can handle parameters, then you can append parameters after the filename using a question mark.

pos
The position in the overlays list at which to insert the dataset. If this argument specifies a position in the existing overlays then the new overlay will not replace the existing overlay at the given position, but will shuffle any other overlays down the list.

Remarks

If the dataset class can handle parameters, you can append parameters after the filename using a question mark.

For example, the dataset name could be "c:\temp\MyDts.xxx?width=1024,height=768".

Below are details of accepted parameters for specific datasets and examples.


Autocad DWG Direct

The parameters for the DWGDirect dataset are:

Parameter Type Comments
entities String Choose the entities to load:

"model"

"paper"

"default" (use the last-saved settings in the file)

facet String Automatically facet bulges:

"true"

"false"

explodeblockreferences String

"true"

"false"

layout String The layout name as a string

Example

A C# JSON encoded example:

string strParams = "{\"facet\":\"false\", \"entities\":\"model\", \"explodeblockreferences\":\"false\", 
\"layout\":\"Layout1\"}"; 
string strPath = "G:\\temp\\export.dwg";
string strDataset = strPath;
strDataset += '?';
strDataset += strParams;
m_mm.InsertDataset(strDataset, 0);

ESRI BIL, BIP and BQS

The parameters for BILDataset, BIPDataset, and BQSDataset classes are:

Parameter Type Comments
model String Colour Model of raster:

"monochrome"

"grayscale"

"palette"

"rgb"

"hls"

"cmy"

"cmyk"

"grid"

"rgba"

stretch String Enable stretch:

"true"

"false"

method String Stretch method:

"linear"

"squareroot"

"logarithmic"

"exponential"

"equalization"

trim Integer Stretch Tail Trim (%):

Number in the range 1 to 5, inclusive

band1 Integer Number where n can range from 0 to the number of bands -1, inclusive
band2 Integer
band3 Integer
band4 Integer
   

Notes on band selection:

Band selection always starts with `band1`, which then may be followed by `band2`, which in turn may be followed by `band3`, which in turn may be followed by `band4`.

There must be no 'gaps' in the band parameters.

For example, the following are valid band selection parameters:

band1=
band1=,band2=
band1=,band2=,band3=
band1=,band2=,band3=,band4=

Whereas, the following are invalid sequences:

band2=
band2=,band1=
band3=,band2=
band1=,band3=,band2=

The band indices are not relevant in the above examples and have therefore not been shown.

colour String red:green:blue e.g. 255:0:0 for red
algorithm String Set the resampling method:

"none"

"nearestneighbour"

"bilinear"

"cubic"

"cubicspline"

"lanczos"

 

GDAL Datasets

File based datasets that are part of the GDAL Format list and can be added by InsertDataset can include the following parameters in the Dataset string:

Parameter Type Comments
model String Colour Model of raster:

"monochrome"

"grayscale"

"palette"

"rgb"

"hls"

"cmy"

"cmyk"

"grid"

"rgba"

stretch String Enable stretch:

"true"

"false"

method String Stretch method:

"linear"

"squareroot"

"logarithmic"

"exponential"

"equalization"

"negative"

trim Integer Stretch Tail Trim (%):

Number in the range 1 to 5, inclusive

band1 Integer Number where n can range from 0 to the number of bands -1, inclusive
band2 Integer
band3 Integer
band4 Integer
   

Notes on band selection:

Band selection always starts with `band1`, which then may be followed by `band2`, which in turn may be followed by `band3`, which in turn may be followed by `band4`.

There must be no 'gaps' in the band parameters.

For example, the following are valid band selection parameters:

band1=
band1=,band2=
band1=,band2=,band3=
band1=,band2=,band3=,band4=

Whereas, the following are invalid sequences:

band2=
band2=,band1=
band3=,band2=
band1=,band3=,band2=

The band indices are not relevant in the above examples so have not been shown.

colour String red:green:blue e.g. 255:0:0 for red
algorithm String Set the resampling method:

"none"

"nearestneighbour"

"bilinear"

"cubic"

"cubicspline"

"lanczos"

Example

sis.InsertDataset("C:\Data\NetCDF\example.nc?model=grid", 0)

 

Microstation DGN

Parameters for Microstation DGN datasets are:

Parameter Type Comments
explodegroups String Explode Groups:

"true"

"false"

explodeinserts String Explode Inserts:

"true"

"false"

readxrefs String Read External References:

"true"

"false"

usecellheaderorigin String "true"

"false"

Example

sis.InsertDataset("Q:\Data\MicroStation DGN\Bristol to Manchester.dgn?readxrefs=true", 0)

MrSID

MrSID parameters are the same as those for GDAL datasets with the addition of:

Parameter Type Comments
worldoverride String "true"

"false"

Example

sis.InsertDataset("C:\Data\MrSID\VAURBAN.SID?worldoverride=false", 0)

RAW

Parameters that can be used when inserting RAW image files are the same as those for ESRI BIL, with the addition of:

Parameter Type Comments
width Integer  
height Integer  
nodata    
skipbytes Integer The number of bytes of data in the image file to skip in order to reach the start of the image data
nbands Integer The number of spectral bands in the image
nbits Integer The number of bits per pixel per band (8, 16, 32)
ulx Integer The x-axis map coordinate of the centre of the upper-left pixel in the image
uly Integer The y-axis map coordinate of the centre of the upper-left pixel in the image
byteorder Integer The byte order in which image pixel values are stored:

I = (Little-endian, I for Intel)

M = (Big-endian, M for Motorola)

format String "true"

"false"

 

SIS Overlay (*.ovl)

No parameters are required when inserting an ovl file:

Example

sis.InsertDataset ("c:\data\counties.ovl")

 

S57 Chart

The parameters used when inserting S57 data are:

Parameter Type Comments
shallow_contour Integer Shallow Contour (m)
deep_contour Integer Deep Contour (m)
safety_contour Integer Safety Contour (m)
safety_depth Integer Safety Depth (m)
area_patterns String Show Area Patterns:

"true"

"false"

full_length_light_lines String Show Full Length Light Lines:

"true"

"false"

paper_chart_symbols String Show Paper Chart Symbols:

"true"

"false"

shallow_pattern String Show Shallow Pattern:

"true"

"false"

use_feature_table String Use Simplified (Feature Table) Styles:

"true"

"false"

symbolized_boundaries String

Show Symbolized Area Boundaries:

"true"

"false"

two_shades String

Number of Shades:

"true" Uses two shades

"false" Uses four shades

view_light_descriptions String View Light Descriptions:

"true"

"false"

group_items String "true"

"false"

Example

sis.InsertDataset("C:\Data\S-57 Chart\US5TX51M.000?paper_chart_symbols=false,use_feature_table=false", 0)

 

S57 Catalog

The parameters used when inserting S57 Catalog data are the same as those for S57 Chart, with the addition of:

Parameter Type Comments
gatewayLimit Integer  
levels Bitfield 1 Overview

2 General

4 Coastal

8 Approach

16 Harbour

 

Available: GEO D OD OM OV SISpy

Groups:

Example

sis.InsertDataset ("c:\data\counties.shp", 5)