SDO_DISTANCE - Tolerance

If I have 2 point parms (not layers), with lat/longs with decimal places from 5 to 7 long, and I wanted to calculate the distance to within 5 CM, the formula would be:
SELECT MDSYS.SDO_GEOM.SDO_DISTANCE(
mdsys.sdo_geometry(2001,8307,mdsys.sdo_point_type(f_long,f_lat,NULL),NULL,NULL),
mdsys.sdo_geometry(2001,8307,mdsys.sdo_point_type(t_long,t_lat,NULL),NULL,NULL),
.05,'unit=KM' ) AS km_dist2 FROM dual;
What would be the equivalent (roughly within 5 cm) using a unit=MILE? Would I need to use a Tolerance of .0005?
SELECT MDSYS.SDO_GEOM.SDO_DISTANCE(
mdsys.sdo_geometry(2001,8307,mdsys.sdo_point_type(f_long,f_lat,NULL),NULL,NULL),
mdsys.sdo_geometry(2001,8307,mdsys.sdo_point_type(t_long,t_lat,NULL),NULL,NULL),
.0005,'unit=MILE' ) AS mi_dist2 FROM dual;
Thanks,
JB

It looks like the Tolerance Check is ALWAYS being done against Meters, even though, the Unit is either KM or MILE. It looks like if we were to set the tolerance to 0.05 it will always consider any 2 points as 1 point ONLY IF they are within approx. 5 CM of each other, even if MILE is specified as the UNIT?
SELECT MDSYS.SDO_GEOM.SDO_DISTANCE(
mdsys.sdo_geometry(2001,8307,mdsys.sdo_point_type(-89.514366,43.072118,NULL),NULL,NULL),
mdsys.sdo_geometry(2001,8307,mdsys.sdo_point_type(-89.2879915,43.1564514,NULL),NULL,NULL),
18300,'unit=KM' ) AS km_dist2 FROM dual;
Result = 20.6698332651529
SELECT MDSYS.SDO_GEOM.SDO_DISTANCE(
mdsys.sdo_geometry(2001,8307,mdsys.sdo_point_type(-89.514366,43.072118,NULL),NULL,NULL),
mdsys.sdo_geometry(2001,8307,mdsys.sdo_point_type(-89.2879915,43.1564514,NULL),NULL,NULL),
18325,'unit=KM' ) AS km_dist2 FROM dual;
Result = 0.0
SELECT MDSYS.SDO_GEOM.SDO_DISTANCE(
mdsys.sdo_geometry(2001,8307,mdsys.sdo_point_type(-89.514366,43.072118,NULL),NULL,NULL),
mdsys.sdo_geometry(2001,8307,mdsys.sdo_point_type(-89.2879915,43.1564514,NULL),NULL,NULL),
18300,'unit=MILE' ) AS km_dist2 FROM dual;
Result = 12.843638939315
SELECT MDSYS.SDO_GEOM.SDO_DISTANCE(
mdsys.sdo_geometry(2001,8307,mdsys.sdo_point_type(-89.514366,43.072118,NULL),NULL,NULL),
mdsys.sdo_geometry(2001,8307,mdsys.sdo_point_type(-89.2879915,43.1564514,NULL),NULL,NULL),
18325,'unit=MILE' ) AS km_dist2 FROM dual;
Result = 0.0

