AvisMap - Mapping Software Provider

Affordable GIS / Mapping Software Products and Solutions.

HOLIDAY ANNOUNCEMENT FOR CHINESE SPRING FESTIVAL: Our Office Will Close until February 25, 2010

The AvisMap GIS Technologies office will be closed beginning Friday, Feb. 12, and will reopen on Thursday, Feb. 25, 2010, at 8:30 a.m because of the Chinese new year holiday.

Who contact us by e-mail or phone with questions during this time will receive responses in the order they were received when the office reopens on Feb 25.

We welcome your inquiries and do appreciate your patience at this time.

Style Mapping Table for GIS and CAD Data Conversion

Data in different GIS or CAD software have specified line styles, fonts, symbols, and fill styles which might not be kept as usual after being imported into AvisMap format. In order to keep original style settings to the full extent, we present the conception of Style Mapping Table which can be generated by user self in outside. User can specify the corresponding relationships of each line style, font, symbol, and fill style.

Format description of Style Mapping Table

  • There are seven parts involved in the table:
    a. Table title
    b. Font reference
    c. LineStyle reference
    d. Symbol reference
    e. Fillstyle reference
    f. Color mode
    g. DXF’s path and file name
  • The table title has three rows:
    AvisMap Style Mapping Table
    Version 3.00
    Separator “&”

Where, the characters in the double quotation marks after Separator are delimiters between fields in the Style Mapping Table. It is specified by user to avoid conflicting with characters in the text. The default is a comma (,) the ASCII code.

  • The reference part of the font begins with FontBegin, and ends with FontEnd. Each row between them represents a kind of corresponding relationship of font. And it is made up of four domains being separated by delimiters. The four domains are grouped as below:
Domain 1 Domain 2 Domain 3 Domain 4
Text Style Name/Font face/ID in outer data Scale of font width Scale of font height1 Font face in AvisMap

Note:

a.Text style name should be specified in Field 1 if it is AutoCAD data. Font face or ID should be specified if it is Microstation DGN data;

b.The font width and height of outer data will be read by program, but the zoom scales of them should be specified by user self.

Import: outer font width * font width zoom scale ==> AvisMap font width

Import: outer font height * font height zoom scale ==> AvisMap font height

Export: AvisMap font width / font width zoom scale ==> outer font width

Export: AvisMap font height / font height zoom scale ==> outer font height

That is, you can use the same .srt file to export the imported data. Therefore, you can get the same font width and height as original ones before imported, and vice versa.

  • The reference part of the linestyle begins with LineStyleBegin, and ends with LineStyleEnd. Each row between them represents a kind of corresponding relationship of LineStyle. And it is made up of two domains being separated by delimiters. The two domains are grouped as below:
Domain 1 Domain 2

Linestyle name/ID in outer data

Linestyle ID in AvisMap

The reference part of fillstyle is similar with the one of linestyle.

  • The reference part of the symbol begins with SymbolBegin, and ends with SymbolEnd. Each row between them represents a kind of corresponding relationship of symbol. And it is made up of three domains being separated by delimiters. The three domains are grouped as below:
Domain 1 Domain 2 Domain 3

Symbol name/ID in outer data

Symbol zoom scale

Symbol ID in AvisMap

Note:

The symbol size of outer data will be read by program, but the zoom scale should be specified by user self.

Import: outer data’s symbol size * symbol zoom scale = AvisMap symbol size

Import: SupeMap symbol size / symbol zoom scale = outer data’s symbol size

That is, you can use the same .srt file to export the imported data. Therefore, you can get the same symbol size as original one before imported, and vice versa.

Text color setting:

If there is no special setting involved in text, just use the color being set in “Import or Export color mode”.

  • The DXF file includes two rows:
    dxffile
    jr12.dxf

Where, the second row shows the DXF file and path name which can be absolute or relative, or no path used here. In this case, the DXF file must be saved in the same path as the Style Reference Table file.

  • The extension name of the file is *.srt.
  • All notes begin with // just like the case in C++, but without /* */ marking
  • There is no upper or lowercase distinction in style reference table. Besides the title must lie in the beginning of the file, other five parts have no particular order, that is, they can be mixed but can’t be nested.
  • In some GIS or CAD software, their linestyles, symbols, fonts, or fillstyles may not be marked with a name but with an ID or number. In this case, to enhance the general availability of the .srt file, the outer data’s linestyles, symbols, fonts, or fillstyles can be identified by name or ID. In AvisMap, a font is identified with name, while linestyles, symbols, and fillstyles are identified with IDs.
  • The contents of DXF file are the outer data’s style and names/IDs. In style reference, the system will search for them in the specified DXF file.
  • There are three color modes of DXF file (imported or exported):
    a. Specified by layer. The color of an object in DXF file is specified by the reference file of the corresponding layer.
    b. Specified by user. User can specify a field as the color index. If there is no specification, use the field “Color”, and if the field not found, use the color of object itself as described in below c.
    c. Use the color of an object itself.

