Determine Minimum Bounding Rectangle of objects

I need sql/plsql to determine the minimum bounding rectangle of a group of one or more polygons. The result can be returned as an optimised polygon.

If you are using Oracle9i, how about sdo_geom.sdo_mbr for one geometry, or sdo_aggr_mbr for multiple
geometries. Note they do not work on geodetic data.

Similar Messages

  • Minimum bounding rectangle of a single geometric feature

    Is there a function in ORACLE Spatial 8.1.7 that returns the
    minimum bounding rectangle (MBR) of a single geometric feature?
    SDO_TUNE.EXTENT_OF returns a MBR but for the whole layer but not
    for a single geometry.

    Hi,
    This is much slower than the built-in function for 9i, but might
    be helpful in any event. This function only works for 2d
    geometries. It doesn't do error checking for points and such.
    It assumes a NULL SDO_SRID. Etc. It isn't supported. In 9i, I'd
    immediately suggest going to sdo_geom.sdo_mbr.
    Call it like this:
    select xmbr(geom) from geod_states where state_abrv='NH';
    create or replace function xmbr (geom mdsys.sdo_geometry)
    return mdsys.sdo_geometry is
    vmbr mdsys.sdo_geometry;
    ogg mdsys.sdo_geometry := geom;
    ii number;
    xlow number;
    xhigh number;
    ylow number;
    yhigh number;
    begin
    -- initialize it
    xlow := 999999999999;
    ylow := 999999999999;
    xhigh := -999999999999;
    yhigh := -999999999999;
    -- assumes 2d geometry
    for ii in 1..ogg.sdo_ordinates.count
    loop
    if mod(ii, 2) = 0 then
    -- y
    if ogg.sdo_ordinates(ii) > yhigh then
    yhigh := ogg.sdo_ordinates(ii);
    else
    if ogg.sdo_ordinates(ii) < ylow then
    ylow := ogg.sdo_ordinates(ii);
    end if;
    end if;
    else
    -- x
    if ogg.sdo_ordinates(ii) > xhigh then
    xhigh := ogg.sdo_ordinates(ii);
    else
    if ogg.sdo_ordinates(ii) < xlow then
    xlow := ogg.sdo_ordinates(ii);
    end if;
    end if;
    end if;
    end loop;
    -- build the object (MBR rectangle)
    vmbr := mdsys.sdo_geometry(2003, null, null,
    mdsys.sdo_elem_info_array(1,1003,3),
    mdsys.sdo_ordinate_array(xlow, ylow,xhigh, yhigh));
    return vmbr;
    end;

  • FOR Minimum bounding rectangle

    Hi,
    Is there a function available in sap hana spiatial for finding minmum bounding rectangle on geometries.
    Currently, I am using below query to find it
    SELECT new ST_Polygon('POLYGON (('   || Min("GEOM".st_xmin()) || ' ' || Min("GEOM".st_ymin()) || ','
       || Min("GEOM".st_xmin()) || ' ' || Max("GEOM".st_ymax()) ||
       ','   || Max("GEOM".st_xmax()) || ' ' || Max("GEOM".st_ymax()) || ','   || Max("GEOM".st_xmax()) || ' ' || Min("GEOM".st_ymin()) || ','   || Min("GEOM".st_xmin()) || ' ' || Min("GEOM".st_ymin())   || '))') FROM "table" GROUP BY  ID
    But this is failing for point geometries in table because (xmin, ymin ) and (xmax,ymax) are same for point and it is not able to create polygon for it.
    I have also tried ST_UNIONAggr(thinking of getting envelope of the aggregated geometry) but this gives error with - invalid function or procedure name.
    Please suggest.
    Thanks in Advance.
    Nishtha

    Hello Nishtha, thanks for contacting us. Please refer to the SAP HANA and In-Memory Computing group: http://scn.sap.com/community/hana-in-memory You can post the same question there. I hope you will find this helpful. Kind regards, Federica

  • OCR labview code-character bounding rectangle

    NI didn't leak the codes and examples fully for Vision Assistant so I have to use the assistant whenever I train some characters.
    I want to add the simple training routine to my main program.
    As a start point, I would like to detect the character bounding rectangle of OCR object (like a red box of attachment) before reading a character set.
    Is there any related vi for this work?
    labmaster.
    *)NI Read LCD/LED.vi didn't operate for my purpose. gave up after investing time and various camera.
    Solved!
    Go to Solution.
    Attachments:
    yahoo.png ‏9 KB

    NI labview provided the code in OCR panel.

  • Determine the Size of an Object in ObjectInputStream

    Hi all,
    I have a quick question. I have a class that is being written over a socket using ObjectOutputStream and ObjectInputStream. I want to be able to set the buffer size of the socket to fit only ONE object. Can anybody tell me how to determine the size of that object?
    (Note, the object has a Properties object within it, but for the time being, it can be assumed that properties object will always be the same.)
    - Adam

    Having written it to the outputStream, thought, can
    the size be determined somehow by the inputStream?No, it can't
    This is related to my previous question (on Pushlets
    and Thread Priorities). I didn't read that one.
    I believe that it's possible
    that multiple threads are trying to write to the
    socket at the same time, and I cannot synchorize the
    input stream to get a lock on it. Do you mean the outputstream? Why can't you synchronize the method that writes to the outputstream?
    I thought this
    might be causing the data to not be sent over the
    socket until all the threads have finished. That doesn't sound correct. But you could call the flush method when an object is written.
    I
    figured if I reduced the size of the socket buffer,
    it would only accept a single object, eliminating
    this problem?I don't think so.
    /Kaj

  • Incorrect bounding rectangle height after styling

    I am experiencing with incorrect bounding rectangle height when I set the background color for text in RichEditableText field. I have actually custom styled the RET field with following:
    lineHeight: 49;
    baselineShift: 11;
    firstBaselineOffset: lineHeight;
    verticalAlign: top;
    When I try to change the background color for certain range of text it doesn't cover the entire line height, although the selection covers the entire line height. Is there any way to increase the height of bounding rectangle or any other workaround to this please?

    1. I am able to return the TextFlowLine for each line in para but I have seen that some TextLine are marked as INVALID due to which I am unable to get their atom locations. I have tried to force the validity of TextLine to recreate the line but that doesn't work for some lines. Is there any work around to this?
    When the contents of the TextBlock are modified, the Flash runtime marks affected text lines, the previous line, and all following lines as INVALID. So I think you may want to get the lines
    [When you try to override TLF source code] after ContainerController.updateCompositionShapes 
    [When you just take advantage of offical TLF library] in the event handler of UpdateCompleteEvent.UPDATE_COMPLETE.
    2. The highlighter rectangle which I have created, have tried to placed it as a child element of TextLine. Due to this, the highlighter rectangle appear infront of the TextLine. I have tried to positioned it at 0 location using addChildAt but that doesn't seems to work. Is there any work around to this also please?
    In TLF code, we creat Shape as the child of the container to draw the selection, because TextLine is transparent.

  • Why can't I see the bounding box for objects on the pasteboard?

    Adobe CC sucks. Why last week was I able to see the bounding box of objects that I had on the pasteboard in InDesign CC, including objects that didn't contain anything yet, and now suddenly this week I can't see them?
    It seems as though every week something inexplicably gets changed around. First Save As had no shortcut, then suddenly the shortcut is back, but it doesn't work.
    Get it together Adobe. I don't want to be paying a subscription for a product that feels as though it's still in Beta mode.

    Hi Steve,
    Yes thanks, I don't think I was clear in what I wrote. I knew that they could be turned back on, but why did I open InDesign this morning to find my workspace/preferences different than how I left them on Friday?
    And I know it isn't a case of my mistakenly turning off the frame edges, because the operator that sits next to me had the exact same thing happen to her copy of InDesign this morning also.
    I understand the requirement to update things, but it really does feel as though I'm using software that is still in testing.

  • Missing text determination procedure RIH for text object CGPL_TEXT

    Hi experts,
    creating a new single item in RPM we get following error message:
    "Text determination procedure RIH for text object CGPL_TEXT does not
    exist." And it does not exist our CRM customizing
    (Customer Relationship Management -> Basic Functions -> Text Management).
    We cannot define the missing procedure via customizing because it is not in our namespace.
    Any ideas where to find the right patch / program or other suggestions?
    Thanks & Regards
    Christoph

    It is not So10 cause you see the parameters for SO10 are
    Text Name, Text ID and Language,
    but I am keying in Text object, <b>TextDetermProc</b>.,Text ID.
    Pls reply fast this is urgent.

  • Table grid data bounding with BPM object

    I want to add a JSP/presentation in BPM InteractiveObject call.
    The requirements is that the UI shows some search fileds such as person firsname, person lastname etc.
    & user can search in database by providing data in those fields.
    I succeeds in doing above ....
    Now I have to show the table/grid showing the serach result having hyperlink/radio in last col of the table/grid & if user select any row I have to pass the Id of that row so I can pick the row & show on individua details page.
    So how an object array is bound as BPM object variable to presenttaion/JSP & get back user selection.
    If any one have example of doing this. pls share...
    thanks.

    Hi ..
    I'm not sure what you mean by "the field "Code" does not contain the value... ". Is the column been filled in with some content on the matrix ?
    If not, you have to put in some value dynamically.  Try using a query that adds up numbers to the columns Code and Name (if you are not using them on the GUI).  Since these columns are required ones, you could create a query like this for instance,
    INSERT INTO @TABLE1 (<b>Code</b>, <b>Name</b>, Field1, Field2)
    SELECT CASE WHEN MAX(CAST(Code AS INT) IS NULL THEN 1 ELSE MAX(CAST(<b>Code </b>AS INT)) + 1 END, CASE WHEN MAX(CAST(Code AS INT) IS NULL THEN 1 ELSE MAX(CAST(<b>Code </b>AS INT)) + 1 END, "test", "test"
    this query inserts the record adding numbers to the Code and Name fields automatically!  So you don't have to deal with them ... I hope this helps!

  • How do I determine the size of an object on a particular layer?

    Whether it's a rectangle, circle, line, etc. how do I determine what the size of an object is on a particular layer?

    Right click on the rulers and set the scale to pixels in the dialog
    Go to View>new guide and select the position of the guide lines along horizontal and vertial axes
    Window>info brings up the Info Palette. The information in the right lower corner provides a readout of any selection that you make, e.g. with the marquee tool
    View>grid allows one to bring up a non-printable grid which is useful for orientation. The grid can be set up with subdivisions to suit via Edit>preferences>guides and grid
    You can open a duplicate layer at the top of the stack, then using the brush tool create a straight line for visual projection. The layer can be deleted at any time. To create a straight line, click on the begin point, hold down the shift key, and click on the end point
    Hope that one of these options is useful for your purpose. Please post your progress.

  • How do I determine the size of an object?

    After an object is instantiated, is there anyway to determine its size (in bytes)?

    Why do you want to know? Java handles memory management for you.
    IIRC for Sun JVM 1.4:
    Objects: four bytes for each reference, boolean, byte, short, int, float or character field, eight bytes for each long or double field, plus sixteen bytes header information.
    Arrays: length * (four for reference, int or float; one for boolean or byte; two for short or character; eightfor long or double), plus sixteen bytes header information.
    Pete

  • How to reference the rectangle box object in my code?

    I have to do some code migration from 16 bit Apps (Forms on
    Win3.1) to 32 bit apps(Forms on WinNT).For this migration i made
    a form for generation all the form in one shot . it's working
    fine. but it's giving me scroll bar in each form. we used
    rectangle box in most of the form and as u know i can not reffer
    rectangle box in programming.so i am not able to resize that. Is
    there any way so that i can refer that object programatically and
    can resize it.
    null

    shilpesh (guest) wrote:
    : I have to do some code migration from 16 bit Apps (Forms on
    : Win3.1) to 32 bit apps(Forms on WinNT).For this migration i
    made
    : a form for generation all the form in one shot . it's working
    : fine. but it's giving me scroll bar in each form. we used
    : rectangle box in most of the form and as u know i can not
    reffer
    : rectangle box in programming.so i am not able to resize that.
    Is
    : there any way so that i can refer that object programatically
    and
    : can resize it.
    Shilpesh,
    Please appreciate that this discussion forum is for Reports 6i
    Beta ONLY, as is also mentioned on the first page on the forum.
    Hence we will not be able to address this question .
    Regards
    The Oracle Reports Team
    null

  • Home Stub is bound or Home object is bound in JNDI

    Hi,
    When I lookup Home i get home stub at client side. My question is what is bound in JNDI tree Home stub or object of Home implementation class which is implemented by Server?
    thanx

    My understanding:
    It is the stub that gets bound to the JNDI. From the client side, we look up the JNDI for the home stub. The stub knows how to communicate with it's corresponding server object(Home) thru the skeleteon(I think the concept of skeleton in RMI is deprecated now..)

  • Create a rectangle around object?

    Can this be done in illustrator scripting??
    http://coreldraw.com/forums/t/35280.aspx
    creating a rectangle around selected object or objects and set margins...
    Regards
    Martin

    Hallo martin_Cahill,
    My English is not the best, because of that in German.
    Grundsätzlich sind sich VBA und Javascript sehr ähnlich. Versuche die folgende Funktion mit den VBA-Äquivalenten zu vergleichen. Learning by doing
    function makeRect() {
    if (selection.length == 0) {
        alert("Kein Objekt …");
        return;
    }else{
        if (selection.length > 1) {
            alert("Zu viele Objekte …");
            return;
        }else{
            var myDoc = app.activeDocument;
            var Sel = myDoc.selection
            var SelVB = Sel[0].visibleBounds;
            var dMarg = 28.3464567;
            var Links = SelVB[0];
            var Oben = SelVB[1];
            var SelBreite = (SelVB[2] - SelVB[0]);
            var SelHoehe = (SelVB[1] - SelVB[3]);
            var newCMYK = new CMYKColor();
            newCMYK.cyan = 100;
            newCMYK.magenta = 0;
            newCMYK.yellow = 0;
            newCMYK.black = 0;
            var myGroup =myDoc.groupItems.add();
            Sel[0].move(myGroup, ElementPlacement.PLACEATBEGINNING);
            var MargBox = myDoc.pathItems.rectangle(Oben+dMarg, Links-dMarg, SelBreite+2*dMarg, SelHoehe+2*dMarg);
            MargBox.stroked = true;
            MargBox.strokeWidth = 10;
            //MargBox.filled = false;
            MargBox.fillColor = newCMYK;
            MargBox.move(myGroup, ElementPlacement.PLACEATEND);
    Hilft dir das weiter?
    Viel Spass noch.

  • Is there an Adobe-provided function to determine whether 2 rectangles intersect?

    Background info: I am implementing the Copy half of a Copy&Paste facility, and need to determine what items (page elements? paths? path elements?) are surrounded by the selecting rubberband/drag rectangle.
    Since a possibility is to test a full path (as opposed to its constituent elements) I guess I could take each of the rubberband's corner points and test them as follows:
       PDEElementIsAtPoint(INPDEElement elem, INASFixedPoint point1);
       PDEElementIsAtPoint(INPDEElement elem, INASFixedPoint point2);
       PDEElementIsAtPoint(INPDEElement elem, INASFixedPoint point3);
       PDEElementIsAtPoint(INPDEElement elem, INASFixedPoint point4);
    TIA

    Thanks!
    ASBool PDEElementIsAtRect(INPDEElement elem, INASFixedRect rect)
    NB: Too bad the most important item above (the function mame) is not clickable....
    -RFH

Maybe you are looking for

  • Error 1935.An error occurred during the installation of assembly 'Microsoft.VC90.ATL or 'Microsoft.VC80.ATL'

    The OS is Windows Server 2008 R2 I can't install any programs (like backup agents) that require these components:  Microsoft Visual C++ 2005 SP1 Redistributable Package (x64) or the Microsoft Visual C++ 2008 SP1 Redistributable Package (x64) I've tri

  • Date not coming correctly in date field

    Hi all I have added a field on a screen of type dats (8 char) So if user gives date as 10/11/2009 he can only update the field with 10/11/09 If i change the length to 10 then if user gives date in a wrong format also like abcdefg then also it will be

  • 1 album split into two

    Hi I have an album in iTunes 10.5.1 which is split into two, there does not appear to be an discernable diferences in the Get Info of the various tracks, so why does iTunes insist on splitting the album? Is there any way to tell iTunes that all the t

  • Alternative to SHMA and Shared Object

    Hi, my sap release is 4.7. It's exist an alternative solution to SHMA in this release? Regards Angela

  • Adjustment Layer to make my videos black!

    When i use Adjustment Layer on top of my videos, as soon as i use ANY effect my video goes black. If i delete the effects my video shows again. It happens on every project i have and it's annoying because i use the adjustment layer to create a look a