Similar Messages

  • ISSUS IN MDSYS.SDO_GEOM.SDO_DISTANCE()

    Hi experts,
    SQL> SELECT * FROM LOC_ZIP;
    COMP ZIPCD
    LOC(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    c1 z1
    SDO_GEOMETRY(2001, NULL, SDO_POINT_TYPE(100, 1, NULL), NULL, NULL)
    c1 z2
    SDO_GEOMETRY(2001, NULL, SDO_POINT_TYPE(200, 2, NULL), NULL, NULL)
    SQL> SELECT * FROM SUPP_ZIP;
    COMP SUPPI
    LOC(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    c1 s1
    SDO_GEOMETRY(2001, NULL, SDO_POINT_TYPE(5, 1, NULL), NULL, NULL)
    c1 s2
    SDO_GEOMETRY(2001, NULL, SDO_POINT_TYPE(77, 7, NULL), NULL, NULL)
    SQL> SELECT MDSYS.SDO_GEOM.SDO_DISTANCE(L.LOC,S.LOC,NULL)
    FROM Loc_zip L,Supp_zip S
    WHERE L.compcd = S.compcd;
    SELECT MDSYS.SDO_GEOM.SDO_DISTANCE(L.LOC,S.LOC,NULL)
    ERROR at line 1:
    ORA-22060: argument [2] is an invalid or uninitialized number
    ORA-06512: at "MDSYS.SDO_3GL", line 817
    ORA-06512: at "MDSYS.SDO_GEOM", line 3224
    ORA-06512: at "MDSYS.SDO_GEOM", line 3238
    Many Thanks,
    Kalinga

    You might try specifying a positive tolerance value (as the third argument to SDO_GEOM.SDO_DISTANCE), as in something like:
    SELECT
        MDSYS.SDO_GEOM.SDO_DISTANCE(L.LOC, S.LOC, 0.5)
    FROM
        Loc_zip L,
        Supp_zip S
    WHERE
        L.compcd = S.compcd;Hope this helps.

  • Sdo_distance conversion

    What is the proper value to convert a distance returned from the sdo_distance function to miles. I'm guessing that the returned value is cartesian or nautical. If it's nautical then should I multiply by 69.1 ? or do I need more precision or a different number. The srid I'm using is 8265.

    If you are using Oracle9i or later, you can let Spatial do the conversion for you:
    sdo_geom.sdo_distance(geom1,geom2,tolerance,'unit=mile')
    you can get the SDO_UNIT and the conversion factor from meters by using the following select statement:
    select sdo_unit,conversion_factor from mdsys.sdo_dist_units;
    SDO_UNIT CONVERSION_FACTOR
    M 1
    METER 1
    KM 1000
    KILOMETER 1000
    CM .01
    CENTIMETER .01
    MM .001
    MILLIMETER .001
    MILE 1609.344
    NAUT_MILE 1852
    SURVEY_FOOT .30480061
    FOOT .3048
    INCH .0254
    YARD .9144
    CHAIN 20.1168
    ROD 5.0292
    LINK .201166195
    MOD_USFT .304812253
    CL_FT .304797265
    IND_FT .304799518
    LINK_BEN .201167651
    LINK_SRS .201167651
    CHN_BEN 20.1167825
    CHN_SRS 20.1167651
    IND_YARD .914398554
    SRS_YARD .914398415
    FATHOM 1.8288
    27 rows selected.
    Sorry, I'm sure this message board will ruin the formatting, but I'm sure you get the idea.

  • Maintain tolerance limits in the Tolerance key

    Hi,
    Could any one help me how to maintain these Tolerance limits in the Tolerance key. This is an error I receive  while creating a PO.
    Best Regards,
    Sridhar.k

    What is the Error Mesaage no you are getting??
    Solution is as Follows
    Set Tolerance Limits for Price Variance
    In this step, you define the tolerance limits for price variances.
    When processing a purchase order, the system checks whether the effective price of a PO item shows variances compared with the valuation price stored in the material master record. In addition, it checks whether the specified cash discount value is admissible.
    Variances are allowed within the framework of tolerance limits. If a variance exceeds a tolerance limit, the system issues a warning or error message.
    In the SAP System, the types of variance are represented by the tolerance keys. For each tolerance key, you can define percentage and value-dependent upper and lower limits per company code.
    Standard settings
    The standard SAP System supplied contains the following tolerance keys:
    PE Price variance, Purchasing
    Tolerance limit for system message no. 207. This message appears if the specified effective price exceeds the predefined tolerances when compared with the material price.
    SE Maximum cash discount deduction, Purchasing
    Tolerance limit for system message no. 231. This is a warning message, which appears when the specified cash discount percentage exceeds the predefined tolerances.
    Note
    You can specify whether the system message appears as a warning or error message using the menu options <b>Environment -> Define Attributes of System Messages.</b>
    Activities
    Maintain the tolerance limits for each tolerance key per company code
    Regards
    Biswajit

  • Purchase Order Goods Receipt quantity tolerance setting not working.

    Team,
    We are using the IS-Oil solution, ECC 6.0 REL 605 SP LEVEL 009 .
    The issue that I have is as follows:
    Purchase Order Goods Receipt quantity tolerance setting not working, I had set up a 10% tolerance on QTY received in the GR process via the PIR and also the Purchase Value Key in the  material master and also changed the message to a warning in OMCQ for message number M0722.
    I  had performed a similar configuration and master data maintenance on a different NON IS-OIL client install and it worked fine.
    I believe it is the IS-OIL component in the Inventory update portion of the GR process that is causing the error.
    I have searched for OSS notes, however they mention that there is no solution.
    Setting the PO line item as Unlimited will not be best practice for the business and will not be used.
    Has anyone come across this issue? and how was it resolved, your help and guidance will be greatly appreciated.
    Thanks

    Hello,
    Please check the Tolerance levels in O588 
    Also you can use the BAdI OIB_QCI_ROUND_QTY: A new method, CHECK_TOLERANCE
    Best Regards,
    R.Brahmankar

  • Transaction BORGR: No tolerance on goods receipt for Kanban calloff

    Hello,
    we have the following situation:
    - MM scheduling agreement with tolerance of 10% for under and overdelivery, production supply "summarized JIT call" is set.
    - KANBAN cycle has 1 empty container with a summarized JIT call for replenishment, quantity 10 pieces.
    - ASN has been created with BORGR transaction, it contains: 1 line item for the material with delivery quantity 9 pieces, assigned to this line item is the JIT call with notified quantity 9 pieces as well.
    My expectation was that the JIT call can be booked with 9 pieces as it is inside the 10% tolerance defined for the scheduling agreement. In addition, I expected the KANBAN container be set to full.
    Instead, the following error message is given:
    'Post GR' carried out without success
    (Message no. BORGR215)
    Because of previous error, dispatching is not possible for ID 0180573431
    (Message no. /SPE/ID_HANDLING011)
    Inbound Delivery 0180573431 00010
    (Message no. BORGR210)
    Total of the summarized JIT calls does not match the current delivery qty
    (Message no. BORGR540)
    Changing the delivery quantity and the notified JIT quantity to 10 pieces, the goods receipt is booked correctly.
    I only found the following notes that deal with tolerances but they are outdated, as we are using DIMP release 603:
    https://service.sap.com/sap/support/notes/393421
    https://service.sap.com/sap/support/notes/508215
    Has anybody faced a similar problem or can help me with this?
    Thanks!

    Hello Jiaul,
    Sorry I may have mislead you.  The actual error message is "Goods Receipt for Production Order XXXX can only be made on 2010.08.25 to 2010.08.27".  These two dates are the Start Date and FInish Date for the Production Order in CO03, 
    The Basic Start Date for the current Production Order is  2010.08.25
    The Basic Finish Date for the current Production Order is 2010.08.27
    I think what it means is that you can only Post Goods Receipt for the Production Order only after the Basic Start Date of the Production Order.  Do you know where I can find the configuration for this message?
    Thanks

  • EBS Customer open items automatic clearing within tolerances

    Hi Experts,
    We have already implemented Elecronic Bank Statements automatic uploading functionality.  As part of this process, customer open items need to be cleared automatically. 
    As per the standard process, SAP will be able to clear off the open items ONLY if the collection amount (reflected in MT940) is exactly equal to the invoice amount (reflected in the open item).  But general practical situation is that customers may under / over pay.  For example, if the customer invoice is for USD 100,005 the actual payment from the customer could be for USD 100,000.  In this case, it is normal business practice that open item will be cleared off rather than keeping balance USD 5 in ledger and chasing the customer.
    So tolerances are already set up both at GL account level (Trans OBA4) and customer level (Trans OBA3) with blank tolerance group with permitted payment difference of USD 15.  And no tolerance group is assigned to the customer master.  Also account determination is maintained for the differences with nil reason code.
    Inspite of all these settings, I am getting an error message indicating that the difference is too large for clearing while trying to upload this bank statement.  Here the difference is only USD 5.
    My doubts are:
    1. Does the standard EBS program RFEBKA00 considers the permitted payment difference tolerances set in transaction OBA4 and OBA3 ?  I don't need to post the differences with reason code.  That's why account determination is maintained with blank reason code as well. 
    2. SAP Note 124655 (Point No 3) says that entering reasons for differences is not possible in the standard system through EBS.  Does that mean clearing of open items WITHOUT reason code is possible ?
    3. SAP Note 549277 (Point No 5) says that even though Note 124655 specifies certain functionalities as not supported in standard system, they can be achieved by customer through user exits.  Does that mean it is possible to code in the user exit saying that system should consider the payment difference tolerances for clearing off of the open items ?
    Could you kindly let me know your experience with these questions.  I will be very glad to hear from you.  Thanks for your time.
    Warm regards,
    Sridhar

    Hi Experts,
    I got this resolved by using the enhancement FEB00001.  If the field "Distribute by age" is activated through this enhancement, then system will be able to match the paid amount and the combination of open items for automatic clearing.  If there is no exact match, then automatic clearing through FF.5 is not possible as indicated in SAP Note 124655.
    There is no more necessity to use BAdI FIEB_CHANGE_BS_DATA.  Complete relevant logic can be maintained directly in the enhancement itself.
    Have a nice day.
    Regards,
    Sridhar

  • GR IR CLEARING TOLERANCE LIMIT.

    We are clearing  in F.13the GR and IR account there is difference in the GR and IR amount by Rs 100 ,SO IT IS NOT CLEARING.
    WHERE IS THE SETTING MADE FOR TOLERANCE FOR GR IR CLEARING.PLEASE PROVIDE THE PATH.
    Pls help.
    Edited by: mysap query on Feb 6, 2009 12:45 PM

    resolved

  • GR/IR clearing with tolerances

    Hi,
    Where do you specify the tolarences for GR/IR clearing?

    Hi,
      I believe In MR11 transaction itself you can give the tolerances in the selection-screen..
    Thanks,
    Naren

  • IR and GR Tolerant

    Hi,
    Kindly advise the path for checking the GR and IR tolerant setting.
    Thank you.

    Hi
    For invoice tolreance, you have to as below,
    LIV
    IMG---> MM-> LIV--> Invoice block----> Set tolerance limits, here you need to define for which activity you need to establocs tolerance limits. That is variances between the invoice and the purchase order or goods receipt.
    There are different keys for each stage, there are 12 std. entries available for different variance posting, you can simply copy all of them and enter your company code. Once done, now go to each individual TLKEY and set the tolerance limits for the tolerance keys as required.
    GR
    You need to set the Purchasing value key in material master which controls the GR quantity , you can have tolreance key attached to the master and during GRN it behaves accordingly.
    IMG-->MM>Purchasing>material master>Define Purchasing Value Keys-> Create your own tolerance keys inside uner GR/IR for under delivery and over delivery.
    if you have left the field empty in Material master then , during PO creation in the delivery tab you can have the under delivery tab/over delivery tab fileds filled.
    Finally check
    IMG->MM>Inventory Management and Physical Inventory->Goods Receipt->Set Tolerance Limits-->Set the tolerance level, but this is for price variance level only and i do not think it is useful for you. Please use the purchaing value key or enter the tolerance levels in PO level for GR.
    Best Regards
    Edited by: samuel mendis on Apr 20, 2009 9:21 AM

  • Using tolerances in SAPF124 - GR/IR Clearing Program

    Hi,
    Could anyone tell me what all configuration we need to make to use the include tolerances functionality in program SAPF124. I need to know all the configurations I need to make for using this. I am aware that we need to define tolerances in below Path and also the clearing account respectively
    Financial Accounting>General Ledger Accounting>Business Transactions>Open Item Clearing>Clearing Differences>Define Tolerance Groups for G/L Accounts
    And
    Financial Accounting>General Ledger Accounting>Business Transactions>Open Item Clearing>Clearing Differences>Create Accounts for Clearing Differences
    Using these I am not able to clear the differences in GR/IR clearing account. Do I need to maintain some more configs.
    Regards,
    Vijay

    Have you checked "GR/IR account special process" on SAPF124 selection screen...
    What about OB74 settings ...
    Regards
    Siva

  • PO Tolerance Limit

    Hi ,
    We have a problem with processing our PO ' s.
    For a PO , we have the GR posted , howevre the IR is not getting posted. And this process is automated  ( through IDOCS ).
    When we analysed the issue, found out that the reason it is not posting is because of this :
    " Because there is a diffrenece between the Debits and Credits ( that is the GR and IR Amount ) Say the GR is 500 $ and IR is 600 $ , the system is not posting as the difference is beyond the tolerance limit " ..
    So how do i change the Tolerance limits for the POs so the IR posting takes place...
    And why does the IR value be greater thatn GR ? If i want to see at what value the IR will post..where can i see that ?
    Thanks for any help...
    srikanth.

    Dear,
    There are various tolerance keys are coded in the standard SAP program, few of the example...
    AN: Amount for item without order reference
    If you activate the item amount check, the system checks every line item in an invoice with no order reference against the absolute upper limit defined.
    AP: Amount for item with order reference
    If you activate the item amount check, the system checks specific line items in an invoice with order reference against the absolute upper limit defined. Which invoice items are checked depends on how you configure the item amount check.
    Likewise other tolerance keys used by program are BD,BR,BW,DQ,DW,KW,LA,LD,PPPS,ST,VP
    These keys are determined by stadard functionality.
    Regards,
    Chintan Joshi

  • Gl Tolerance set up for Autoposting

    Hi ,
           We have EBS files posting to SAP ( autopost) to GL's and some of the entries in this autpost are not cleared automatically the automatic clearing differences are too high. I checked the tolerance group for those GL's in OBA0 ( both From and To ) for a given company code and its Blank there is no tolrance group defined , the limits on the blank tolerance group is very less and it fails to autpost when it is more than 50 million . Can some one let me know what changes I need to make for this autopost to be sucessful when the amounts from the bank file are too large ?
    Thanks in advance .

    Hi,
    maybe I understand you wrong, however the whole purpose of tolerance in deviations is to minimize manual process in the case those differences are immaterial. E.g. your expected incoming payment amount from one of your Customers is EUR 10,00 (ten Euros), however due to whatever reason you receive just 9,95. So instead of starting a manual work flow in your office and negotiating difference of EUR 0,05, which might cost you much more in terms of alternative costs - some time of your human resource, also some correspondence relevant costs, etc. - let's assume EUR 5, you just clear that item, putting that difference amount to some P&L account - this is fully traceable in SAP.
    on the other hand, if you talk about deviations of around 50 mio, I don't think it makes any sense, cause it is very huge risk and direct high-way to financial errors and/ or frauds. And, of course,  in this case every item should be dealt with proper diligence. also, I assume a number of those material deviations is usually limited, so this is another reason why no automation is expected there.
    hope this will help you.
    Rgds,
    Renatas

  • PR tolerance key

    Dear All
    Where can I assign the PR tolerance Keys to the Document types, pl explain how the system will give error message in PO if price is exceeds than PR tolerance Price. what are all the configuration settings required
    Regards
    Ramesh B

    Hi
    In standard SAP it may not be activated. You need to use public sector management. You can see it in below customization.
    spro>public sector management->Functions for US federal government->integration->Materials management------> document to document tolerence.
    Here you can assign PR document type and tolerance.
    Regards
    Antony

  • Tolerance Limit in MIRO...

    Dear All,
    How to setup the tolerance limits for a user to enter MIRO invoices to 2% greater than the line amount of a Purchase order and no limit for less than the line amount.
    Regards,
    Shashank.
    Edited by: Shashank on Sep 21, 2010 5:31 PM

    IMG  MM \ LIV \ INvoice block \ set tolerange limits
    key PP
    Also read the config. help text.

Maybe you are looking for