Examples of Style Table Reference:

  • Sample Data =====> without notes

    AvisMap Style Mapping Table
    Version 3.00
    Separator “,”

    FontBegin
    1 , 0.83333333 , 1.0 , Arial
    7 , 0.50000000 , 0.66666 , Arial
    23 , 0.83333333 , 0.66666 , Arial
    135 , 1.0 , 1.0 , aips_AM
    205 , 0.50000000 , 1.0 , Bold
    ..
    FontEnd

    LineStyleBegin
    al, 3
    DASHED, 54
    3, 1
    ..
    LineStyleEnd

    SymbolBegin
    0301__, 10.0, 301
    0302__, 10.0, 302
    0303__, 10.0, 303
    0401__, 10.0, 401
    0402__, 10.0, 402
    ..
    SymbolEnd

    FillStyleBegin
    1, 3
    2, 4
    3, 1
    ..
    FillStyleEnd

    dxffile
    jr12.dxf

    ColorModeBegin

    StyleColor ByLayer
    StyleColor ByColorIndexField FieldName
    StyleColor ByGeometry

    TextColor ByLayer
    TextColor ByColorIndexField [FieldName]
    TextColor ByGeometry

    ColorModeEnd
  • Sample Data=====>with notes
    //the text match no case
    AvisMap Style Mapping Table //the mark of file type
    Version 3.00 //Version Number
    Separator “&” // strongly recommended, but can be ignored, here, the default is “,”. In this example, we use && as delimiter.
    //In the following code, the font, lineStyle, symbol, and fillStyle have no particular order, but can’t be nested.
    FontBegin //font begins
    //outer font name/ID, font width scale, font height scale, AvisMap font name
    1 && 0.83333333 && 1.0 && Arial //Normal
    7 && 0.50000000 && 0.66666 && Arial
    23 && 0.83333333 && 0.66666 && Arial
    135 && 1.0 && 1.0 && aips_AM //Morse
    205 && 0.50000000 && 1.0 && Bold //Bold
    ..
    FontEnd //font ends

    LineStyleBegin //linestyle begins
    //outer linestyle name/ID, AvisMap linestyle name
    1 && 3
    2 && 4
    3 && 1
    ..
    LineStyleEnd //linestyle ends

    SymbolBegin //symbol begins
    //outer symbol’s name/ID, symbol scale, AvisMap symbol’s ID
    0301__&& 10.0&& 301 //outer symbol size * zoom scale –> AvisMap symbol size
    0302__&& 10.0&& 302
    0303__&& 10.0&& 303
    0401__&& 10.0&& 401
    ..
    SymbolEnd //symbol ends

    FillStyleBegin //fillstyle begins
    //outer fillstyle’s name AvisMap fillstyle’s ID
    1 && 3
    2 && 4
    3 && 1
    ..
    FillStyleEnd //fillstyle ends

    dxfffile
    c:\data\dxffile\jr12.dxf //the directory and name of the dxf file

    ColorModeBegin

    // The separators can be space, comma, && etc (ASCII)
    // You can select one of them.
    StyleColor ByLayer
    StyleColor ByColorIndexField FieldName // (The default ColorIndex can be used)
    StyleColor ByGeometry

    // Select one of them
    TextColor ByLayer
    TextColor ByColorIndexField [FieldName] //(optional)
    TextColor ByGeometry

    ColorModeEnd

Reserved Keywords in Database

There are some restrictions in datasets or fields creation, especially about their names:

  • The length of name string can not be zero or over 30 bytes (that is 30 letters or 15 Chinese characters are allowed ), typically to SDM for Oracle data, the actual length is 18 bytes because some extra characters may be appended to the original name after some operations such as index creation being performed.
  • Figure, underline or initial with “sm” are not allowed.
  • All characters except for figure, letter, Chinese character, underline are not allowed;
  • Can not conflict with the reserved keywords of databases which has been listed as below:

In Oracle or Microsoft Access database, there are some reserved keywords can not be used when creating dataset or field. In addition to the following listed keywords, the system generated objects in Oracle will be named with SYS_ as prefix; therefore, any prefixes with SYS_ will be rejected in Oracle.

ABORT COMMIT EXIT LIMITED ORDER ROWLABEL TERMINATE
ACCEPT COMPRESS FALSE LOCK OTHERS ROWNUM THEN
ACCESS CONNECT FETCH LONG OUT ROWS TO
ADD CONSTANT FILE LOOP PACKAGE ROWTYPE TRIGGER
ALL CRASH FLOAT MAX PARTITION RUN TRUE
ALTER CREATE FOR MAXEXTENTS PCTFREE SAVEPOINT TYPE
AND AND FORM MIN PLS_INTEGER SCHEMA UID
ANY CURRVAL FROM MINUS POSITIVE SELECT UNION
ARRAY CURSOR FUNCTION MLSLABEL POSITIVEN SEPARATE UNIQUE
ARRAYLEN DATABASE GENERIC MOD PRAGMA SESSION UPDATE
AS DATA_BASE GOTO MODE PRIOR SET USE
ASC DATE GRANT MODIFY PRIVATE SHARE USER
ASSERT DBA GROUP NATUAL PRIVILEGES SIZE VALIDATE
ASSIGN DEBUGOFF HAVING NATURALN PROCEDURE SMALLINT VALUES
AT DEBUGON IDENTIFIED NEW PUBLIC SPACE VARCHAR
AUDIT DECLARE IF NEXTVAL RAISE SQL VARCHAR2
BETWEEN DECIMAL IMMEDIATE NOAUDIT RANGE SQLCODE VARIANCE
BINARY_INTEGER DEFAULT IN NOCOMPRESS RAW SQLERRM VIEW
BODY DEFINITION INCREMENT NOT REAL START VIEWS
BOOLEAN DELAY INDEX NOWAIT RECORD STATE WHEN
BY DELETE INDEXES NULL REF STATEMENT WHENEVER
CASE DESC INDINDICATOR NUMBER RELEASE STTDEV WHERE
CHAR DIGITS INITIAL NUMBER_BASE REMR SUBTYPE WHILE
CHAR_BASE DISPOSE INSERT OF RENAME SUCCESSFUL WITH
CHECK DISTINCT INTEGER OFFLINE RESOURCE SUM WORK
CLOSE DO INTERFACE ON RETURN SYNONYM WRITE
CLUSTER DROP INTERSECT ONLINE REVERSE SYSDATE XOR
CLUSTERS ELSE INTO OPEN REVOKE TABAUTH TEXT
COLAUTH ELSIF IS ROWLABEL ROLLBACK TABLE .
COLUMN EXCLUSIVE LEVEL OPTION ROW TABLES .
COMMENT EXISTS LIKE OR ROWID TASK .

