Oracle Provider Does not work

Topics: CompactFramework, Data Access, General Topics, SharpMap v0.9 / v1.x, Web Controls
Dec 3, 2009 at 7:17 AM

Hi EveryOne,

I use Oracle Provider but it does not work i don't know why every thing work fine and No exception also No response on map .

By the way i use oracle 10g  and AjaxMap,

Please Help.


Thanks

Developer
Dec 3, 2009 at 11:55 AM

It's really hard to understand what's happens... try to look if some exception is thrown by your server-side code when ayaxmap launches tiles requests.

Dec 3, 2009 at 1:04 PM

Hi D_Guidi,

Thank you for Reply

i sure of that there is no Exception

and here is my code

SharpMap.Layers.VectorLayer Ora_lay = new SharpMap.Layers.VectorLayer("OrcaleOne");
                   SharpMap.Data.Providers.Oracle lay = new SharpMap.Data.Providers.Oracle("MyUserName", "MyPassword", "MyDataSource", "BLOCK", "GEOMETRY", "MSLINK");
                   Ora_lay.DataSource = lay;

map.Layers.Add(Ora_ay);

here is my Tabkle Design:

CREATE TABLE BLOCK (
  OBJECTID     NUMBER PRIMARY KEY,
  MSLINK     NUMBER,
  SHAPE_Leng     NUMBER,
  SHAPE_Area     NUMBER,
  GEOMETRY     MDSYS.SDO_GEOMETRY);

DELETE FROM USER_SDO_GEOM_METADATA
  WHERE TABLE_NAME = 'BLOCK' AND COLUMN_NAME = 'GEOMETRY' ;

INSERT INTO USER_SDO_GEOM_METADATA (TABLE_NAME, COLUMN_NAME, DIMINFO, SRID)
  VALUES ('BLOCK', 'GEOMETRY',
    MDSYS.SDO_DIM_ARRAY
      (MDSYS.SDO_DIM_ELEMENT('X', 714045.859549161, 715412.267850528, 0.000000050),
       MDSYS.SDO_DIM_ELEMENT('Y', 4908373.822479705, 4910788.275453597, 0.000000050)  
     ),
     82247);
COMMIT;
EXIT

?Thanks Again for Reply;

Developer
Dec 3, 2009 at 1:08 PM

maybe you simply must configure layer to be reprojected correctly and with some graphical rendering? 

I mean, provider retrieves your data but isn't shown on screen

Dec 3, 2009 at 1:16 PM

i understand what you say so i tried to use this code:

SharpMap.Geometries.BoundingBox box = lay.GetExtents();

SharpMap.Geometries.Geometry g= lay.GetGeometryByID(Number);

unfortunately this methods return null

and if i use this query i oracle DataBase

SELECT  GEOMETRY .Get_WKB()  FROM  BLOCK ;

return Empty data i think the problem with .Get_WKB() and im sure of that the data inside this table is correct

thanks D_Guidi,

Developer
Dec 3, 2009 at 1:27 PM

looks like a db problem

Coordinator
Dec 3, 2009 at 1:31 PM

Hi ahmedsobhy are you setting the srid on the provider? cheers jd

Dec 3, 2009 at 1:33 PM

 

Could you give me a real data to use it for a query maybe  something wrong with my Geometry Data or 10g has a problem with .Get_WKB()

thanks

Dec 3, 2009 at 1:34 PM

Hi johndiss,

No i don't

 

Coordinator
Dec 3, 2009 at 1:35 PM

By the look of it you need to set it to 82247

Developer
Dec 3, 2009 at 1:40 PM

>>and if i use this query i oracle DataBase

>>SELECT  GEOMETRY .Get_WKB()  FROM  BLOCK ;

>>return Empty data

if get_WKT() fails (returns Empty) when you query the data with oracle tools, then maybe the script isn't correct

Dec 3, 2009 at 1:41 PM

when i try to set SRID i got this exception  Spatial Reference ID cannot by set on a Oracle table

when i debug i found the SRID is already get the value from oracle provider

really i don't know what i have to do else to make it work :(

Coordinator
Dec 3, 2009 at 1:45 PM

my mistake... that error message is correct it should set itself.. (I dont use oracle)..

Developer
Dec 3, 2009 at 1:46 PM

maybe you can try to load your data into oracle using OGR, from a shapefile as example: http://www.gdal.org/ogr/

here are some sample data you can use: http://www.census.gov/geo/www/tiger/

Dec 3, 2009 at 1:57 PM

@johndiss

No Problem and thank you for your concern

@D_Guidi 

i don't want to convert Oracle Data to Shape File i want to read Directly from Oracle ,Thank you for your Concern

Developer
Dec 3, 2009 at 2:10 PM

>i don't want to convert Oracle Data to Shape File i want to read Directly from Oracle

I mean:

1) Load your data into Oracle using OGR and not manually using your script (maybe not correct? Loading topologies is not easy as far as I remember)

2) Read data directly from Oracle using OraLayer

Dec 6, 2009 at 1:33 PM

Hi D_Guidi,

Unfortunately No new :(

Thanks for your Help.

Coordinator
Dec 7, 2009 at 9:39 AM
Edited Dec 7, 2009 at 10:02 AM

Hi ahmedsobhy,

are you sure you have at all any data in your table? From your script above,
all I can see is that you set up a table that is supposed to contain geometry
information and set its boundries and spatial references system.

What do you get on

SELECT COUNT(*) FROM BLOCK;

FObermaier

Dec 7, 2009 at 9:56 AM

Hi fobermaier,

44

thanks

Coordinator
Dec 7, 2009 at 1:48 PM

Hi ahmedsodhy,

are you using oracle 10g XE?

According to this thread some function won't work without a javavm on the database which is missing for XE.

You will need to install Oracle Sql Developer (free) and GeoRaptor (free) to get these functions to work.

You will find the apropriate links in the thread. I hope it works for you, since I havn't tried it yet.

FObermaier

 

Dec 7, 2009 at 1:54 PM

Hi fobermaier,

yes i use oracle 10g XE ,

i will try to use Oracle Sql Developer and GeoRaptor and i hope it works

Thanks for your Help.

Coordinator
Dec 11, 2009 at 1:16 PM

Hello ahmedsobhy,

you may want to try out Patch 4627.

Hth FObermaier

Dec 13, 2009 at 11:00 AM

Hi fobermaier,

ok i will try it and i hope it works

Thanks