Oracle


 

Oracle supports spatial extensions to enable the generation, storage, and analysis of geographic features. Additional information is available at http://docs.oracle.com/html/A88805_01/sdo_intr.htm

 

AspMap supports the SDO_GEOMETRY data type. The OracleLayer class can be used to access and edit such spatial data. A sample table in an Oracle database may look as the following:

NAME            TYPE
--------------------------------------
ID              NUMBER(*,0)
CITY_NAME       VARCHAR2(40 BYTE)
STATE_NAME      VARCHAR2(25 BYTE) 
POPULATION      NUMBER(38,0) 
GEOM              SDO_GEOMETRY

CREATE INDEX CITIES_IDX ON CITIES (GEOM) INDEXTYPE IS SPATIAL_INDEX

 

The GEOM field stores shapes in the SDO_GEOMETRY data format. The GEOM field has a spatial index (GEOM INDEXTYPE IS SPATIAL_INDEX) which is required to speed up spatial queries (for fast map rendering).

Please note that spatial indexes are required by Oracle. If a spatial column does not have a spatial index, the map will not be rendered correctly.

 

The ADO.NET framework has a built-in provider for Oracle, but it has been deprecated. The Oracle ODP.NET provider (or any other Oracle provider) is required. The ODP.NET provider can be downloaded at http://www.oracle.com/technetwork/topics/dotnet/index-085163.html

 

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

 

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

Imports 
Imports AspMap
Imports AspMap.Data

Dim connectionString As String = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)));User Id=myUsername;
Password=myPassword;"
Dim tableName As String = "cities"
Dim providerName As String = "Oracle.DataAccess.Client"

Dim oracleLayer As OracleLayer 

oracleLayer = New OracleLayer (providerName, connectionString, tableName, "GEOM")
oracleLayer.FieldList = "ID, CITY_NAME, POPULATION"

Dim layer As Layer = map.AddLayer(oracleLayer)

 

The OracleLayer 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)