About SDM for Oracle Spatial

  • You should make sure there are records in the database view: User_sdo_geom_metadata, otherwise no dataset will be included in a new Oracle Spatial datasource. The possible solution is: users try to add records to the view User_sdo_geom_metadata outside manually according to the particular data and then create datasource.
  • Primary Key must be specified in spatial data table.
  • Point, line, region, text and tabular datasets are supported in SDM for Oracle Spatial engine. Where, the geospatial data in point, line and region datasets is stored in the field Mdsys.Sdo_Geometry, the text dataset uses the same storage format with the one in SDM for Oracle.
  • The supported Sdo_Gtypes in Mdsys.Sdo_Geometry:
  • 1/2001/3001/2005/5
    2/2002/3002/2006/6
    3/2003/3003/2007/7
  • Projection transformation is not supported in SDM for Oracle Spatial.
  • Encoded type of dataset is not supported in SDM for Oracle Spatial.
  • Once a SDM for Oracle Spatial datasource has been created, it will not keep the boundaries and indexes for all connected datasets or the ones being copied form outside, if there is not any geometry in dataset, please re-compute or rebuild boundary and spatial index for the dataset.
  • Image dataset in SDM for Oracle Spatial is not the image format regulated by Oracle Spatial but uses the format as the one in SDM for Oracle.
  • Dataset Name Regulations in SDM for Oracle Spatial: To the non AvisMap created dataset, the name is like: TableName_GeospatialcolumnName, for example, a Shapefile Street with geospatial column Shape, the corresponding dataset name in AvisMap is: Street_Shape. If there are multi Sdo_Geometry type columns in a table, each column will have a dataset or a layer to correspond. To the dataset created by AvisMap software, its name is identical with the table.

Transaction in AvisMap GIS Engine

Short transaction and Long transaction are all supported in AvisMap GIS Engine.

What’s transaction?

Transaction is a common conception in database applications, which is a series of operations being performed based on a single logistic work cell. There are four properties to each logistic work cell, called ACID (Atomicity, Consistency, Isolation and Durability) which are absolutely necessary to a transaction. Among these properties, the concurrency and atomy are the key points needed to be concerned especially in GIS applications. Where, concurrency can control a GIS data can not be modified by two or more users simultaneously or one user can not edit the data before the other ones has committed the updates; and atomicity can insure that all work flows in a transaction can be treated and finished just as an integrated group. If there is one step failed, the other should stop to be continued. This kind of mechanism of transaction is provided by database management system (DBMS), and surely supported by AvisMap GIS Engine, that is short transaction mechanism.

Limitations of short transaction:

  • As short as possible.
  • Users other than the one who is editing a GIS dataset can not edit even browse the dataset.
  • Transaction can not span long period of time; it must be committed or rolled back before you shut down your computer at least.
  • If there are some unexpected circumstances occurring, for example, power interruption or computer down, the changes will be lost.

Long transaction in AvisMap GIS Engine:

GIS users have some specialized transactional requirements:

  • Transactions must span long periods of time, sometimes days and months, not just seconds or minuets.
  • Once modifications have been done, it would not lost even some unexpected circumstances mentioned above have taken place.
  • Users can roll back all changes at any time if they are not satisfied with them.
  • Any changes being committed can be seen by other users.
  • The other users can modify the area previously locked by one user only after it has been committed or rolled back.


The long transactions in AvisMap GIS Engine SDM can completely meet the above requirements. The comparisons between the short and long transactions in AvisMap GIS Engine SDM are listed as below:

Characteristics Long Transactions Short Transactions
Multiuser editing Yes No
Time Long (days, months or longer) Short
Unexpected circumstances occurring Changes will be kept Changes will be lost

How to use long transaction in AvisMap GIS Engine SDM?

It is very easily to use the long transaction functions of SDM datasource, the soLongTransaction object is provided to perform the operations of long transaction. We can get the object through the following code (here, take the VB code as example):


Dim objLT As soLongTransaction
Set objLT = objDatasource.LongTransaction ……

Operations in long transaction:

There are three basic operations in long transaction object: CheckOut, CheckIn and UndoCheckOut.


CheckOut: Identify the transaction has started and lock the data required to be edited until the transaction terminated, and during the period other users can only view and get the state of the data before it has been checked out.
CheckIn: Commit all changes modified by user, and determine whether the data will be continued checked out which is set according to the parameter involved in the method. After calling the method, other users can view the newest data.
UndoCheckOut: Once you undo all changes, the data will be rolled back to its original state. If the property AutoCheckOut of soLongTransaction object has been set as False, the locked data will be released otherwise locked continuously.

Operable data level:

The long transaction can be done on three data levels: DataSource, Dataset and Recordset.


DataSource: Perform transactions in dataSource in which all data except for those locked by other users will be checked out.
Dataset: Perform transactions in dataset (layer or table) in which all data except for those locked by other users will be checked out.
Recordset: Perform transactions in recordset in which all records that meet the condition or a certain area in layer will be checked out.

Descriptions of Properties and Methods:

All the properties and methods listed below are involved in the object soLongTransaction:

Properties Type Description
User BSTR User name logged in long transaction.
Password BSTR Long transactional user’s password
Logged Boolean Identifies whether a user has successfully logged in long transaction environment.
AutoCheckOut Boolean Identifies whether the state of CheckOut will be kept continuously after committing or rolling back the changes.


Methods Data Level Description
LogIn - Logs in long transaction.
LogOut - Logs out long transaction.
CheckOut DataSource Checks out or locks the datasource to begin transaction process.
CheckIn DataSource Checks in or commits the changes to datasource.
UndoCheckOut DataSource Undoes or rolls back the changes to datasource.
CheckOutDataset Dataset Checks out or locks the specified dataset (table or layer).
CheckInDataset Dataset Checks in or commits the changes to dataset (table or layer).
UndoCheckOutDataset Dataset Undoes or rolls back the changes to dataset (table or layer).
CheckOutRecordset Recordset Checks out or locks a certain recordset (or an area of a layer).
CheckInRecordset Recordset Checks in or commits the changes to recordset.
UndoCheckOutRecordset Recordset Undoes or rolls back the changes to recordset.

