Find lines with same x,y SDO_Ordinates endpoints

I am trying to find all lines with the same x,y SDO_Ordinates endpoints in an oracle spatial table. The lines have different numbers of vertices. The lines I am trying to find are loops. All lines in the table have GTYPE = 2002.
The logic of the query is something like:
Select * from lines
where SDO_ORDINATES[0] first vertex X coordinate = SDO_ORDINATES[X] last vertex X cooridinate
and SDO_ORDINATES[1] first vertex Y coordinate = SDO_ORDINATES[Y] last vertex Y cooridinate
I am having no success playing around with different combination of the sdo_util.getvertices and sdo_util.getnumvertices funtions.
Thanks,
Mike

Mike,
You need a function like this to do what you want to do:
create or replace function get_vertex(geom sdo_geometry, vertex_type varchar2)
return number is
begin
if (vertex_type = 'FIRST_X') then
return geom.sdo_ordinates(1);
elsif (vertex_type = 'FIRST_Y') then
return geom.sdo_ordinates(2);
elsif (vertex_type = 'LAST_X') then
return geom.sdo_ordinates(geom.sdo_ordinates.count-1);
elsif (vertex_type = 'LAST_Y') then
return geom.sdo_ordinates(geom.sdo_ordinates.count);
else return NULL;
end if;
end;
Use this function to find the first and last vertices and to do the comparisons.
select get_vertex(geom, 'FIRST_X'), get_vertex(geom, 'FIRST_Y'),
get_vertex(geom, 'LAST_X'), get_vertex(geom, 'LAST_Y')
from geom_table;
siva

