Displaying Oracle SDOs using SharpMap.Data.Providers.OracleSpatial

Topics: Data Access, WinForms Controls
Oct 19, 2015 at 1:52 PM
Hi all,

I am new to SharpMap. I am currently evaluating SharpMap 1.1 for suitability to read/write data from/to Oracle spatial database.

As a first step, I an trying to read and then display geometry data from Oracle, but no luck so far. (note: I had not problem with shape files).

My testing environment is as follows:

SharpMap : V 1.1 (downloaded from project's homepage link).
Database : Oracle 11XE 32-bit on Windows 7 64-bit
Database Client : Oracle 11g Client 64-bit

Data specs:

Oracle data coordinate system is SRID 4326 (i.e. WGS84, lat/lon, decimal degrees).
Oracle geometry layer's SDO_GTYPES are 2007 & 2003.
Number of geometries in Oracle layer = 11 170.
The Oracle Layer has been migrated to current using: sdo_migrate.to_current
The Oracle Layer has been validated using: SDO_GEOM.VALIDATE_LAYER_WITH_CONTEXT, indicating 12 invalid geometries.

Here is my code:
    'Create the vector layer
        Dim OraVLay As SharpMap.Layers.VectorLayer = New SharpMap.Layers.VectorLayer("myPolygons") 

    'Create the vector layer's datasource
        OraVLay.DataSource = New SharpMap.Data.Providers.OracleSpatial(ConnStr, "PolygonTable", "Geometry", "GID")

'Count the number of returned recordst
Dim OraSdoCount = OraVLay.DataSource.GetFeatureCount() 'Correct number is retrieved...so all seems well up to here.

'Specify colours
Dim c As Color = Color.Black 
Dim b As Brush = New SolidBrush(c)
OraVLay.Style.Enabled = True
OraVLay.Style.Fill = b

'Display the data
Form1.MapBox1.Map.Layers.Add(OraVLay)
 Form1.MapBox1.Map.ZoomToExtents()
 Form1.MapBox1.Refresh() 

'At this point, no data is visible in the Mapbox1.Map control. The map zoom level is 'automatically set to 1:42 after ZoomToExtents is called. But no geometries are visisble.
Any suggestions will be much appreciated.

Kind regards.
LandIS
Coordinator
Oct 20, 2015 at 12:18 PM
I'm sorry, I have no means to help you, as I don't have access to an oracle database.
Could you grab the code of the oracle provider, compile it yourself and see what is going wrong?