Tips:

  • Long transaction is available in SDM for Oracle and SDM for SQL Server.
  • Long transaction user should be created in server side by DBA before you log in the environment. For example, if you have installed the Oracle client software, open Oracle Enterprise Manager Console, click Database and expand solutions, select a certain instance and find SMLTUSERS table, right-click Browse/Edit Directory…, you can add users and set passwords for them in this table, or use SQL statements directly.
  • If you have logged on long transaction environment, but have not set the property AutoCheckOut as True, the data could not been edited.
  • The data definition language for instances creating or deleting table, creating or deleting field etc will do the really changes to database and can not be rolled back in long transaction, therefore, you should check in or undo your changes before performing any DDLs.

Match Table of Field Copy

The method CopyField of soRecordset can copy one field to another; even the different types of fields, the corresponding match rule are listed below:

Boolean Byte Integer Long Currency Single Double Date Text Memo
Boolean Y Y1 Y1 Y1 N Y1 Y1 N Y2 Y2
Byte Y3 Y Y Y Y Y Y N Y Y
Integer Y3 Y4 Y Y Y Y Y N Y Y
Long Y3 Y4 Y4 Y Y Y Y N Y Y
Currency N Y4 Y4 Y4 Y Y Y N Y Y
Single Y3 Y4 Y4 Y4 Y Y Y N Y Y
Double Y3 Y4 Y4 Y4 Y4 Y4 Y N Y N
Date N N N N N N Y Y Y Y
Text N Y5 Y5 Y5 Y5 Y5 Y5 N Y Y
Memo N Y5 Y5 Y5 Y5 Y5 Y5 N Y Y

How to read the table?

Each Y or N means field can be copied or not from the corresponded row to column, and Y means yes and N means no. The particular Y or N with superscript has restrictions shown as below which should be noticed in practical operations.


1- Boolean to Numeric, True becomes to 1 and False becomes to 0;
2- Boolean to String, True becomes to “true” and False becomes to “false”, but in some special databases, true will become to “1″ and false become to “0″
3- Numeric to Boolean, non-zero value becomes to True and zero becomes to False;
4- Possibaly occurring data truncated.
5- If there are non-numeric characters involved in text, for example, “aaa”, it would fail to match the specified type.

Descriptions:

  • The match table of field copy may have difference in details due to the different engines, for example, the Memo field is only supported by SDB or SDBPlus engine, not in SQL and others.
  • In essential, field copy is implemented via the standard SQL sentences of database: Update TableName Set DestFieldName = SourceFieldName. If you have any questions about the function, please refer to the usage in particular database.

Creatable Objects List

Some objects can be created in programming through CreateObject or Dim As New (for Visual Basic 6.0 only), the syntax of how to create these objects may be different in particular development environments. For instance, we want to create an object: so3DAnalyst, it should be Dim obj3DAnalyst As New so3DAnalyst in Visual Basic 6.0, but obj3DAnalyst:=coSo3DAnalyst.Create in Delphi. Additionally, it is strongly recommended you judge whether an object is empty before using it, and if the object will no longer be used, you should release it, for example, use set obj3DAnalyst = Nothing in Visual Basic 6.0 and obj3DAnalyst:=nil; in Delphi.

Creatable Objects List:

so3DAnalyst soGeoEllipticArc soLytLineSect soPJPrimeMeridian
soColors soGeoLine soLytMap soPJSpheroid
soConnectionMatix soGeometrist soLytMapBorder soPJParams
soPJTranslator soCutFillResult soGeoPath soLytMapScale
soPoint soDataSourceConnection soGeoPie soLytPolygon
soPoint3D soDgnLink soGeoPoint soLytPolyline
soPoint3Ds soError soGeoRect soLytRect
soPoints soFieldInfo soGeoRegion soSetting
soLytRoundRect soRect soFieldInfos soGeoRoundRect
soLytTable soSelection soFlightControl soGeoText
soLytText soStrings soGeoArc soGridAnalyst
soNetworkAnalyst soStyle soGeoBSpline soImageAnalyst
soOverlayAnalyst soStyles soGeoCardinal soLytArc
soPathNode soTextPart soGeoCircle soLytArtText
soPathNodes soTextStyle soGeoCompound soLytDirection
soPJCoordSys soToolkit soGeoCurve soLytEllipse
soPJDatum soTransformation soGeoEllipse soLytGroup
soPJGeoCoordSys soGeoEllipseOblique soLytLegend -
soImageList soTimeItem soMapMargin -

Error codes and descriptions

