Trying to get multiple cell values within a geometry

I am provided with 3 tables:
1 - The GeoRaster
2 - The geoRasterData table
3 - A VAT table who's PK is the cell value from the above tables
Currently the user can select a point in our application and by using the getCellValue we get the cell value which is the PK on the 3rd table and this gives us the details to return to the user.
We now want to give the worst scenario within a given geometry or distance. So if I get back all the cell values within a given geometry/distance I can then call my other functions against the 3rd table to get the worst scores.
I had a conversation open for this before where JeffreyXie had some brilliant input, but it got archived while I was waiting on Oracle to resolve a bug (about 7 months)
See:
Trying to get multiple cell values within a geometry
If I am looking to get a list of cell values that interact with my geometry/distance and then loop through them, is there a better way?
BTW, if anybody wants to play with this functionality, it only seems to work in 11.2.0.4.
Below is the code I was using last, I think it is trying to get the cell values but the numbers coming back are not correct, I think I am converting the binary to integer wrong.
Any ideas?
CREATE OR REPLACE FUNCTION GEOSUK.getCellValuesInGeom_FNC RETURN VARCHAR2 AS
gr sdo_georaster;
lb blob;
win1 sdo_geometry;
win2 sdo_number_array;
status VARCHAR2(1000) := NULL;
CDP varchar2(80);
FLT number := 0;
cdl number;
vals varchar2(32000) := null;
VAL number;
amt0 integer;
amt integer;
off integer;
len integer;
buf raw(32767);
MAXV number := null;
r1 raw(1);
r2 raw(2);
r4 raw(200);
r8 raw(8);
MATCH varchar2(10) := '';
ROW_COUNT integer := 0;
COL_COUNT integer := 0;
ROW_CUR integer := 0;
COL_CUR integer := 0;
CUR_XOFFSET integer := 0;
CUR_YOFFSET integer := 0;
ORIGINY integer := 0;
ORIGINX integer := 0;
XOFF number(38,0) := 0;
YOFF number(38,0) := 0;
BEGIN
status := '1';
SELECT a.georaster INTO gr FROM JBA_MEGARASTER_1012 a WHERE id=1;
-- first figure out the celldepth from the metadata
cdp := gr.metadata.extract('/georasterMetadata/rasterInfo/cellDepth/text()',
'xmlns=http://xmlns.oracle.com/spatial/georaster').getStringVal();
if cdp = '32BIT_REAL' then
flt := 1;
end if;
cdl := sdo_geor.getCellDepth(gr);
if cdl < 8 then
-- if celldepth<8bit, get the cell values as 8bit integers
cdl := 8;
end if;
dbms_lob.createTemporary(lb, TRUE);
status := '2';
-- querying/clipping polygon
win1 := SDO_GEOM.SDO_BUFFER(SDO_GEOMETRY(2001,27700,MDSYS.SDO_POINT_TYPE(473517,173650.3, NULL),NULL,NULL), 10, .005);
status := '1.2';
sdo_geor.getRasterSubset(gr, 0, win1, '1',
lb, win2, NULL, NULL, 'TRUE');
-- Then work on the resulting subset stored in lb.
status := '2.3';
DBMS_OUTPUT.PUT_LINE ( 'cdl: '||cdl );
len := dbms_lob.getlength(lb);
cdl := cdl / 8;
-- make sure to read all the bytes of a cell value at one run
amt := floor(32767 / cdl) * cdl;
amt0 := amt;
status := '3';
ROW_COUNT := (WIN2(3) - WIN2(1))+1;
COL_COUNT := (WIN2(4) - WIN2(2))+1;
--NEED TO FETCH FROM RASTER
ORIGINY := 979405;
ORIGINX := 91685;
--CALCUALATE BLOB AREA
YOFF := ORIGINY - (WIN2(1) * 5); --177005;
XOFF := ORIGINX + (WIN2(2) * 5); --530505;
status := '4';
--LOOP CELLS
off := 1;
WHILE off <= LEN LOOP
dbms_lob.read(lb, amt, off, buf);
for I in 1..AMT/CDL LOOP
if cdl = 1 then
r1 := utl_raw.substr(buf, (i-1)*cdl+1, cdl);
VAL := UTL_RAW.CAST_TO_BINARY_INTEGER(R1);
elsif cdl = 2 then
r2 := utl_raw.substr(buf, (i-1)*cdl+1, cdl);
val := utl_raw.cast_to_binary_integer(r2);
ELSIF CDL = 4 then
IF (((i-1)*cdl+1) + cdl) > len THEN
r4 := utl_raw.substr(buf, (i-1)*cdl+1, (len - ((i-1)*cdl+1)));
ELSE
r4 := utl_raw.substr(buf, (i-1)*cdl+1, cdl+1);
END IF;
if flt = 0 then
val := utl_raw.cast_to_binary_integer(r4);
else
val := utl_raw.cast_to_binary_float(r4);
end if;
elsif cdl = 8 then
r8 := utl_raw.substr(buf, (i-1)*cdl+1, cdl);
val := utl_raw.cast_to_binary_double(r8);
end if;
if MAXV is null or MAXV < VAL then
MAXV := VAL;
end if;
IF i = 1 THEN
VALS := VALS || VAL;
ELSE
VALS := VALS ||'|'|| VAL;
END IF;
end loop;
off := off+amt;
amt := amt0;
end loop;
dbms_lob.freeTemporary(lb);
status := '5';
RETURN VALS;
EXCEPTION
    WHEN OTHERS THEN
        RAISE_APPLICATION_ERROR(-20001, 'GENERAL ERROR IN MY PROC, Status: '||status||', SQL ERROR: '||SQLERRM);
