is LabelLayer Supported ?

Feb 19, 2009 at 6:19 PM
Hello Guys.....


i'm using a SharpMap.Data.Providers.Oracle as a datasource to fetch the data from the database instead the shape file,

the layers is working great and shown ( points, lines and polygons)

the problem is when i try to label any layer using SharpMap.Layers.LabelLayer the application keep fail with this error message


Unsupported column datatype


this is the code i use

        SharpMap.Data.Providers.Oracle strtDataSource = new SharpMap.Data.Providers.Oracle("MyUserNAme", "MyPassWord", "OracleServiceName", "TableName", "geom", "oid");
        SharpMap.Layers.VectorLayer laySS = new SharpMap.Layers.VectorLayer("SS");
        laySS.DataSource = strtDataSource;        

        SharpMap.Layers.LabelLayer laySSLabel = new SharpMap.Layers.LabelLayer("SSLBL");
        laySSLabel.DataSource = laySS.DataSource;
        laySSLabel.Enabled = true;
        laySSLabel.LabelColumn = "geom";
        
        map.Layers.Add(laySS);
        map.Layers.Add(laySSLabel);



any kind of help is appreciated


Thanks in advance :)


Coordinator
Feb 19, 2009 at 6:26 PM
You are using the geometry column (binary) to label - you need to use an attribute column hth jd
Feb 19, 2009 at 6:33 PM
Thank you for your reply
it was a mistake the code i use is

SharpMap.Data.Providers.Oracle strtDataSource = new SharpMap.Data.Providers.Oracle("MyUserNAme", "MyPassWord", "OracleServiceName", "TableName", "geom", "oid");
        SharpMap.Layers.VectorLayer laySS = new SharpMap.Layers.VectorLayer("SS");
        laySS.DataSource = strtDataSource;        

        SharpMap.Layers.LabelLayer laySSLabel = new SharpMap.Layers.LabelLayer("SSLBL");
        laySSLabel.DataSource = laySS.DataSource;
        laySSLabel.Enabled = true;
        laySSLabel.LabelColumn = "STR_NM";
        
        map.Layers.Add(laySS);
        map.Layers.Add(laySSLabel);



i added a new column called (SS) with a type of BLOB but the same problem still appear

i used this

        laySSLabel.LabelColumn = "SS";




and this is the table Structure

OID                                       NOT NULL NUMBER(38)
SHAPE_LENG                                         NUMBER
STR_NO                                             VARCHAR2(50)
STR_WIDTH                                          NUMBER
STR_CLASS                                          NUMBER
STR_STATE                                          VARCHAR2(50)
STATE_SFLT                                         VARCHAR2(50)
STATE_KERB                                         VARCHAR2(50)
STATE_LIGH                                         VARCHAR2(50)
STATE_TREE                                         VARCHAR2(50)
STATE_CLEA                                         VARCHAR2(50)
STATE_TORR                                         VARCHAR2(50)
ZN_NM                                              VARCHAR2(50)
SFLT_WIDH                                          NUMBER
KERB_WIDTH                                         NUMBER
ISLAND_WID                                         NUMBER
SFLT_THICK                                         NUMBER
STR_NOTE                                           VARCHAR2(200)
STR_PICS                                           VARCHAR2(254)
STR_PAINT                                          VARCHAR2(50)
STR_MNTN                                           VARCHAR2(50)
STR_SRMK                                           VARCHAR2(50)
STR_RVR                                            VARCHAR2(50)
STR_PAINT1                                         VARCHAR2(50)
ARE_NO                                             NUMBER
STR_POINT                                          NUMBER
STR_NM                                             VARCHAR2(100)
GEOM                                               MDSYS.SDO_GEOMETRY
SS                                                 BLOB
Coordinator
Feb 19, 2009 at 7:03 PM
Blob is still a binary type.. hth jd
Feb 19, 2009 at 7:05 PM
laySSLabel.LabelColumn = "STR_NM";

STR_NM is varchar2 but failed


what datatype should i use ????
Coordinator
Feb 19, 2009 at 7:23 PM
I am not sure to be honest, I dont use oracle.. But it may be worth trying a newer ADO.Net provider for oracle if such a thing exists - the one in the trunk may be out of date, or perhaps it doesn't know of Varchar2 but will work with Varchar... hth jd
Coordinator
Feb 20, 2009 at 11:00 AM
Hi snix, the latest versions of the oracle ado providers seem to be in the 11s (I guess they follow the database versions now) however the one in the external references directory is 2.102.2.10 so I guess that may be the issue. You can download new versions of the ado.net providers from http://www.oracle.com/technology/software/tech/windows/odpnet/index.html. You will probably need to rebuild the sharpmap extensions project referencing the new oracle ado.net provider.. hth jd