Error Code Description
-201 No workspace connected with AvisAnalyst control, please do the following connection: AvisAnalyst.connect AvisWorkspace.Handle
-202 Can not create Route dataset
-203 Can not create Center dataset
-204 Can not create Center-Nodes table
-205 Can not create Center-Edges table
-206 Error allocation mode
-207 Can not get the node demand
-208 Cant not get the edge demand
-209 Failed to allocate resources
-210 Can not create turntable
-211 No turntable exported
-11829 The total number of unique values can not exceed %d. Failed to create unique thematic map!
-11831 The total number of ranges can not exceed %d. Failed to create range thematic map!
-13101 Object with zero perimeter or area is not allowed in region dataset.
-13102 Object with zero length is not allowed in line dataset.
-13103 Invalid number of rows or columns.
-13104 Failed to open dataset.
-13105 Invalid DataSource path.
-13106 The specified recordset does not exist.
-13107 The tolerance can not be zero or negative.
-13108 Only line and network dataset can be resampled!
-13109 Can not write to a read-only dataset.
-13110 The specified recordset is empty.
-13111 The specified dataset is empty.
-13112 Type mismatch between recordset and dataset.
-13113 Failed to create fields.
-13115 The name string may contain invalid character(s) or system prefix (”Sm”).
-13116 The dataset with the specified name already exists.
-13117 Can not write to a read-only datasource.
-13121 The source network has topological error.
-13122 The dataset with specified name does not exist.
-13123 Invalid dataset object found.
-13124 Duplicated parameters found.
-13125 The dataset used to store the overlay result must be empty.
-13126 Only region dataset can be used to execute the intersection operation.
-13127 Only region dataset can be used to execute the erasing operation.
-13128 Only region dataset can be used to execute the clipping operation.
-13129 Only region dataset can be used to execute the identity operation.
-13130 Only region dataset can be used to execute an union operation.
-13138 This type of dataset can not be Intersected with region dataset.
-13139 Failed to query dataset
-13140 Failed to get field information
-13141 Having NULL pointer in the afferent parameters.
-13142 The type of source and target datasets must be identical.
-13143 Planar coordinate system can not be transformed into geographic or projected coordinate system.
-13144 The source and target coordinate systems are identical, so there is no need to transform.
-13145 Cannot transform the two geographic coordinate systems.
-13146 Invalid projected coordinate system.
-13147 The source is not a projected coordinate system.
-13148 The target is not a projected coordinate system.
-13149 The source is not a geographic coordinate system.
-13150 The target is not a geographic coordinate system.
-13151 Mapping Date: Layout Style 1980 Xi’an Coordinate System 1985 National Elevation Datum
-13152 There is no intersection between image and clip data, Failed to clip!
-13153 Failed to create cache file!
-13154 Failed to create new dataset!
-13156 Invalid setting of the NodeID field!
-13157 The pointer of datasource is empty!
-13160 The specified format of bitmap must be in accordance with the image. Failed to clip!
-13167 Invalid password!
-13169 Only region and line dataset can be dissolved!
-13171 All fields required to be joined already exist in current dataset, so it is no need to join them!
-13172 The current recordset has not attribute fields, therefore, the statistic analysis can not be processed!
-13174 MrSID and ECW dataset can only be copied from one SDB/SDBPlus datasource to another.
-13175 The name can not be empty!
-13176 The name has exceeded the limited character length!
-13177 The name is conflicted with system reserved fields!
-13178 The initial character of dataset name can not be digit or underline!
-13179 The field name already exists.
-13186 Invalid node selected tolerance value.
-13187 No matched arc
-13188 Invalid end node!
-13189 No demand node or center.
-13190 Unmatched resource allocation type!
-13191 Invalid number of centers!
-13192 No candidate centers!
-13193 Inadequate candidate centers!
-13194 Can not allocate resources to the non-center!
-13195 The demand nodes have not been allocated correctly!
-13197 The pointer has reached the beginning of the recordset!
-13198 The pointer has reached the end of the recordset!
-13199 The current recordset has not spatial data included, so the spatial operation can not be processed!
-13200 Dataset is not opened.
-13201 Can not query spatial data in a Tabular dataset.
-13202 The datasource has not been opened.
-13203 The string of datasource connection info is invalid.
-13204 The string for user login is invalid.
-13205 Lack of ‘;’.
-13206 BackColor
-13207 The recordset is not opened.
-13208 The query option is invalid.
-13209 Computing polygon area
-13211 Can not copy dataset from Image PlugIns.
-13237 Unmatched dataset type
-13238 Empty dataset pointer
-13239 Haven’t set turntable fields
-13240 Haven’t set edge ID and/or Node ID field
-13241 Haven’t set barrier field
-13242 Cannot create ECW or MrSID dataset by templet.
-13243 Cannot copy LineZ, LineM, PointZ and Network dataset from SDB to SQL SERVER datasource.
-13244 Failed to get ImageBlock.
-13245 Failed to create field (%s) due to error field Name.
-13246 Failed to create field %s because its length is longer than 30 characters.
-13247 Failed to append vector dataset with exception.
-15007 An invalid SQL statement was used!
-16302 SDM for Oracle Engine doesn’t support this type of dataset now.
-16318 Not enough cache zone.
-16319 SDM for Oracle can not open datasource which version is %ld now, please contact AvisMap Technology Support Department (support@AvisMap.com).
-16321 System default user can not create AvisMap datasource
-16322 Long transaction user has not logged on!
-16323 The current record has been checked by others!
-17005 Geometry is unmatched with property! The dataset has been corrupted.
-17007 Converting data to exchange format of database, please wait…
-17009 Please close the opened recordset first!
-17305 Geometry is unmatched with property! The dataset has been corrupted!
-17309 Please close the opened recordset first!
-17602 SDX Engine don’t support this type of dataset now.
-17619 The current SDX for SQL SERVER can not open the datasource with version %s, if you have any question, please contact us.
-17620 Current record has been checked by others, you can not edit it.
-17621 You have not logged in long transact environment.
-17623 ome records have been checked by others, so the operation based on the whole table can not be processed.
-18509 SDM for SQL Server doesn’t support this version of datasource.
-18953 Recordset is read only!
-18959 Not support to build pyramid
-18960 There are records still being locked by others, locking or unlocking operations can not be done.
-18961 Long transaction user hasn’t logged on.
-18962 Datasource hasn’t been opened.
-18963 Cannot execute the overall operations such as locking or unlocking to table if some records are still checked by others.
-18964 It is not in an auto-checkout status, so it can not be edited or added, please set it as auto-checkout or just check out the records that require to be modified.
-18965 Record is checked out by others
-18966 Table has been locked, it can not be operated now!
-18967 Failed to connect with datasource!
-20926 Datasource’s alias “%s” already exists!
-20946 The engine SDX for %d can not be found.
-20947 You should specify a name for the SDM workspace or the workspace name already exists.
-20956 Database can not be connected or file can not be opened!
-21555 Invalid file %s…
-21556 No attribute field!
-21558 Invalid file format.
-21559 Unsupported image file format.
-21560 The record number is too large.
-21570 DMRS DgnLink does not support to be set as %s.
-21572 Errors occur when Importing Coverage(PC)’s user-defined table:
-21573 Error directory!
-21575 There are unsupported field types in attribute table!
-21576 Writing file error!
-21577 Inner error, can’t read data!
-21578 Error occurs when writing Coverage’s system fields!
-21579 info\arc.dir file length error!
-21580 User field error!
-21581 Too many user fields!
-21582 Creating arc000x.dat error!(info/)
-21583 Creating user field error!
-21584 Field type error!
-21585 Creating field information error!
-21586 Attempt to create an existed file!
-21588 Inner error, cannot write data!
-21589 Uncertain file error!
-21590 Coverage precision error!
-21591 Open file error(maybe hardware error)!
-21592 The file denied to be accessed!
-21593 Invalid file!
-21594 Too many files!
-21595 Cannot find the specified file!
-21597 Invalid Coverage file!
-21598 Invalid integer data!
-21599 Inner error! Attempt to operate an unopened file!
-21600 Too many points!
-21602 File sharing error!
-21603 The annotation’s character is too long !
-21604 Errors occur when importing Coverage(Sun) user-defined table!
-21605 Importing Coverage(Sun) user-defined table!
-21606 Errors occur when importing Coverage’s annotation!
-21607 Errors occur when importing Coverage’s label!
-21608 Errors occur when importing Coverage(Sun)’s label!
-21609 Errors occur when importing Coverage’s network!
-21610 Errors occur when importing Coverage(Sun)’s network!
-21611 Errors occur when importing Coverage’s line!
-21612 Errors occur when importing Coverage(Sun)’s line!
-21613 Errors occur when importing Coverage’s polygon!
-21614 Errors occur when importing Coverage(Sun)’s polygon!
-21615 Errors occur when importing Coverage’s annotation!
-21616 Errors occur when importing Coverage(Sun)’s annotation!
-21670 %s is a binary format of DXF file, system doesn’t support it now.
-21671 … is preparing temporary data. It will last several minutes which will depend on the size of your file, please wait…
-21672 Now we are importing data to SQL DB using a quick method, but there is no enough storage space, are you sure to use the quick method? Click “YES”,: or click “NO” to use common method to import data.
-21676 The number of curve’s control points can not be less than 6.
-21677 Failed to open the description file %s of Idrisi VEC. Please check if the description file of DVC is locating the same folder.
-21704 Failed to initialize file.
-21706 Error file extension. It should be DWG or DXF.
-21708 Failed to read header file.
-21710 nvalid AutoCAD file version.
-21712 File pointer is empty!
-21714 Pointer of layer information is empty!
-21716 Invalid name
-21718 Invalid AutoCAD file type.
-21720 Invalid number.
-21721 Please select a proper SHX file.
-21732 Failed to create log file.
-21733 Failed to get log file.
-21735 Importing Erdas Image file…
-21736 Exporting Erdas Image file…
-21737 Unsupported version of the file!
-22402 Please confirm that there are two points of intersection between the polyline and the boundary!
-22403 The data has been damaged.
-22404 Error node information of the XML file!
-22405 Error XML data!
-22406 The number of points is not identical.
-23632 There is an invalid icon or the icon’s size is too large, please delete it first!
-23639 Too many files!
-23644 Error object head
-23645 Unrecognized version
-23646 File Error
-23647 Empty symbol library
-23648 Symbol not found
-23650 Invalid symbol
-23651 Invalid stroke
-23652 Invalid rectangle
-23653 Invalid text
-24201 This ID already exists, please input a new one!
-24202 The name already exists, please input a new one!
-24239 The number of line styles must be larger than 6!
-25403 Error occurs!
-25404 Too many objects being snapped! Please clear the screen.
-25418 Failed to get snapped line!
-25419 Failed to get an editable object!
-25420 Failed to set point to a non existed snapped element!
-25421 Failed to get an object!
-25441 Can not get the coefficients! please add or modify the control points!
-25447 Failed to get geometry
-25453 Resolution is too large!
-25456 An error has occurred in the course of management!
-25464 Invalid recordset for editing objects!
-25497 Invalid map sheet number
-25498 Invalid scale type
-25499 Parameter error
-25500 Invalid sheet bounds
-25501 Invalid starting longitude and/or latitude
-25502 Invalid projection information
-26028 Too small rectangle area to create map scale element!
-26029 Input scale value is not appropriate. Are you sure?
-26031 Map Legend already exists!
-26034 The file size that you have selected is too large!
-27302 The number of input points can not be less than 3.
-27303 Identical point(s) found!
-27304 Invalid value!
-27306 The parameter “-I” can be used when creating refined TIN.
-27315 Mismatched dataset type
-27322 Invalid contour interval!
-27323 Invalid smoothness! Please input an integer number between 0 and 5!
-27325 Failed tracing the closed isoline, the isoline value is %f.
-27326 Failed building spatial index!
-27345 No overlapped area between the datasets!
-27346 Invalid cell size
-27347 Invalid math expression!
-27348 It’s not a raster dataset!
-30701 Repeated vertices found!
-30702 Please set a line dataset as input first!
-30703 Please set a region dataset as input first!
-30704 Read line data error!
-30705 Found a pseudo node!
-30706 Topology error!
-30707 A region with 0 area found!
-30708 Failed to calculate centroid of a region!
-30709 Found a dangle node!
-30710 The number of arcs in the region is more than the total number of arcs!
-30711 Please set a region dataset as output!
-30737 A fatal topological error has occurred!
-30744 Error dataset boundary!
-30745 The extended length can not be zero!
-30750 An error has occurred in searching node
-30751 Creating topological error information(%d/%d)..
-30754 Topological error found at the line with ID=%d
-30767 Multipart polyline objects found in line dataset(SMID=%d)
-30775 Don’t support dissolving this type of dataset!
-30776 Failed to find the field info.
-31303 There’s no bitmap file to be saved!
-31304 Failed to open the file!
-31305 Failed to create bitmap!
-31332 The file “%s” does not exist!
-31333 Failed to allocate memory!
-31334 Failed to open file “%s”!
-31335 Failed to create file “%s”!
-31336 Failed to write file “%s”!
-31337 Failed to read file “%s”!
-31341 Can not open the file! It seems to need higher version of the software!
-31342 Warning: Unregister runtime version! Please call %s to register it.
-31343 Error file head!
-31344 Error data type in the file!
-31345 Error column values in the file.
-31346 Invalid value occurring in the file!
-31347 AvisMap GIS Engine can not get license from your local machine or network server. Possible causes are: 1.Your hardware key may not respond correctly. 2. The series number maybe incorrect. If you have configured the system rightly, but the application still can not be running properly, please contact AvisMap GIS Technologies, Inc.
-31348 There is not enough storage space!
-32102 No Image Dataset
-32103 Invalid Image data
-32106 Failed to add new record
-32107 No such direction
-32111 Only Image layer has color histogram!
-33301 Failed to choose pixel format
-33302 Failed to set pixel format
-33303 Failed to create OpenGL context
-33304 Failed to choose current context
-33305 Don’t support current display settings.
-33306 Please select a deeper depth tree or smaller scale factor.
-33314 There’s not enough space for storing the temporary file.
-34207 No AvisWorkspace control connected with AvisMap control! The operation will be terminated. Please create the connection between AvisWorkspace and AvisMap control just like this: AvisMap1.Connect AvisWorkspace1.Handle
-34212 Can not find node at the position with current selection tolerance
-36604 Can not initialize because of no layer being loaded
-36605 Can not set item because empty legend
-36606 Invalid position
-36607 Can not change item’s type because the new legend item’s type is different from the old one.
-36608 Invalid theme unique key type
-36609 Invalid theme range key type
-36610 Unsupported legend item type
-36622 Can not drag to current position
-36623 Can not initialize with pointer of map window
-36624 Mismatch between tree item and image list
-36625 The special item doesn’t belong to any layer

