On 4/20/05, Bec Gorton <[EMAIL PROTECTED]> wrote:
> <cffunction name = "getSpatialBounds">
>         <cfargument name = "image_id" required = "true">
> 
>         <!---Get the bounding co-ords of this image.--->
>         <cfquery datasource="aadc-db" username="gis" password="gis" 
> name="ords">
>                 select * from table(select a.geometry.sdo_ordinates from
> gis.sat_imagery_py a where image_id = #arguments.image_id#)
>         </cfquery>

nice stuff, the jdbc driver returns array when you dump it...

> The big pain with this is you can only get the ordinate pairs one at a
> time. If you find any other way of doing this please let me know.

there's always the SDOAPI.jar stuff, it's about time someone 
knocked up CFC wrapper for some of that functionality

as you are using oracle, cfqueryparam will speed things up a bit

> 
> Note if I try a query similar to what you had, ie.
> 
> <cfquery datasource="aadc-db" username="gis" password="gis" name="ords"  
> maxrows="1">
>         SELECT a.image_ID, a.geometry
>         FROM gis.sat_imagery_py a
> </cfquery>
> 
> I get an oracle error stating inconsistent datatypes. You don't get this?

nope, jrun has to crunch through 180000 odd records which take a while, 
but it works fine. 

There are only a single type of geometry (2003) are you mixing types?
i guess the jdbc driver is making an assumption on the first row and
then falling over later...

have you tried adding where geometry is not null?

if the types are mixed and that's what is causing the issue, you could
maybe use some of these functions in your where clause

GET_DIMS()      Returns the number of dimensions of a geometry object.
GET_GTYPE()     Returns the geometry type of a geometry object.

http://www.stanford.edu/dept/itss/docs/oracle/9i/appdev.920/a96630/sdo_meth.htm


> 
> Hope this helps,

sure did :-)

-- 
Zac Spitzer
0405 847 168

---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to