Similar Messages

  • Script to find files with same names with in a folder and it sub folders.

    Looking for script to find files with same names with in a folder and it sub folders.

    Are you just looking to find if any two files underneath a folder have the same name?
    If you just want to know that a file named "whatever" exists in two folders, that's not too difficult, but you probably want to know the full path names.
    Here's one attempt:
    $ perl -MFile::Find -le 'find(\&w, "."); while (($n,$p)=each %file) {if(@{$p}>1){print join(" ",@{$p})}} sub w{push @{$file{$_}},$File::Find::name;}'That will print the pathnames on the same line of any files with the same name that appear anywhere underneath your current directory.
    It's a bit long for a "one-liner", but functional.
    Darren

  • Line with same key

    Hello everybody, Im facing a problem when trying to run a query
    Im getting an error that says: There is already a line with th same key.
    I ran the program ANALYZE_RSZ_TABLES and I found the query that Im trying to run under the error: Selections or RKFs with incomplete defeinition.  Im not sure if Im in the right track, or if there is something else that I have to check.
    Can somebody help please?

    yes I already went there too but found anything important.   I did search the oss nothes but nothing worked, I´ll keep trying and see if I can solve it, but if somebody has any idea, please tell me

  • Trying to write an Automator program to find files with same time created and change file names to matching source folder names

    I am failrly green when it comes to automator.
    I am trying to write an Automator program:
    Not sure where to post this
    trying to write an Automator program to find files and alter their names
    I have a source folder with correct named master files in it.
    eg. A0001_1234.mpeg
    time created 14:02:03
    date 07/07/2012
    Another folder where there will be copies of the master files in a different format with different names but created at the same time as a file in the source directory.
    they are created with a seperate device but they are
    A0000001.mp4
    time created 14:02:03
    date 07/07/2012
    I need it to then take the name from the source fies and apply the correct name to the matching file based on the time it was created.
    I can't seem to find actions in automator that reference time crated.
    Is this something I will be able to Do in automator?
    Any help would be great
    Thanks
    R

    Hi,
    It's impossible to do this without any script in Automator.
    Use this AppleScript script :
    set source to choose folder with prompt "Select the source folder"
    set anotherfolder to choose folder with prompt "Choose the another folder"
    tell application "Finder"
        repeat with tfile in (get files of source)
            set cDate to creation date of tfile
            set findFiles to (files of anotherfolder whose creation date is cDate)
            if findFiles is not {} then
                set tName to name of tfile
                set name of item 1 of findFiles to tName
            end if
        end repeat
    end tell

  • Multiple PO confirmations for a PO scheduled line with same confirmation type

    Hi,
    I'm trying to post PO confirmations from the idoc type '/AFS/ORDERS05', message type 'ORDRSP' using process code 'ORDR', function module 'IDOC_INPUT_ORDRSP'. When I try to post a confirmation type which is already confirmed once for a PO scheduled line it is replacing the current confirmation without adding a new confirmation line to the same PO scheduled line. But this is possible to do using the standard PO change tcode ME22N. Is there any specific segments in the IDOC to achieve this?
    Thanks,
    Dilum

    Hi
    Please use table EKAB for your search instead of using EBAN Or EKKO
    Thanks & Regards
    Kishore

  • Compare two invoices with same distribution line count

    I am trying to pull data out of Oracle Payables - invoices for which the invoice amount ,the vendor and distribution line count is same.
    I could achieve pulling invoices with same Vendor having same amount.But finding hard to compare the counts.
    Can anyone share ideas on how to achieve this ... Tried self join but did not work.
    The query which I used is as follows :
    select invoice_num,invoice_id,invoice_amount,vendor_id,
    (select vendor_name from apps.po_vendors where vendor_id=aia.vendor_id) vendor_name,
    (select count(*) from apps.ap_invoice_distributions_all aid where aid.invoice_id=aia.invoice_id) line_count
    from apps.ap_invoices_all aia
    where invoice_amount in (select aiab.invoice_amount
    from apps.ap_invoices_all aiab
    where aiab.creation_date >='01-AUG-2012'
    and vendor_id=aia.vendor_id
    group by aiab.invoice_amount
    Having (count(aiab.invoice_amount) >1))
    and aia.creation_date >='01-AUG-2012'
    Thanks in Advance.

    I did try your query with sample records and counts are also correct plz chk the following, for me counts are correct as per your logic -
    select aia.invoice_num,aia.invoice_id,aia.invoice_amount,aia.vendor_id,
    (select vendor_name from
    (select 'XX' vendor_name, 'A' vendor_id from dual union all
    select 'XY' vendor_name, 'B' vendor_id from dual union all
    select 'XZ' vendor_name, 'C' vendor_id from dual union all
    select 'XA' vendor_name, 'D' vendor_id from dual ) po
    where vendor_id=aia.vendor_id) vendor_name,
    (select count(*) from
    (select 1 invoice_id from dual union all
    select 1 invoice_id from dual union all
    select 1 invoice_id from dual union all
    select 2 invoice_id from dual union all
    select 3 invoice_id from dual ) aid
    where aid.invoice_id=aia.invoice_id) line_count
    from
    select 10 invoice_num, 1 invoice_id,100 invoice_amount, 'A' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 11 invoice_num, 1 invoice_id,100 invoice_amount, 'A' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 12 invoice_num, 1 invoice_id,100 invoice_amount, 'A' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 13 invoice_num, 2 invoice_id,100 invoice_amount, 'B' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 14 invoice_num, 2 invoice_id,100 invoice_amount, 'B' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 15 invoice_num, 3 invoice_id,100 invoice_amount, 'C' vendor_id ,'01-SEP-2012' creation_date from dual union all
    select 16 invoice_num, 4 invoice_id,100 invoice_amount, 'D' vendor_id,'01-OCT-2012' creation_date from dual) aia
    where aia.invoice_amount in (select aiab.invoice_amount
    from
    select 10 invoice_num, 1 invoice_id,100 invoice_amount, 'A' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 11 invoice_num, 1 invoice_id,100 invoice_amount, 'A' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 12 invoice_num, 1 invoice_id,100 invoice_amount, 'A' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 13 invoice_num, 1 invoice_id,100 invoice_amount, 'B' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 14 invoice_num, 1 invoice_id,100 invoice_amount, 'B' vendor_id ,'01-AUG-2012' creation_date from dual union all
    select 15 invoice_num, 1 invoice_id,100 invoice_amount, 'C' vendor_id ,'01-SEP-2012' creation_date from dual union all
    select 16 invoice_num, 1 invoice_id,100 invoice_amount, 'D' vendor_id,'01-OCT-2012' creation_date from dual) aiab
    where aiab.creation_date >='01-AUG-2012'
    and aiab.vendor_id=aia.vendor_id
    group by aiab.invoice_amount
    Having (count(aiab.invoice_amount) >1))
    and aia.creation_date >='01-AUG-2012'
    o/p
    INVOICE_NUM,INVOICE_ID,INVOICE_AMOUNT,VENDOR_ID,VENDOR_NAME,LINE_COUNT
    10,1,100,A,XX,3
    11,1,100,A,XX,3
    12,1,100,A,XX,3
    13,2,100,B,XY,1
    14,2,100,B,XY,1
    -------

  • Two deductions for invoice with same reason code posted as one line item

    Hi
    We have a scenario wherein we are taking two or more deductions on the same invoice and are using the same reason code which have a setting of charge off.
    SAP system displays the FI posting with same reason codes with charge off setting as one line item.
    However we want the FI Posting to display separate line items per deduction and not combine amounts of deductions based on same reason code with charge off setting.
    Any comments are appreciated.
    Edited by: Kirti Bhardwaj on Jul 24, 2011 9:46 AM

    Hi,
    you can use different reason codes in distribute differences screen once you have fist selected one reason code for one invoice.

  • Auto-pay separate lines on same account with different payment methods?

    if i have an account with two separate lines on it (for example, one for me and one for my gf), how can i set up auto pay by line?  in other words, have auto pay on one line with my cc, and auto pay on her line with her cc?
    i've been poking around in my verizon, but it seems i can only do auto-pay for the entire account...and i created a second userid for the second line, but it only lets me do "pay bill" not set up auto pay...

    I don't think what your describing is possible with Verizon's system.  Since the account owner is the only one responsible for payment, they haven't designed tools for the other users on the account to make payments in the same way.
    Maybe you can set something up through your bank?  Have your girlfriend's bank/CC automatically send a payment for her share of the bill to Verizon shortly after the bill is generated, then set up your auto-pay for the remainder a few days later.  That gives you some time to make sure everything has processed and credited correctly before the bill is actually due.  Once you know it works, you can adjust the dates.

  • TS1424 Tried to use my apple id to update some apps and got"Connection Manager::invoke:: Failed to find service connection url"  After this occured a few times I reset the id password, and this was confirmed by email.  It still fails with same message.  I

    Tried to use my apple id to update some apps and got"Connection Manager::invoke:: Failed to find service connection url"  After this occured a few times I reset the id password, and this was confirmed by email.  It still fails with same message.  Ideas?

    Hi, you have to logout from your iTunes account and reconnect it:
    Settings / iTunes & App Stores / ...
    https://mobilfunkexperten.de/news/13450/sporadische-probleme-im-itunes-und-app-s tore
    Hope this helps... :-)

  • Can I replace my land line with an iPhone and keep the same phone number?  Thanks.

    Hi,  Can I replace my land line with an iPhone and keep the same AT&T phone number?  Thanks.

    Hi
    There are always some wrinkles in this kind of change.  If you have a home security system like ADT they require a land-line for their system to work.  This less of an issue in apartments and condos - it's mostly a "house" issue.
    Before you make the switch (and there may be a switching fee) just make sure you cover all the bases.
    Cheers

  • Query 0: Runtime error There is already a line with the same key. with para

    Dear all,
    I have a query with several variables. One of the variables is Version. When I use certain values e.g. 1,2 or 3, I can generate the query without any problem. However, when I use the other values e,g, 4, 5, or 6, the query gives me with the following error messages :
    1. Query 0: Runtime error There is already a line with the same key. with parallel processing via RFC
    2. Error while reading data; navigation is possible
    3. >> Row: 174 Inc: LRSDRPU02 Prog: SAPLRSDRP
    Error 1
    Query 0: Runtime error There is already a line with the same key. with parallel processing via RFC
    Message no. DBMAN428
    Error 2
    Error while reading data; navigation is possible
    Message no. BRAIN289
    Diagnosis
    An error occurred while reading the data. The query result is therefore empty or inconsistent and is not buffered in the OLAP cache.
    Procedure
    You can continue to navigate or return to the last navigation step.
    Error 3
    >> Row: 174 Inc: LRSDRPU02 Prog: SAPLRSDRP
    Message no. RS_EXCEPTION301
    Diagnosis
    En error has been triggered. This message specifies where in the coding the error occurred. This helps you to localize the error quickly.
    May I know what causes this error and how to troubleshoot it?
    Thank you.

    Venkat,
    You are either a genius or working for SAP.
    In any case, your solution solved my problem.
    Thanks heaps!

  • To group the lines with the same items before TO

    Hello,
    We use an external tool (linked to SAP WM) to prepare the orders.
    When I have a order with two lines with the same item (because a line free of charge) and when I generate the Transfer Orders, I have two lines and we have to go twice to the picking...
    Could you give me a solution to group the lines?
    Thx in advance

    Hi
    You have various options here depending on whether you have other middleware in place and what skills you have on-site.
    How are you transferring the information to your WMS system??  Idocs / BAPI / Files  ???
    Mark

  • Document splitting generates lines with alternating +/- signs

    Hi,
    While trying to post GR through MIRO, I am getting a message like "Document splitting generates lines with alternating +/- signs", please clarify why this error is coming.
    But I am able to post the moment I am deleting a small amount from planned delivery cost field. Why this is happening, can anyone explain pls.
    Regards,
    Ab

    Hi
    We have the same message but we want to clear two FI invoices
    Did you ever find out what caused this message?
    Regards
    Paddi

  • Multiple tax lines for same item

    Hi,
    Is it possible to have multiple tax lines for same item in an invoice in AR.
    Business Need - A few items have multiple tax applicable ( e.g. VAT, Service tax, etc ). And for regulatory purpose customer wants to show each tax separately.
    please Advise.
    thanks,
    K

    Hi Hikumar,
    With tax groups you have what is called compound taxes.
    A tax group is consisted of more than one tax codes and these tax codes may be related or not to each other,you can also specify the precedence of the tax codes in a tax group.
    On the Invoice or order item line, the tax group code is entered and the tax engine calculates the tax for each tax code that belongs to the tax group.
    If the user wants to see the taxes of this line he will see detailed the tax amounts and rates of each tax code that belong to this group.
    In my case i have used a tax group with 3 tax codes with the structure:
    Item line amount 1000
    1)The first line is a specific sales tax(12%) with taxable basis the amount of the item line=1000*12%=120
    2)The second line is a VAT(23%) tax with taxable basis the amount calculated from the first tax of the group=120*23%=27,6
    3) The third line is a VAT(23%) tax with taxable basis the amount of the item line=1000*23%=230
    For each item line that has the above tax group, the system creates three seperate tax lines
    Your case does not seem so complicate as mine.
    You can find more information on the AR user guide and the Oracle receivables tax manual.
    On which Ebs version are you working on?
    If you sent me more detailed you requirement i can quide you on the way to implement it and test it.
    I hope this helps.
    Regards
    Olga

  • When importing XML, how do I remove lines with labels but no content?

    I am working on a directory whose content is supplied as an XML file. I've created an automatic layout with static text/labels for contact details (e.g. Phone, Fax).
    When I import the file, superfluous lines with the static text and no content are created. I have 'Delete elements, frames and content that do not match imported XML' checked.
    Is there a way of avoid creating these? I've tried doing a search and replace to remove these but this causes quite a few other problems.
    Any help - much appreciated!

    Hi Alison,
    Did you create the posted XML file by extracting it from a larger file you've been using successfully? I ask because there seem to be a couple of problems with it which make me wonder how you got it to work at all, at least with the provided InDesign file's XML structure:
    The immediate child element of the "root" element in the XML document is one called "step2 ". All of the values with which you are concerned are children of that "step2" element, and yet the structure in the InDesign document contains no "step2" element. As a result, when I import, I get nothing at all in my InDesign document's content (though the data are in the XML structure, buried in a newly-created "step2" element.
    In both the XML and the InDesign document's XML structure, you have two different elements which are both named the exactly the same - "description" - (actually, in the XML document, there are three of them). When InDesign imports XML, it stops after the first "match" that it finds, so this will not work in any way that I imagine you intend it to. Based on the content of your InDesign document, I would think there ought to be two separate elements in your XML - named something like "step_description" and "category_description".
    If, after getting this all straightened out, your question is how to somehow make the text of an empty element (e.g., <description></description>) disappear in the imported result, there are a few possibilities:
    Get rid of the text inside the tag markers in your template/base document - for example, instead of having "[step_description]" (where the "[]" represent the tag markers), just make it be "[]". That way, if there is no text value for "step_description", there will be no text left after the import. However, if you put a end-of-paragraph in your template/base file, that will still be there. In most cases, that's not desired, so you might want to put the empty tag ("[]") in the text flow without a carriage return/line break. If you do that, you will need to include the carriage return in the XML data (which admittedly slightly violates the notion of separating presentation from content). Rather than the xml looking like this:
    <step_description>This is the text of my step description.</step_description> you would need to make it be this:
    <step_description>This is the text of my step description.&#13;</step_description>
    (having added "&#13;" to represent the carriage return (ASCII character 13).
    As above, make the tag an empty one, include the carriage return in your InDesign template/base document, and then write (or have written) a script to run after the XML import to deal with such empty tag cases.
    Upgrade to InDesign CS3, CS4, or soon, CS5, so you can take advantage of the "XML Rules" feature which was introduced in CS3. XML Rules will essentially allow you to automate the second option - running a script - as the XML import is taking place.
    Excuse the long (and probably unclear) post. If I've misunderstood your question, then please excuse it doubly...

Maybe you are looking for

  • How to descrbe a ref cursor from a PL/SQL prog?

    Hi, here is a sample of the my problem let suppose a table country : create table country(country_code VARCHAR2(3), country_name VARCHAR2(50)); then a package containing different procedures among them, this one : PL/SQL prog create or replace packag

  • Music from External Hard Drive suddenly not playing...

    The other day I disconnected my external hard drive to use it elsewhere, plugged it back in later, then suddenly none of my songs located on it could be played on itunes... Funny thing is that if I right click and go "show in windows explorer" it tak

  • Error in CRM Leasing Quotation regarding Financing Option

    Hi All, I created one financing option with financing character by entering neccessary data for periodic payments. And also assigned this opiton to one financing product. But when i am using the above financing product in the Leasing Quotation, i am

  • Configd seckeychainfindgenericpassword

    I cannot boot my OS without receiving a kernel panic. After booting in single user mode I am reasonably sure that the error occurs at the following stage: feb 25 13:42:01 username configd[48]: seckeychainfindgenericpassword err= -25300 (=0xffff9d24,

  • PP to MM good issue and cancel issue

    hi, there is a ABAP error comes when we cancel the GR of production order. OR if we go to cancel this with MM document same error is coming. pls comment on this. Regards Ashfaq