Data Conversion in AvisMap

Data Conversion in AvisMap
Vector data conversion: where, Y means supported, and N means unsupported.
File Type Can be imported with CAD mode or not Supported Import Versions Name after imported Can be imported without layers merged or not AvisMap dataset can be exported to this type of file or not Supported Export Versions
AutoCAD DWG or DXF Y (recommended) 2.5-2000 Specified by user Y N N
AutoCAD DWG Y (recommended) 2.5-200 Specified by user Y N N
AutoCAD DXF Y (recommended) R12, R13, R14, 2000 Specified by user N Y (not including system fields) R11
ArcInfo Coverag N PC, SUN, NT Specified by user N Y PC, SUN (H and L precision)
ArcInfo E00 N 3 compressed types Specified by user N Y Low precision
ArcView Shapefile N unknown Specified by user N Y unknown
MapInfo Tab Y MapInfo Professional 6.5 Specified by user N N N
MIF Y (recommended) unknown Specified by user N Y unknown
Microstation DGN N Microstation Specified by user N Y unknown
IDRISI VEC N unknown N N Y unknown
VCT Y unknown N, naming as VCT layers Y Y unknown
MapGIS files

.wat (Point)

.wal (line)

.wap (polygon)

.wan (network)
Y MAPGIS 6.1 Specified by user N N N
OpenGIS GML Y 1.0 and 3.0 Specified by user N Y 1.0 and 3.0
AvisMap SML (Extended GML) Y 1.0 Specified by user N Y unknown
Windows WMF N unknown Specified by user N Y unknown
DBF N 2, 3, 30 Specified by user N Y 2, 3, 30
Microsoft Access MDB Y Access 97 N, naming as table name N Y 50
GXML .gxml(JPN) Y 1.0 Specified by user N Y unknown
JIF50 .mem(JPN) N unknown N, naming as file info N N N
JIF250 .sem (JPN) N unknown N, naming as file info N N N
JIF1000 .tem (JPN) N unknown N, naming as file info N N N
JIF2500 .txt (JPN) N unknown N, naming as file info N N N
JIF10000 .lge (JPN) N unknown Specified by user N N N
JIF25000 .mby(JPN) N unknown N, naming as file info N N N
JIFENC .0 (JPN) N unknown N, naming as file info N N N
JIFSDF .xml (JPN) N unknown N, naming as file info N N N
Supported export format of various vector datasets:
Type DXF Coverage E00 SHP MIF DGN VEC VCT WMF GML SML GXML MDB DBF
Point Y Y Y Y Y N Y Y Y Y Y Y Y N
Line Y Y Y Y Y Y Y Y Y Y Y Y Y N
Region Y Y Y Y Y Y Y Y Y Y Y Y Y N
Text Y Y Y N Y N N Y Y N Y Y N N
Network Y Y Y Y Y N Y Y Y N N N Y N
CAD Y N N N N Y N N N Y Y Y Y N
PointZ Y N N Y N N N Y N N N Y Y N
LineZ Y N N Y N N N N N N N N Y N
RegionZ Y N N Y N N N N N N N N Y N
TIN N N N N N N N N N N N N Y N
LineM N N N N N N N N N N N N N N
Tabular N N N N N N N N N Y(GML3) N N Y Y


