This content has been marked as final. Show 3 replies
hi,I am tring using the OO4O too.And here is some code that I think can help u,but in which IDE do u use the oo4o,I just can not use the OO4O in DELPHI AND C++ BUILDER.
Dim OraSession As OraSession
Dim OraDatabase As OraDatabase
Dim LRS As OraDynaset
Dim Ordinates As OraCollection
Dim sdo_geometry As OraObject
Dim i As Integer
Set OraSession = CreateObject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.DbOpenDatabase("n12dev6", "gis/spatial", ORADB_DEFAULT)
Set LRS = OraDatabase.CreateDynaset("select * from GPS_LRS where id ='11SR012001'", ORADB_DEFAULT)
Set sdo_geometry = LRS.Fields("geometry").Value
Set Ordinates = sdo_geometry.Item("sdo_ordinates").Value
'access all elements of the SDO_ORDINATES VArray
For i = 1 To Ordinates.Size
Thanks for the help...I use Visual Studios as my IDE. Do you know how to retrieve data using a 'query window'...ie. specify a rectangle and Oracle will return only spatial objects within this rectangle (in VB still)?
oracle spatial has built-in functions that can do this job,I think you can find in the spatial reference book,here is an example that find the nearest 5 outlet beside a warehouse
REM Finds the 5 closest customers to warehouse_id = 3
REM who reside in NY state, and return the distance in miles,
REM and order the results by distance
REM CUSTOMERS and WAREHOUSES
set lines 132
set pages 1000
from warehouses w,
where w.warehouse_id = 3
and sdo_nn (c.cust_geo_location, w.wh_geo_location,
'sdo_batch_size =5 unit=mile', 1) = 'TRUE'
and c.cust_address.state_province = 'NY'
and rownum < 6
order by distance_in_miles;