How to extract row number of geoRaster as number ?
Hi all,
I need to get the row (or similarly column and band) number of a georaster as number. Some approach that i have explored :
(a)
Using SDO_GEOR.getSpatialDimSizes, which return an sdo_Number_array. For example SDO_NUMBER_ARRAY(211, 725) means 211 rows by 725 columns.
But then how to get the 211 (or 725) as a number ? Any command for extracting the value ? substring clearly helpless.
(b)
Using metadata extract in PL/SQL. An example is
create or replace function dimRaster
(gr sdo_georaster)
return number as
total_dim number;
begin
total_dim := gr.metadata.extract('/georasterMetadata/rasterInfo/totalDimensions/text()',
'xmlns=http://xmlns.oracle.com/spatial/georaster').getNumberVal();
dbms_output.put_line('Total dimesnion'||CHR(9)||': '||total_dim);
return null;
end;-----------------
The above works fine. It extracts the value in rasterInfo>totalDimensions as NUMBER. But the following isn't working:
dim_row number;
dim_row_Str := gr.metadata.extract('/georasterMetadata/rasterInfo/dimensionSize type="ROW"/size/text()',
'xmlns=http://xmlns.oracle.com/spatial/georaster').getStringVal();
I get the following error message
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00601: Invalid token in: '/georasterMetadata/rasterInfo/dimensionSize type="ROW"/size/text()'
The number that i need to extract is in rasterInfo> dimensionSize type="ROW"> size.
Please advise.
cheers,
=Damon
Here is a function to do it. Since a function can only return one value, I created an object type for it.
If this was going onto my production system, I would validate the metadata before running the procedure on a georaster object.
Hope this helps:
-- gr_dims object holds # rows, # columns, and # bands
create or replace type gr_dims as object (
r number,
c number,
b number);
create or replace function georaster_size (geor sdo_georaster)
return gr_dims deterministic is
rowcols sdo_number_array := new sdo_number_array();
result gr_dims := new gr_dims(null,null,null);
begin
rowcols.extend(3);
rowcols := SDO_GEOR.getSpatialDimSizes(geor);
result.r := rowcols(1);
result.c := rowcols(2);
result.b := SDO_GEOR.getBandDimSize(geor);
return result;
end;
select georaster_size(georaster) from map_rasters where georid=1;
--GEORASTER_SIZE(GEORASTER)(R, C, B)
--GR_DIMS(5117, 3748, 1)
select g.gr.r, g.gr.c, g.gr.b
from (select georaster_size(georaster) gr from map_rasters where georid=1) g;
-- GR.R GR.C GR.B
-- 5117 3748 1
Similar Messages
-
How to get row number of selected entry from OVS search result
Hi,
Anyone having any idea on how to get row number of the selected entry/ how to differentiate rows in OVS search result in ON_OVS method?
Regards,
JatinHi,
You can get the selected record to <ls_selection> structure in co phase 3.
From that structure you can get what ever field you want.,
check the below code for reference,
<< Moderator message - Cut and paste response from F4 help for ALV table field removed. Plagiarism is not allowed in SCN >>
hope this helps u.,
Thanks & Regards,
Kiran
Edited by: Rob Burbank on Jan 5, 2012 5:24 PM -
How to get row number in the fetch row itself in Sql Query ?
Hi,
i am fetching some rows from a sql query . Is there any way to get row number as well in each row while all rows are fetched ?
like this :
RowNum data1 data2
1 abc ere
2 bnh ioiHello
Ofcourse you can get the rownum inside a query, just keep in mind that the rownum is the number of order in which the records were fetched from the table, so if you do an order by, the rownum will not be sequential, unless you query the information in a subquery first.
SELECT rown, col1, col1
FROM table
Or
SELECT rownum, col1, col2
FROM (SELECT col_1, col_2 FROM table ORDER BY col1)
Regards
Johan -
How to extract the number from image using java
Hello every one
i want to develope a project which can extract the number from image
that i can use as inter or String or char.
Is there any API in java which provide this type of facility.
right now i m using java 5
thanks in Advance
JigneshIn my project i have a image in that i have a
co-ordinate (x,y) I am still puzzled as to what you seek. It sounds to me like you have a point (x, y) represented by p. in java it's just p.getX() p.getY()
i want to convert that cordinate to numeric form,
i mena i want to use that cordinate in somewhere else
in project.point.getX() point.getY()
So need to convert it into numeric form u can called
it OCR also.OCR is optical character recognition. If I want out and took a picture of the US Declaration of Independence and then wanted the words on the parchement in the picture in text form, then I would run the picture through a software program and it would try to optically recognise what lettering and number were present in the picture. In the end, I would have a text of what is written on the US Declaration of Independence.
Is that what you want? -
How to extract the number of the image which looks like a number
Now,I can generate a image which contains a random number,but I can not extract the number of the image.Any one can help me?
[url http://forum.java.sun.com/thread.jspa?threadID=779212&messageID=4433641#4433641]Crosspost.
-
How to limit row number per group without change new page in crystal report
Hi All Expert,
Is there any way to limit row number per group without change new page in crystal report 2008. The reason i do that is due to customer using printer EPSON LQ 300 (dot matrix) always will print in landscape if detech my layout in landscape. Because they need the record always print in 1 page (Letter size) for 2 groups and each group must show 5 records. Example:
But, in CR2008, if you set the row per group from group section expert, definitely it will change to new page, but I do not want it change to new page. Any Idea?
In one page (Letter size):
Group Name: Customer-ABC
NO INVOICE AMOUNT
1) INV001 USD100
2) INV002 USD100
3) INV003 USD100
4) INV004 USD100
5) INV005 USD100
Group Name: Customer-ABC
NO INVOICE AMOUNT
6) INV006 USD100
7) INV007 USD100
8) INV008 USD100
9) INV009 USD100
10) INV010 USD100Hi Angie.....
I guess it is not possible.
Because if you have one common group for all the 10 records then in one page it will show 10 records under one group.
I mean i think it is not possible but m not completely sure......
Lets wait for expert advise....
Regards,
Rahul -
How to display row number in form?
Hi guys,
First I fll you in on the story so far..
I have a database data block named :V_PAYUPLOADHEADER_HP, in the property palette I set order by facility and warehouse.
I want to display row number for each fetched record, so I make :V_PAYUPLOADHEADER_HP.NUMB, which will contain the row number.
The following is some methods that I already tried:
- First I tried to make this field a database item=Y , column name = ROWNUM.
The result is the number jump around (3, 1, 2, 5, 4 etc. instead of 1, 2, 3, 4, 5) I think it is because of the order by that I set.
I have to keep this order by setting, so I look for another way to display the rownum.
- Next I tried to set database item = N, column name = null, calculation mode = formula, formula = :system.trigger_record.
When I run it all the value of :V_PAYUPLOADHEADER_HP.NUMB is 1. For all the records fetched is 1, 1, 1, 1 instead of 1, 2, 3, 4.
- I also tried using POST-QUERY trigger attached to the block.
In the trigger I have this code:
:V_PAYUPLOADHEADER_HP.NUMB := :system.cursor_record;
When I run it all the value of :V_PAYUPLOADHEADER_HP.NUMB is 1. For all the records fetched is 1, 1, 1, 1 instead of 1, 2, 3, 4..
Is there something that I missed?
What can I do to display the rownum?Hi
You can achieve this by adding new item named 'ROWNUM'. in the Data Block you are working on.
And it's 'BASE TABLE ITEM' property needs to be set as TRUE'. IN the property ,IN the post-query Trigger use...
SELECT ROWNUM
INTO :ROWNUM
FROM TABLE
WHERE EMP_ID =EMP_ID;Hope this helps...
Regards,
Abdetu... -
Hi,
I want to get row number in an table using some condition.
Any solutions?
Thanks
shrishri,
That's nice - you answered one question out of my three.
Version number of JDev/ADF?
What technologies are you using, particularly on the model layer?
and some new ones:
are you using ADF binding?
are you trying to display a row number on the table, or determine which row is selected (for example)?
and do you mean the row number relative to the first row displayed currently, or to the "top" of the table?
As I said - a proper use case (which would have answered all these questions) would enable you to get some answers. See [url http://www.catb.org/~esr/faqs/smart-questions.html]this if you still don't understand.
John -
How to obtain row number when a new row is created (without commit)?
I have this:
<NamedData NDName="LineaNro"
NDValue="#{bindings.VOIpmDistribucionManualEBS1.currentRowIndex}"
NDType="oracle.jbo.domain.Number"/>
When I push the New button, the value shows -1. If I push again, the value shows 0... but for third time an error occur:
Too many objects match the primary key oracle.jbo.Key[0 0 2011-12-01 ID del comprobante 0 ]
The problem is the last 0, it's the same 0 returned for the second button push.
The commit must be do it at the end.
Any suggestions?
Thanks in advance.Can you elaborate a bit on what you are trying to do?
And which jdev version you are using?
If you try to use the current row index a a primary key for a new row this won't work. The first time you hit the new button you get -1 as the current row is not set. Then the new row get the current row and get the index 0. So, then you hit new again you get 0 back.
It's never a good idea to use a row index as primary key as this won't work in multi user environments (which adf web apps are).
You should use a db sequence as PK as this will work in all scenarios and guarantees that one number is only use once.
Timo -
How to extract a number between () in a string
Dear All,
I have strings like the following:
DAC (450) DTO Ops (200) DMC (150) RMC (250)
BCA (50) RMC (200) DMC (60) DAC (870) DTO Ops (1530)
DTO Arp (24.48) DTO Ops (173.8124) DM (5.7848)
I would like to extract selectively all DAC numbers assuming that the position of DAC number in the string is random but the number is always coming between () after "DAC" and 1 space.
Thanks
Regards
Ehfa DilThanks Zack and Sanjay for your help! Really appreciated!
Hi Sanjay,
Your suggestion is working but I get errors when I have some database records with no "DAC " String
like this one: DTO Arp (24.48) DTO Ops (173.8124) DM (5.7848)
I have a 1 TB database with many similar records unfortunately...
I am not good in programing but I am wondering if there is a script to avoid such errors. I have a workaround with Select expert in Crystal Reports but it is not convenient If I want to publish reports. Would be good if I can put (if expression or anything that could take such case out of errors) any ideas that could help?
Thanks Again
Regards
Ehfa Dil -
How to make row number in local member dynamic
I have create multiple local member and the formula I the local member is such as
=SUM(row11+row14+row16)
then I add another couple of row before row 11, now the formula should be:
=SUM(row13+row16+row18)
anybody know is there a way how to make the formula in the local member dynamic, which means that if I add rows of drop rows, the formula in local member will automatically change?Hi Jian,
You can create local my by "Activate Local Member Recognition", but make sure "Use Position in axis" should be unchecked.
Also make sure you have added all required Local members before any insertion of rows.
Hope this should work.
Thanks,
Rishi -
How to extract month number from a column in a table
select extract(MONTH FROM DATE to_char(a.creationdate)) from mytable a doesn't work . plz tell me what is wrong with this. is there another way to get the month in a numeric form apart from this.
Hi
SQL> SELECT TO_NUMBER(TO_CHAR(TO_DATE('March', 'Month'), 'MM')) MONTH_NUM FROM DUAL;
MONTH_NUM
3
SQL> SELECT TO_NUMBER(TO_CHAR(TO_DATE('December', 'Month'), 'MM')) MONTH_NUM FROM DUAL;
MONTH_NUM
12
SQL> SELECT TO_NUMBER(TO_CHAR(TO_DATE('August', 'Month'), 'MM')) MONTH_NUM FROM DUAL;
MONTH_NUM
8
This is what you want to do?
Hope it helps
Regards,
Tony G. -
How to extract the number of employees (Head count) in a particulr month
Hi Experts,
We are trying to have a customized report on Having the employee headcount for a particular month with number of employees joined on the month and number of employees left the organisation.What is the way to get it.
Please advice.
V Sai.Hi Vicky Sai,
The standard report is S_PH9_46000223 - EEs Entered and Left
If you want to obtain the numbers in the same screen you should do the following1
1 - access the report
2 - further selection button - select Action type and move it to the Selection fields (you will get it on the screen)
3 - select action Hiring and action Leaving (so that the report will only count these elements)
4 - Period - current month
5 - run the report
6 - you will now have to see the number of employees (unfortunately you cannot do Sum here as you could do in a Querry that you would build as you would add the Count field so we need to do a little trick)
7 - Change layout icon - View tab- select Preferred view instead of SAP List viewer ->Microsoft Excel
8 - Select a template - press save
9 - You will see now the report in the Excel format. You can do sums if you want, add formulas, or you simply delete the first line and just look at the latest line filled in (total number of EE who left or were hired during the month)
If you do your own Querry - you can skip the Excel part and make a screen variant with the Sums.
At least now you have 2 options that you can choose from
Regards,
Adriana -
How to extract specific line from a string
Hi guys.
I?m starting to work with java...
i have the following data inside a string variable:
0 rows inserted.
0 rows updated.
0 rows ignored.
98 rows marked as deleted.
0 rows have no country.
3345 rows have no geo.
0 rows are invalid.
what i want to do i to extract the number of rows marked as delete.
I think that i figured out how to extract the number from this line :"98 rows marked as deleted."
but how do i get to that line?
I hope you can Help me. Thanks.the string is the result from a Function... this function gets the info from a store procedure...
rta = "Results for " + dh.getSource() + " source:\n" +
dh.getInsertedCount() + " rows inserted.\n" +
dh.getUpdatedCount() + " rows updated.\n" +
dh.getIgnoredCount() + " rows ignored.\n" +
dh.getDeletedCount() + " rows marked as deleted.\n" +
dh.getNoCtryCnt() + " rows have no country.\n" +
dh.getNoGeoCnt() + " rows have no geo.\n" +
dh.getInvalidCnt() + " rows are invalid.\n";
i can?t change this function...
so i need to work with the returned value...
i what thinking to use the following method to extract te number...
private int GetNumericValue(string sVal)
int iFirst, iCharVal, iEnd;
int iMult = 1, iRet = 0;
char[] aNumbers = "1234567890".ToCharArray();
iFirst = sVal.IndexOfAny(aNumbers);
iEnd = sVal.LastIndexOfAny(aNumbers);
if (iEnd < 0)
return 0;
string subStr = sVal.Substring(iFirst, iEnd - iFirst + 1);
iEnd = subStr.Length - 1;
while (subStr.Length > 0)
iCharVal = int.Parse(subStr[subStr.Length-1].ToString());
iRet += iMult * iCharVal;
iMult *= 10;
if (iEnd <= 0)
break;
subStr = subStr.Substring(0, subStr.Length - 1);
iEnd = subStr.LastIndexOfAny(aNumbers);
subStr = sVal.Substring(iFirst, iEnd + 1);
return iRet;
but i still need the 4rd line to extract the number -
How to increase the number of rows in Status Oveview iView in MSS?
Hi
We have implemented MSS and have a question regarding Status overview iview.
The standard status overview iview of the team workset has 5 rows and we have to scroll using the arrow buttons to select/view a request.
Now can anyone explain me how to increase the number of rows in this iview? Is this somthing that has to be accoplished through web dynpro customization?
I checked the options in iView property and do not see any option to increase the number of rows.
please help
Thanks
-MichaelHi Micheal,
Well, I am not really sure, if you could accomplish this using customizing, but I am sure that you can accomplish this using the JDI. Well, you can extract the application's source code using JDI and then change the required display rows property and republish it.
Am not really sure if this is suggestable method for this requirement,but it can be achieved using this JDI stuff.
Regards
<b>Raja Sekhar</b><i></i>
Maybe you are looking for
-
What are the programming language used in adobe livecycle development?
hi friends, I am a fresher.I woundered what adobe has done in livecycle import option.so i want to know wht is the programming language used and how they read graphical fields like line,circle.
-
Query for follwing count function
Table T1: COL 1 COL 2 1 2 3 10 89 4 5 - - 6 Quest: Select COL1,count(COL1) from Table t1 group by cOL1;Ans??? Pl Edited by: 799660 on Oct 3, 2010 5:36 AM
-
Better format for the AppDefinition XML file
Hello, We are using CVS as our source control and are having some problems with the merge process on a AppDefinition file. Is there a way to achieve a better-readable format (i.e. shorter lines, better element indentation, perhaps even attributes ind
-
I just installed MacOS X Yosemite on my MacBook Air 2011. After installing Yosemite I installed the Photoshop Elements 12.1 upgrade, but now when I open the program and try to use the tools, the program freezes. How do I fix this problem?
-
Why do I have to make disk image of AVCHD to import into iMovie?
iMovie imports AVCHD format file structure from the camera quite easily. (or so I hear, I have not done so myself yet). I have footage from the camera saved to an external hard disk which I want to import into iMovie08. I am a newbie to Apple/Mac thi