Raster dataset conversion:
Type Band Can be imported or not Dataset Type after imported AvisMap dataset can be exported to this type of file or not


(Whether different bits images can be exported? See details in the right columns)
1bit 4bits 8bits 16bits 24bits 32bits
Erdas Image Multi Y Image N - - - - - -
MrSID Single Y Image N - - - - - -
TIF Single Y Image Y (See details in the right columns) Y Y Y Y Y Y
BMP Single Y Image Y (See details in the right columns) Y Y Y Y Y Y
JPG Single Y Image Y (See details in the right columns) N Y Y N Y N
ECW Single Y Image Y (See details in the right columns) Y Y Y Y Y Y
IDR Single Y Image Y - - - - - -
GIF Unknown N - N - - - - - -
TGA Unknown N - N - - - - - -
RAW Unknown N - N - - - - - -
FST Multi Y Grid N - - - - - -
BIL Unknown Grid Grid N - - - - - -
ArcInfo Grid(ASCII) Single Y Grid Y - - - - - -
ArcInfo Grid (Binary) Single Y Grid Y - - - - - -
SIT - - - Y (See details in the right columns) Y Y Y N Y N
.DEM Unknown N - N - - - - - -
USGS Grid (Binary) Single Y Grid N - - - - - -
JRF10LANDUSE Single Y Grid N - - - - - -
JRF10VOLCANO Single Y Grid N - - - - - -
JRF50 Single Y Grid N - - - - - -
JRF250 Single Y Grid N - - - - - -
JRF1000 Single Y Grid N - - - - - -
JRF10000 Single Y Image N - - - - - -