END;

Hey guys,
Zzhang,
That's a good spot and as it happens I spotted that and that is why I am sure I am querying that lob wrong. I always get the a logic going past the total length of the lob.
I think I am ok using 11.2.0.4, if I can get this working it is really important to us, so saying to roll up to 11.2.0.4 for this would be no problem.
The error in 11.2.0.3 was an internal error: [kghstack_underflow_internal_3].
Something that I think I need to find out more about, but am struggling to get more information on is, I am assuming that the lob that is returned is all cell values or at lest an array of 4 byte (32 bit) chunks, although, I don't know this.
Is that a correct assumption or is there more to it?
Have either of you seen any documentation on how to query this lob?
Thanks

Similar Messages

  • I am trying to average multiple cells including some blank cells.  How do I get numbers to assess a blank cell as zero and include that cell in the average?

    I am trying to average multiple cells including some blank cells.  How do I get numbers to assess a blank cell as zero and include that cell in the average?

    Hi rkcfizzle,
    Blanks
    Blanks = 0
    1
    1
    2
    2
    0
    3
    3
    2
    1.5
    AVERAGE ignores blank cells (Column A)
    Formula in Footer Cell A6
    =AVERAGE(A)
    If you want to include blank cells as zero, type this formula in B2 (and Fill Down)
    =IF(A2<>0,A2,0)
    Numbers 3 will change the formula to
    =IF(A2≠0,A2,0)
    Yeah, right! but that is Numbers 3.
    And the answer (6/4) is 1.5. Correct!
    Regards,
    Ian.

  • How to get TableView cell values

    Hi All,
    I'm new to PDK.
    I have a TableView which set to Single Selection (the table has a column of radio buttons).
    When the user selects a row I want to get the cells' values of the row from the client side.
    I can get the row's number by using the following code:
    tvModel.setOnClientRowSelection("generateNumber(htmlbevent)");
    function generateNumber(myEvent) {
    alert(myEvent.obj.clickedRow.toString());
    Is there a function like getValueAt(row,col)?
    How can I solve this?
    Thanks,
    Omri

    Hi
    There is a function getValueAt(row,col) to get a value at particular row and column.
    Please go through the followin forum thread which is related to your problem:
    Using OnCellClick with TableView to get cell value
    Hope this helps you.
    Regards
    Victoria

  • Call a webservice and get back a value within an ESB...

    Hi!
    I'd like to call a webservice and get back a value from it within an ESB. But I don't know how.
    I think, I must create a routing service, then a SOAP service, but how can I get back the value from the webservice, which I called in the SOAP service?
    Or it is not possible to realize this within an ESB?
    Thank You very much!
    Viktor

    When you take a look at the Soa Orderbooking example you can see how it works. You create a webservice that accepts certain parameters and these are bundled into an object. This object, in case of the Soa Orderbooking example a 'PurchaseOrder', is described using an Xml Schema. The XML Schema is used to create the ESB with. Using this xsd the ESB knows which object it can expect and this object can be used inside your ESB or inside a bpel process.

  • How to get selected Cell value in datagrid?

    Hi guys, I have a datagrid that is editable. I was wondering if it's possible to retreive the cell value after user edits the single cell.
    My datagrid will trigger griditemEditorSessionSave event if users finish the editing, but I don't know how to get the new cell value.
    //script
    protected function dg_gridItemEditorSessionSaveHandler(event:GridItemEditorEvent):void
         //I can only get the columnIndex but not the value
          Alert.show (event.columnIndex);
    //mxml
    <s:DataGrid id="dg" editable="true" x="5" y="3" width="734" height="153"
                      gridItemEditorSessionSave="dg_gridItemEditorSessionSaveHandler(event)"
    >
    </Datagrid>
    Any thoughts? Thanks a lot.

    Hi,
    Please go through following link :
    http://corlan.org/2008/08/31/retrieving-the-new-values-while-editing-data-inside-the-data- grids/
    Hope it helps you
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • UIX Problems Trying To “Get” and “Set” Values To messageTextInput Objects

    I have created an input UIX form in the Struts Page Flow Diagram using the Page Forward Action and dropped two views from the Data Control Applet as Input Forms. I am trying to �get� the value from one bound messageTextInput object in view1 to set the value of another bound messageTextInput object in view2. I do not know how to reference the bound messageTextInput objects on the UIX page.
    Any suggestions?
    Thank you,

    Hi Alain,
    Initially it is little bit confusing.
    To get the value:
    wdContext.node<nodename>().get<nodename>ElementAt(i).get<Attribname>();
    To set the value:
    wdContext.node<nodename>().get<nodename>ElementAt(i).set<Attribname>("value");
    First check the cardinality of the node.If the cardinality is 0..1 or 0..n then you need to create an element and add it to the node.
    IPrivate<viewname>.I<node>Element ele = wdContext.create<node>Element();
    ele.set<attribname1>("value");
    ele.set<attribname2>("value");
    wdContext.node<nodename>().addElement(ele);
    If the cardinality is 1..1 or 1..n then 1 element is created by framework. You can use that element. If you want to add more elements just use the above code.
    2.IWDAttributeInfo attInfo= wdContext.node<Node>().getNodeInfo().getAttribute(<Attribname>)();
    check this link
    https://www.sdn.sap.com/irj/sdn/nw-wdjava?rid=/webcontent/uuid/503f22f6-b978-2a10-bf97-ddc21267e752 [original link is broken]
    regards,
    Siva

  • Getting multiple row value on valuechange of selectBooleanCheckbox in table

    Hello All,
    I am using jDeveloper 11.1.1.5. I have a java class which is returning me a list. I have created a data control of my class and I am using it on my page as a table.
    On my page I have inserted a text box selectedamount. In my table there are 4 columns Type, Qty, Amount and one boolean value select. I have changed column select to selectBooleanCheckbox. and I have specified its value as true(when selected) and false(when deselected). Which is getting reflected in my pagedef file.
    There are 4 rows coming in table and displaying properly.
    Now my requirement is on value change of selectBooleanCheckbox if user selects the rows I want to add the Amount for the selected row and I have to set it to the text box selectedamount.
    On value change of selectBooleanCheckbox I have written a method. Code snippet is like this:
    +public void valueChanged(ValueChangeEvent valuechangeevent) {+
    +if (valuechangeevent.getNewValue() == valuechangeevent.getOldValue()) {+
    System.out.println("new value is same as old value");
    +} else {+
    System.out.println("************************new value is other than old value**********************************");
    DCBindingContainer bindings =(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding iter = bindings.findIteratorBinding("NAME OF MY ITERATOR");
    float temp2 = 0;
    Row currentRow ;
    int count = (int)iter.getViewObject().getEstimatedRowCount();
    for (int i=1; i<=count;i++) {
    currentRow =   iter.getRowAtRangeIndex(i);
    +if(currentRow != null) {+
    if(true == currentRow.getAttribute("select"))
    +{+
    temp2= temp2 + Float.parseFloat(currentRow.getAttribute("totAmount").toString());
    System.out.println("value of total amount after adding is :: "+ temp2);
    +}+
    +}+
    +}+
    After this I am setting temp2 to selectedamount textbox.
    But I am not getting the desired value in the textbox.
    Is there any other method I can achieve this.
    Thanks
    Navin K

    Inside f(currentRow != null) When I added
    System.out.println(currentRow.getAttribute("select"));
    It is showing as null.
    So select attribute is not getting assigned as true or false while checking and unchecking selectboolean checkbox.
    Am I missing something ?

  • Trying to get multiple sounds to certain out puts

    I have an X-Fi Platinum s/c running on Windows Ult7 64. I am trying to get my headphones to only hear radio chatter in FSX or FS2004, and other noises on my main speakers (engine, cockpit noises, etc...etc). Is there any way to do this?

    There was a program listing a few weeks back for virtual audio cable. Do a google for that and see if that suits your needs.

  • Trying to get a cell to show 0%

    Hi im trying to do a basic sales vs target sheet, target being represented as %.
    I want to know what to put in the total % cell to get it to show as 0% when nothing has been inputted into the sales colum.

    Hi Daniel,
    Enter your target as a number, not as a percent. Format the cell as Currency. See cell A1 below. Note that the goal/target has been entered as a whole number and formatted to show zero decimal places.
    Enter each sales total as a number. Format as Currency. See the rest of the cells in  column A. Note that these have been formatted to show two decimal places. Empty cells here have had no data entered.
    B2 and the cells below it in column B contain the formula:
    =A2/$A$1
    These cells are formated as Percentages, with no decimal places. Note that B2, where a zero value has been entered in column A, and several other rows where the cell in column A is empty, all show 0%.
    Regards,
    Barry

  • Trying to get a return value from a Stored Procedure

    Hi folks,
    I have been tasked with something I thought was simple, but apparently its not that simple.  I am trying to call a Stored Procedure in UCCX that will do some calculations and returns back an integer value.  The stored procedure call I have is:
    DECLARE @return_status int
    EXEC @return_status = dbo.CTTLoginPhone @CTTId = $EmployeeID , @PIN = $EmployeePIN , @PhoneNumber = $CallingPhoneNumber ;SELECT 'Return_Status' = @return_status
    When I run this in this the editor, I get back one row.  If I run this in the debugger, I do not get any errors back and the stored procedure runs fine, however the Return_Status is not set either.  What am I doing wrong?
    I have defined Return_Status with intial value of 0 and the stored proc should be returning back 1 or 2, but the Return_Status remains as 0
    Can someone please let me know if I need a DB GET after a DB READ or can I just use the DB READ standalone when calling stored procedure.
    All help will be really appreciated.
    Thank you.

    I am having the same issue here... any help would be greatly appreciated. I am on UCCX 8
    I am getting 1 row returned when I click "TEST" in the READ step but the DB GET step is going into the SQL Error branch.
    Here are some details and I have attached screen shots of my script DB steps.....
    I have a Stored Procedure that is very simple...
    CREATE PROCEDURE sp_test AS
    Select 'N';
    GO
    Ive created a dummy table with 1 field..
    TABLE: testTable
    FIELD: code
    Let me know if there are any more details I can provide....

  • Struts: getting multiple selected values from a select element

    Hi Friends,
    I am a total newbie with struts,I have manage to run a simple login script,
    Now I was wonderingif there is a select box and user has the ability to select multiple values from it how do I get those values in the *Form class
    my select tag looks like this
    <html:select property="listboxValue" mulitple="mulitple">
    ...options--
    </html:select>
    in the ****Form extends ActionForm{....I have setter and getters for getting the value  from select box as below
    public void setListboxValue(String value){
    this.listboxValue = value;
    and the getter is
    public String getListboxValue(){
    return this.listboxValue ;
    please never mind the missing brackets and such.
    What I was hoping to get to work was something like this
    public void setListboxValue(String[] value){
    this.listboxValue = value;
    but that does not work...If I have the an array being passed,it seems like this method is no even envoked
    Please guide me
    Thanks

    I'm having trouble to get in the ActionForm all the selected values in my multiple select. I select all the values by setting to true the selected attribute of all the options in a javascript function. In the ActionForm the variable is String[]. I'm not getting any ClassCastException, but I only receive the first value selected (String array with just one element).
    Select definition:
    <html:select name="detalleConsultaForm" property="destinatarios" multiple="true" size="8" >
    Javascript function:
    function validalistarelacion(campo)
    {   if (campo.length < 1)
    alert("Campo sin valores");
    campo.select();
    return false;
    for (var i = 0; i < campo.length; i++)
    campo.options.selected = true;
    return true;
    ActionForm:
    String[] destinatarios;
    public String[] getDestinatarios() {
    return destinatarios;
    public void setDestinatarios(String[] destinatarios) {
    this.destinatarios = destinatarios;
    What I get:
    2006-03-30 12:54:19,899 [ExecuteThread: '10' for queue: 'weblogic.kernel.Default'] DEBUG BeanUtils - setProperty(es.tme.apl.mante
    nimientosPlanificados.form.DetalleConsultaForm@59def5, destinatarios, [2320])
    2006-03-30 12:54:19,899 [ExecuteThread: '10' for queue: 'weblogic.kernel.Default'] DEBUG ConvertUtils - Convert String[1] to class
    'java.lang.String[]'
    Thnx

  • Trying to get a date value from a string

    Hi All,
    I'm not sure I am doing this right, so I figured I would ask the experts...
    I have built a file upload page that is working the way I need it, but I have found that I need to determine the date from the uploaded file name. I tried to create a PL/SQL computation and do some substr / instr to the filename, but I'm not getting it as I get "ORA-01843: not a valid month" error. Here is the code I'm trying:
    declare
      v_underscore  integer;
      v_date            varchar2(15);  --have also tried using date datatype...
    begin
      v_underscore := INSTR(:P20_EXPRESS,'_',1,1);
      v_date := to_date(substr(:P20_EXPRESS,v_underscore + 1,6),'YYMMDD');
      return v_date;
    end;And here is a sample filename:
    F15047/proc_10607161001.csv
    Is this the best way to achive what I'm trying to do?
    Thanks,
    Corey

    Hi,
    v_underscore := INSTR(:P20_EXPRESS,'_',1,1);
    v_date := to_date(substr(:P20_EXPRESS,v_underscore + 1,6),'YYMMDD');What this is saying is:
    Get the position of the "_" character
    Move to the next character to the right (which is a "1" in your case)
    Get 6 characters (106071) from the string value
    Convert them to a date using the format 'YYMMDD'
    This results in:
    Year: 10
    Month: 60
    Day: 71
    Which of course is not valid.
    For example:
    select
      substr('F15047/proc_10607161001.csv', instr('F15047/proc_10607161001.csv', '_', 1, 1) + 1, 6)
    from
      dual;
    SUBSTR
    106071It looks like you want to move two positions to the right rather than a single position:
    select
      substr('F15047/proc_10607161001.csv', instr('F15047/proc_10607161001.csv', '_', 1, 1) + 2, 6)
    from
      dual;
    SUBSTR
    060716Hope that helps a bit,
    Mark

  • Changing multiple cell values via pop-up?

    hi.
    back again
    I'm reworking my cost estimate sheet and would like to know if the following idea is possible: [the .numbers will probably explain it better than i can]
    http://web.me.com/jeffhammond/numbersQ_2.numbers
    generally, i will enter unit costs on a job to job basis (or at least spot check pricing per region).. i'll still do this but i'd like to keep the editing off the estimate table and do it on a separate table.. the main reason is that i'll often have to change every cost due to the material requirements.. same dimensions etc but certain jobs require weather resistant materials/hardware.. i'd like to simply switch the type of job on the estimate sheet and bring the correct pricing in.
    I'm also not positive that all materials on the estimate sheet will maintain their current position.. i may have to special order something (6x6 -24' ?) for whatever reason in which i'd usually insert it under the post materials.. if need be, i guess i could add any special order materials to a designated are so as not to change any cells.
    fwiw, a complete material list will often have over 100 separate item types being ordered from multiple sources.. my main material list has around 450 individual items that i can choose from/order.. (but i have a nice little setup in place to filter only ordered materials and for obtaining individual pdfs per outlet which includes only items they sell).. point being, my example .numbers wouldn't be worth implementing something like this but the real list is more intense.
    any ideas?
    thanks
    jeff

    Hi Jeff,
    I'm beginning to develop a strong dislike for this forum's new interface!!
    But that's not your fault.
    The tables below use a VLOOKUP formula to retrieve the prices from the Current Pricing, and an IF statement in E1 to determine which column the prices are fetched from.
    The added column isn't necessary; it was just simpler t do that than to go through the hassle of re-merging the single cell in Row 1. With a change of the cell reference in the VLOOKUP formula, the first formula can be placed anywhere convenient.
    In E1:
    =IF(LEFT(A1,1)="I",2,3)
    The result of this formula tells VLOOKUP to return the results from column 2 or 3 of the Current Pricing table, depending on the first letter of the text in A1 being an "I".
    In C3 and Filled Down:
    =IF(B>0,VLOOKUP(A,Current Pricing :: $A:$C,$E$1,FALSE),"")
    IF is used to return a null string unless there is a value greater than zero in column B.
    Looks for the item listed in Column A and returns the value from the row where that item is found and the column specified in E1.
    The error triangle in C9 is a "VLOOKUP cannot find.." error cause by the value '3” screws (25lb box)' not being found in column A of Current Pricing.
    The error triangle in D9 is "There is an error in C9".
    Regard,
    Barry
    PS: The line at the beginning?
    I had complete all but the last line of a previous version of this post, and was deleting the '3" screws..." bit which had pasted as a single cell unnamed table, when the software bumped me back to the previous thread in this community. Not the first time this has happened, and in this case, as in the ones before, there appeared to be no route back to my partly completed message. So it was start over time. (/rant)
    B

  • JSF datatable to get multiple row values

    I want to get values of SelectBooleanCheckbox and SelectOneMenu in jsf bean from datatable for multiple rows?

    You can find an example here: http://balusc.blogspot.com/2006/06/using-datatables.html

  • Trying to get multiple clips to line up & be exactly the same size?

    Hi, I'm trying to figure out how to get four clips to line up perfectly and be the exact same size. I'm able to do it manually by dragging out the corners of each clip, but I know it's not perfect. I feel like there has to be an easier way to achevie what I'm trying to do. Any help or ideas would be great. Thanks.
    Dan
    Powermac G5 Dual 2.3   Mac OS X (10.4.8)  

    You want all the clips to be 50%. One one clip into the Viewer and in the Motion tab set the Scale value to 50. Copy the clip. Select all the other clips and use Edit>Paste Attributes and check Basic Motion.

Maybe you are looking for

  • Unable to deploy ADF application to weblogic server

    Hi, We are developing ADF application using jDeveloper 11.1.1.1 and deploying to Weblogic Server 10.3.1. The application is working without any problems on 10.3.1 wblogic platform. We procured new 64 bit hardware and installed weblogic 10.3.2 and jde

  • Saving word document from iframe

    Hi, ok lemme explain what m trying to do here. <IFRAME id="name" name="name" frameborder="0" src ="c:/testing.doc" width="200%" height="200%" scrolling="auto" MARGINHEIGHT="0" MARGINWIDTH="0"></IFRAME> using this code my file (testing.doc) will be lo

  • How does FCPX handle audio?

    Still working on getting audio exported to an AAF, and having problem doing this.  So I need help understanding how FCPX is handling my audio. When it's on the timeline, is it being conformed to the frame rate of the video?  When audio is exported, d

  • Proxy Redirect is not working with anyconnect

    Hi, when users connect to the latest version of anyconnect there proxy server is not reconfigured to use the internal proxy server through the VPN tunnel. this is working for the normal VPN client. but not the anyconnect. Has anyone come accross this

  • Version 4 RC2,open link in new tab

    I have notice with the above version that a lot of times when I right click to open a link that the new page comes up blank. Hit refresh and page comes up