WKB Data - WkbDataLayer


 

Spatial data may be stored in general-purpose databases which do not have support for spatial indexes. The WkbDataLayer class can be used to access and edit such spatial data. The database table should contain a BLOB (binary large object) column with binary spatial data . The format of the data must conform to the OpenGIS Well-Known Binary format (WKB).

 

A sample table in an Access database may look as the following:

NAME            TYPE
-----------------------
ID              COUNTER
CITY_NAME       TEXT
STATE_NAME      TEXT
POPULATION      NUMBER
WKBDATA            OLE

 

The WKBDATA field stores shapes in the Well-Known Binary format.

 

Create a WkbDataLayer object and pass the connection string, table name and WKBDATA field to its constructor. It is also necessary to specify the FieldList property if you need attribute data for labeling or editing.

 

Add the WkbDataLayer to the Map control using the AddLayer method:

Imports AspMap
Imports AspMap.Data

Dim connectionString As String = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=C:\MAPS\MapData.mdb"
Dim tableName As String = "cities"
Dim providerName As String = "System.Data.OleDb"

Dim wkbData As WkbDataLayer 

wkbData = New WkbDataLayer(providerName, connectionString, tableName, "WKBDATA")
wkbData.FieldList = "ID, CITY_NAME, POPULATION"

Dim layer As Layer = map.AddLayer(wkbData)

 

The WkbDataLayer class supports editing of data as described in the Editing Spatial and Attribute Data topic.


 

Note: If you use only database layers in your application, it must be necessary to specify the extent of each database layer. By default, the extent is set to (-180,90,180,-90) where the units are decimal degrees. The extent of a database layer can be set via the Extent property. If an incorrect extent is set, the database layer will not be visible.



 

© 2018 VDS Technologies
Converted from CHM to HTML with chm2web Standard 2.85 (unicode)