Creating/Editing Datasource and Dataset (Visual Basic 6)

Introduction:

This sample code mainly describes how to create datasource and dataset , edit/delete dataset and show the powerful snapping functionality of AvisMap Engine. There are two ways to create datasource in AvisWorkspace. The datasource type is decided upon what kind of data engine has been used when the datasource was created. soDataSource has three methods to create a dataset such as CreateDataset,CreateDatasetFrom and CreatECWDataset; and there are approximately 20 kinds of datasets can be managed. Here we only use six of them as a demonstration. AvisMap controls have their own simple editing modes of dataset .

Installation location:

You can find full code for this sample project in C:\Program Files\AvisMap\Avismap GIS Engine 5.0\Sample Projects\Sample VB\CreateDeleteModify\

Data: the data created by users ( recommended saving it in current directory).

The main properties and methods of AvisMap GIS Engine control/object in this sample code are:

Control/Object Property Method
AvisWorkspace DataSources CreateDataSource
AvisMap Action,Layers AddDataset,ShowSnapSettingDialog
soDataSource Datasets CreateDataset,CreateMrSIDDataset,CreateECWDataset
soLayers Snapable SetEditableLayer,GetEditableLayer

Functions:

Create Datasource

According to the different types of data engines, the datasource types are different. You should check and make the datasource name is valid before creating; otherwise it will return a null object of datasource.

Dim objDS As soDataSource ‘ set datasource
Dim strDsName As String ‘ set variable for datasource name (including the full path )
strDsName = App.path & “Text.sdb”
Set objDS = Me.AvisWorkspace1.CreateDataSource(strDsName, “Text”, sceSDB, False, False, False, “”)

Create Dataset:

You should open a datasource before you create a dataset. The New Dataset dialog box below shows which datasourse the new dataset will be saved in. And you can specify a name for the new dataset and assign a type. There are six types of dataset you can choose to create.

Note: Make sure the dataset name is valid.

Dim objDt As soDataset
If objDS.IsAvailableDatasetName(txtDatasetName.Text) = False Then
MsgBox “The dataset name is invalid”, vbInformation
Exit Sub
End If
Set objDS = Form1.AvisWorkspace1.Datasources.Item(cmbDatasource.Text)
Set objDt = objDS.CreateDataset(strDatasetName, scdPoint, scoDefault)
Lines below show the other two methods to create a dataset.
Dim bResult as Boolean
bResult = objDS.CreateECWDataset(strDatasetName, cdlFile.FileName) ‘ ECW dataset
bResult = objDS.CreateMrSIDDataset(strDatasetName, cdlFile.FileName) ‘ MrSID dataset
‘ if creation succeeded, bResult = True ; failed, bResult = False .

Delete Dataset:

You should close and remove the dataset from the AvisMap control before you delete it from the datasource.
If Not (AvisMap1.Layers(strLayerName) Is Nothing) Then
AvisMap1.Layers.RemoveAt (strLayerName)
AvisMap1.Refresh
End If
Set objDS = AvisWorkspace1.Datasources(1)
objDS.DeleteDataset(strDtName)
‘ strDtName is specified as the dataset name

Snap Setting:

There are many snapping methods in AvisMap. Select the methods you need in the dialog box and accept the others as defaults.
snap setting.jpg

AvisMap1.ShowSnapSettingDialog ‘ display Snap Setting dialogue when you want to change its methods.


Dim objLayer as soLayer ‘ define a layer variable
Set objLayer = AvisMap1.Layers(cmbEditbleLayer.Text) ‘ get map layer
AvisMap1.Layers.SetEditableLayer(objLayer.Name) = True ‘ set the layer editable
AvisMap1.Layers(objLayer.Name).Snapable = True ‘ start snapping in the editable layer

Objects Editing

To set the edit mode, You only need to set the property of AvisMap.Action. After you having set the property, AvisMap will be in editing status. In this status, AvisMap will not respond to standard mouse event and you can do editing on AvisMap controls; if the datasource is opened conventionally or in encryption, the changes will be saved automatically, otherwise the datasource is opened in transaction, you need to commit the changes manually.

AvisMap1.Action = scaEditCreatePoint ‘ draw point
AvisMap1.Action = scaEditCreatePolyline ‘ draw polyline
AvisMap1.Action = scaEditCreateLinesect ‘ draw line

AvisMap Engine Visual Basic 6 Tutorial

Download the PDF file of this Tutorial here.

Download the complete Visual Basic 6 GIS Tutorial project file here.

Screenshot of the Visual Basic 6 GIS Tutorial:

mapping software visual basic

Free Desktop GIS Source Code (Visual Basic)

Today AvisMap released full source code of a full functional Desktop GIS. This code was written in Visual Basic 6 and AvisMap GIS Engine. There are 127 forms and 3 class modules in this project, more than 60,000 lines of code.

As many people still work on Visual Basic this could be a good point to start. Even if you use C# or Visual Basic.Net you can learn a lot from this free Desktop GIS project.

Screenshot:

Download this free GIS code.

AvisMap Engine CSharp Tutorial

Download the complete CSharp GIS Tutorial project file and sample data here.

Download the PDF file of this Tutorial here.

Screenshot of the CSharp GIS Tutorial:

CSharp GIS Tutorial Download.png