Polygon with a hole

Hi all,
I Have got a polygon with a hole, How can I have  Exterior rings vertices only?
This is a shape example
MDSYS.SDO_GEOMETRY(3003,null,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,16,2003,1),MDSYS.SDO_ORDINATE_ARRAY(575876.863338807,5000843.2303514,0,575875.717173073,5000826.03786538,0,575893.511998443,5000824.19470697,0,575894.261480691,5000843.33533055,0,575876.863338807,5000843.2303514,0,575881.116715103,5000837.33947256,0,575886.290860426,5000837.06483032,0,575886.092402506,5000829.67988328,0,575880.8284527,5000830.19056495,0,575881.116715103,5000837.33947256,0))                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
If I use this statement I get back all vertices                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
SELECT c.id,  t.X, t.Y, t.id
   FROM LAND c,
   TABLE(SDO_UTIL.GETVERTICES(c.GEOMETRY2)) t
   WHERE c.ID = 3888
I work on Oracle Database 10g
Thanks in advance.
Angelo

Hi Angelo,
Note this has been answered before on the forum
How do I remove inner rings from a complex geometry of SDO_GEOMETRY type
In terms of your code, you need a second parameter for the ring extraction.  The first ",1" grabs the first element (for a single part geometry its just the geometry) and the second ",1" grabs the first ring of that first element.  Note there are a lot of caveats to your simple extraction that the code in the post above may help with. 
Paul
SELECT c.id,  t.X, t.Y, t.id
  FROM LAND c,
  TABLE(SDO_UTIL.GETVERTICES(sdo_util.extract(c.GEOMETRY2,1,1))) t
  WHERE c.ID = 3888

Similar Messages

  • Running SDO_INTERSECTION with a Polygon with a hole

    Hello,
    I'm running into some issues when using SDO_INTERSECTION between two spatial tables. In my parcel table, I have polygons that will have a hole in them. When using SDO_INTERSECTION between the parcels and our land use layer to get area figures, I run into the Oracle error, "Unable to construct spatial object". I tracked it down to those parcels with holes that are causing the problem.
    Does anyone know how to avoid this problem or make SDO_INTERSECTION work for those polygons with holes? Thanks in advance.
    Juan Butler
    [email protected]

    I've looked at this some more and I don't think it's so much an issue with polygons with holes, but something with the way these two polygons are interacting.
    Here is the query that I'm using to test the validity of the resulting intersection.
    SELECT sdo_geom.validate_geometry_with_context(sdo_geom.sdo_intersection(b.GEOMETRY, a.geometry, .01),.01)
    FROM SP_PARCELBASE a, SP_FUTURE_LANDUSE b
    WHERE sdo_relate(b.geometry,a.geometry,'mask=ANYINTERACT') = 'TRUE'
    AND a.gid = 53887816
    Here are the geometries of the problem polygons...
    - FROM SP_PARCELBASE
    (2003, 82000, , (1, 1003, 1, 75, 2003, 1, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ), (252134.399999992, 1300154.70000085, 252218.899999986, 1299775.00000085, 252223.899999986, 1299769.00000084, 252382.099999989, 1299577.70000084, 252397.499999992, 1299571.20000085, 252473.599999991, 1299538.90000084, 252537.699999992, 1299511.80000084, 252626.999999992, 1299426.10000084, 252749.299999991, 1299308.70000085, 252751.799999986, 1299306.20000085, 252799.599999992, 1299230.90000084, 252885.699999993, 1299212.80000084, 252951.699999992, 1299159.70000084, 253031.69999999, 1299158.20000085, 253033.299999991, 1299317.70000084, 253033.299999991, 1299320.80000085, 253034.399999993, 1299427.20000084, 253036.49999999, 1299606.20000085, 253036.499999987, 1299608.20000084, 253243.49999999, 1299604.80000085, 253350.299999993, 1299602.90000085, 253375.299999991, 1299602.50000085, 253629.799999993, 1299598.00000085, 253630.19999999, 1299730.80000084, 253363.699999992, 1299735.60000084, 253366.299999994, 1300103.30000084, 253366.499999986, 1300127.70000085, 253553.699999991, 1300124.70000085, 253553.699999991, 1300128.60000085, 253553.699999992, 1300131.30000084, 253554.199999993, 1300233.50000084, 252393.899999991, 1300252.50000085, 252393.999999992, 1300267.70000085, 252394.199999993, 1300284.10000084, 252341.099999992, 1300225.90000084, 252288.599999986, 1300168.50000084, 252134.399999992, 1300154.70000085, 252987.099999988, 1299658.60000085, 252987.799999992, 1299766.80000085, 253193.49999999, 1299765.20000085, 253193.099999992, 1299716.30000085, 253195.699999988, 1299716.30000085, 253198.999999991, 1299715.60000085, 253201.699999991, 1299714.10000085, 253204.29999999, 1299712.10000085, 253205.999999992, 1299709.30000084, 253207.199999991, 1299706.30000085, 253207.599999993, 1299703.30000085, 253207.599999986, 1299699.70000084, 253207.499999992, 1299685.90000084))
    - FROM SP_FUTURE_LANDUSE
    (2003, 82000, , (1, 1003, 1, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ), (253631, 1300130, 253631.7, 1300247.4, 253554, 1300248.5, 253554.2, 1300233.5, 252393.9, 1300252.5, 252391.7, 1300150, 252134.4, 1300154.7, 252218.9, 1299775, 252223.9, 1299769, 252228.4, 1299778.4, 252266.6, 1299791.9, 252273.6, 1299778.6, 252290.4, 1299768.6, 252306.4, 1299759, 252328.9, 1299736.1, 252359.8, 1299699.7, 252366.8, 1299706.3, 252367.9, 1299694.5, 252364.9, 1299688.1, 252374.7, 1299665.7, 252393.6, 1299638.8, 252402, 1299626.8, 252453.5, 1299621.3, 252476.1, 1299606.3, 252535.9, 1299596.2, 252558.5, 1299620.8, 252598.5, 1299624.4, 252654.3, 1299626.3, 252701.3, 1299630.2, 252717.7, 1299632.2, 252723.6, 1299641.1, 252733.1, 1299642.3, 252749.6, 1299652.9, 252755, 1299644, 252760.9, 1299631.9, 252775.4, 1299638.8, 252790.4, 1299636.3, 252805.9, 1299613.6, 252813.7, 1299566.8, 252815.9, 1299554, 252817.2, 1299515.8, 252726.2, 1299501, 252707.1, 1299503.5, 252680.4, 1299504.1, 252656.6, 1299510.6, 252612.3, 1299513.9, 252565.3, 1299516.7, 252541.4, 1299521.2, 252509.6, 1299540.1, 252479.8, 1299542.1))

  • Sdo_util.polygontoline on polygon with hole - multi line?

    If I run sdo_util.polygontoline on a polygon with hole I would expect it to return a multi line with gtype=2006.
    Is that right?
    It doesn't in this case:
    jot_test@johnot> SELECT * FROM v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    5 rows selected.
    jot_test@johnot>
    jot_test@johnot> CREATE TABLE polygon_test (
      2  what varchar2(100),
      3  geometry sdo_geometry);
    Table created.
    jot_test@johnot>
    jot_test@johnot> INSERT INTO polygon_test (what, geometry) VALUES ('polygon with 3 holes',
      2  MDSYS.SDO_GEOMETRY(2003, 2157, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,41,2003,1,51,2003,1,61,2003,1), MDSYS.SDO_ORDINATE_ARRAY(644507.868,753517.124,
      3  644631.7897, 753533.6922, 644611.409, 753534.591, 644610.6025, 753545.5654, 644533.3319, 753588.8677, 644508.545, 753574.04, 644489.2124, 753613.5921,
      4  644454.5051, 753632.781, 644448.097, 753629.818, 644443.393, 753638.8542, 644410.0624, 753657.0707, 644396.379, 753651.217, 644392.824, 753655.998,
      5  644403.559, 753660.6251, 644390.1554, 753667.9506, 644385.891, 753666.108, 644363.783, 753682.497, 644430.984, 753599.479, 644490.526, 753515.738,
      6  644507.868, 753517.124, 644422.11, 753642.465, 644407.545, 753636.233, 644403.653, 753641.432, 644422.426, 753649.114, 644422.11, 753642.465,
      7  644417.5533, 753621.438, 644432.735, 753628.312, 644435.627, 753622.475, 644420.7838, 753615.5539, 644417.5533, 753621.438, 644453.003, 753576.579,
      8  644436.343, 753599.448, 644471.478, 753620.606, 644518.412, 753525.872, 644493.611, 753520.131, 644453.003, 753576.579)));
    1 row created.
    jot_test@johnot>
    jot_test@johnot> SELECT sdo_geom.validate_geometry_with_context(geometry, 0.0005) FROM polygon_test;
    SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(GEOMETRY,0.0005)
    TRUE
    1 row selected.
    jot_test@johnot>
    jot_test@johnot> SELECT sdo_util.polygontoline(geometry) FROM polygon_test;
    SDO_UTIL.POLYGONTOLINE(GEOMETRY)(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    SDO_GEOMETRY(2002, 2157, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1, 41, 2, 1, 51, 2, 1, 61, 2, 1), SDO_ORDINATE_ARRAY(644507.868, 753517.124, 644631.79, 753533.692,
    644611.409, 753534.591, 644610.603, 753545.565, 644533.332, 753588.868, 644508.545, 753574.04, 644489.212, 753613.592, 644454.505, 753632.781, 644448.097, 753629.818,
    644443.393, 753638.854, 644410.062, 753657.071, 644396.379, 753651.217, 644392.824, 753655.998, 644403.559, 753660.625, 644390.155, 753667.951, 644385.891, 753666.108,
    644363.783, 753682.497, 644430.984, 753599.479, 644490.526, 753515.738, 644507.868, 753517.124, 644422.11, 753642.465, 644407.545, 753636.233, 644403.653, 753641.432,
    644422.426, 753649.114, 644422.11, 753642.465, 644417.553, 753621.438, 644432.735, 753628.312, 644435.627, 753622.475, 644420.784, 753615.554, 644417.553, 753621.438,
    644453.003, 753576.579, 644436.343, 753599.448, 644471.478, 753620.606, 644518.412, 753525.872, 644493.611, 753520.131, 644453.003, 753576.579))
    1 row selected.I was expecting that to return gtype=2006 and I think that's causing me some problems which I now need to investigate further.
    If someone can confirm that it should be returning gtype=2006 then I'll get open a tar on metalink.
    Thanks,
    John

    sdo_aggr_union seems to know to make it a multiline...
    jot_test@johnot> SELECT sdo_aggr_union(sdoaggrtype(sdo_util.polygontoline(geometry),0.0005)) FROM polygon_test;
    SDO_AGGR_UNION(SDOAGGRTYPE(SDO_UTIL.POLYGONTOLINE(GEOMETRY),0.0005))(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    SDO_GEOMETRY(2006, 2157, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1, 41, 2, 1, 53, 2, 1, 63, 2, 1), SDO_ORDINATE_ARRAY(644631.79, 753533.692, 644507.868, 753517.124,
    644490.526,753515.738, 644430.984, 753599.479, 644363.783, 753682.497, 644385.891, 753666.108, 644390.155, 753667.951, 644403.559, 753660.625, 644392.824, 753655.998,
    644396.379, 753651.217, 644410.062, 753657.071, 644443.393, 753638.854, 644448.097, 753629.818, 644454.505, 753632.781, 644489.212, 753613.592, 644508.545, 753574.04,
    644533.332, 753588.868, 644610.603, 753545.565, 644611.409, 753534.591, 644631.79, 753533.692, 644518.412, 753525.872, 644471.478, 753620.606, 644436.343, 753599.448,
    644453.003, 753576.579, 644493.611, 753520.131, 644518.412, 753525.872, 644435.627, 753622.475, 644420.784, 753615.554, 644417.553, 753621.438, 644432.735, 753628.312,
    644435.627, 753622.475, 644422.426, 753649.114, 644403.653, 753641.432, 644407.545, 753636.233, 644422.11, 753642.465, 644422.426, 753649.114))

  • Problem with SDO_relate when using polygons with holes.

    I'm having a problem with sdo_relate. I'm trying to extract all elements from a point table (bdtq_batim_p) that are inside a specific polygon from another table (SDA_MUNIC_SS). The spatial index for both table have been rebuilt and the data from both table is valid.
    When I do a count on the query, I know the answer should be 1422 elements (Counted in ArcGIS). However, sdo_relate gives a smaller number of elements in the result set.
    The query :
    SELECT count(distinct t.identifiant) FROM bdtq_batim_p t, SDA_MUNIC_SS s WHERE s.mus_co_geo = '48015' and sdo_relate( t.SHAPE,s.SHAPE,'mask=anyinteract querytype=window') = 'TRUE'
    returns 282 elements. The query with mask=inside, SDO_Anyinteract() and SDO_inside() all give the same result.
    I did a test with the following query and the result is 1422 (which is the good result).
    SELECT count(distinct t.identifiant) FROM bdtq_batim_p t, SDA_MUNIC_SS s WHERE s.mus_co_geo = '48015' and SDO_WITHIN_DISTANCE( t.SHAPE,s.SHAPE,'distance=0') = 'TRUE';
    It's important to note that the polygone (from SDA_MUNIC_SS) that is used for this query have holes in it. I have the same problem with all the polygons from the SDA_MUNIC_SS table that have holes in it. For the polygon without holes, the results are the same for the 2 queries.
    My question are :
    Why are the result from the two queries different? A query with a buffer of 0 should always return the same result as a query with Anyinteract.
    Is there a known problem with SDO_RELATE when using a polygon with holes in it?
    Do you have any idea how to solve my problem.

    Since i don't have much control on the version of Oracle and Patches that we use in the system, we used a workaround that detects the polygons with holes and uses the SDO_WITHIN_DISTANCE( t.SHAPE,s.SHAPE,'distance=0') = 'TRUE' operator in those case. We saw a slight decline in performance but it now returns the right results. When the system will be patched, we'll come back to the original version and see if the problem is solved.

  • Polygons with float precision?

    Is it possible to use polygons with arrays of floats? I've looked up the source code and it seems that the code is all based around the use of ints.
    How would I go about making a polygon use floats so that it can move smoothly around the screen? I've got it moving using ints, but this causes horrible jerky-like movement.
    Thanks
    Ribot.

    g2d.drawOval(circleX, 400, 25, 25);
    circleX++;That should move it by 1 pixel on the x axis each time through the loop, unless you have other code that is changing the value (perhaps you could add System.out.println("CircleX = " + circleX) statements before your drawOval statement...
    in the same animation loop I feature the following
    code which moves the graphics2D object by fractional
    amounts across the screen (this is the effect I want
    to get with a polygon based shape):It only moves on screen when the value of the integer part of the fraction changes (your monitor would be unable to move it by a fraction of a pixel). Why not use double values and cast them to ints if you want to replicate this?
    >
    circle.setFrame(550.5+(tickerTest*0.1), 300.5, 50,
    60);
    Area test = new Area(circle);
    g2d.setColor(Color.magenta);
    g2d.fill(test);
    tickerTest++;
    Is there a Graphics2D polygon type object? I've
    looked in the API and haven't found anything. how about g2d.drawPolygon()
    I have done this without double buffering and it works perfectly... a 20ms delay and there isn't any flicker (P3 600MHz, JDK 1.2.2), so I really don't understand unless you have some massive processing running concurrently... javax.swing.JFrame frame = new javax.swing.JFrame();
    frame.setSize(200,200);
    frame.show();
    java.awt.Graphics2D g2d = (java.awt.Graphics2D)frame.getGraphics();
    int x = 50;
    int y = 50;
    int dx = 1;
    int dy = 2;
    int width = 20;
    int height = 20;
    for(int i = 0; i < 1000; i++) {
         g2d.clearRect(0, 0, 200, 200);
         g2d.drawOval(x, y, width, height);
         x += dx;
         y += dy;
         if(x < 0 || x > 180) dx *= -1;
         if(y < 20 || y > 180) dy *= -1;
         Thread.sleep(20);

  • Validate geometry can't check polygon with puncture?

    Hi,
    I have polygon with puncture as follow:
    POLYGON ((100.378750779898 -0.310282546668259, 100.378772459506 -0.310271543916926, 100.378838852504 -0.310235840196097, 100.378845732154 -0.310224416657996, 100.378844002915 -0.31020930373441, 100.37871739762 -0.309977750136478, 100.378616547328 -0.310045414011517, 100.378548060368 -0.309924611880424, 100.378750779898 -0.310282546668259))
    According to OGC simple feature it is invalid geometry because it has a puncture. ArcGIS SDE can't render this geoemetry. However, sdo_geometry.validate_geoemetry says it is a valid geometry. Why sdo doesn't consider this as an invalid geoemrty?

    Hi,
    It'd be useful if you provided a bit more information with your post:
    - your name (user3907494 ?)
    - the version of Oracle
    - the tolerance that you validated at
    Note that the geometry doesn't actually seem to be self intersecting - there seems to be an 8mm gap at the point where you might think it self intersects.
    I validated the geometry on 10.2.0.5 and 11.2.0.2 and got different results.
    Invalid on 10.2.0.5:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE    10.2.0.5.0      Production
    TNS for 64-bit Windows: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production
    5 rows selected.
    SQL> select sdo_geom.validate_geometry_with_context(
      2    sdo_geometry(2003, 8307, null, sdo_elem_info_array(1,1003,1),
      3    sdo_ordinate_array(
      4    100.378750779898, -0.310282546668259,
      5    100.378772459506, -0.310271543916926,
      6    100.378838852504, -0.310235840196097,
      7    100.378845732154, -0.310224416657996,
      8    100.378844002915, -0.31020930373441,
      9    100.37871739762, -0.309977750136478,
    10    100.378616547328, -0.310045414011517,
    11    100.378548060368, -0.309924611880424,
    12    100.378750779898, -0.310282546668259
    13    )), 0.00005) as result
    14  from dual;
    RESULT
    13349 [Element <1>] [Ring <1>][Edge <8>][Edge <6>]Valid on 11.2.0.2
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    5 rows selected.
    SQL> select sdo_geom.validate_geometry_with_context(
      2    sdo_geometry(2003, 8307, null, sdo_elem_info_array(1,1003,1),
      3    sdo_ordinate_array(
      4    100.378750779898, -0.310282546668259,
      5    100.378772459506, -0.310271543916926,
      6    100.378838852504, -0.310235840196097,
      7    100.378845732154, -0.310224416657996,
      8    100.378844002915, -0.31020930373441,
      9    100.37871739762, -0.309977750136478,
    10    100.378616547328, -0.310045414011517,
    11    100.378548060368, -0.309924611880424,
    12    100.378750779898, -0.310282546668259
    13    )), 0.00005) as result
    14  from dual;
    RESULT
    TRUEI'm not too sure why this happens. Maybe someone else can comment?
    Regards,
    John

  • Extrude 3D polygons with multiple rings in Oracle spatial

    In this thread Extrude 3D polygons in Oracle spatial Baris provided a sample script to extrude a polygon with one ring into a 3D solid.
    How do I extrude a polygon with multiple rings?
    Given this polygon
    ! http://public.johnnyotoole.fastmail.fm/Polygon_with_hole.jpg !
    , I tried to create a solid as follows:
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for 32-bit Windows: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    5 rows selected.
    SQL> DECLARE
      2    l_base_geom      SDO_GEOMETRY;
      3    l_solid  SDO_GEOMETRY;
      4   BEGIN
      5
      6    l_base_geom :=
      7     SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1, 21, 2003, 1),
      8     SDO_ORDINATE_ARRAY(568758.064, 835364.907, 568735.12, 835362.873, 568735.897, 835354.404, 568737.264, 835334.554,
      9     568738.711, 835317.612, 568758.063, 835319.294, 568790.598, 835322.124, 568787.473, 835358.924, 568786.671, 835367.888,
    10     568758.064, 835364.907, 568758.063, 835354.97, 568758.811, 835355.046, 568759.253, 835349.107, 568764.952, 835349.529,
    11     568764.51, 835355.468, 568778.388, 835356.625, 568778.627, 835353.883, 568778.681, 835353.252, 568778.757, 835352.388,
    12     568780.648, 835330.63, 568758.063, 835328.714, 568747.322, 835327.804, 568744.841, 835353.627, 568758.063, 835354.97));
    13
    14     DBMS_OUTPUT.PUT_LINE('Valid? ' || SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(l_base_geom, 0.005));
    15
    16     l_solid :=
    17     SDO_UTIL.EXTRUDE(
    18             l_base_geom,
    19             SDO_NUMBER_ARRAY(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
    20             SDO_NUMBER_ARRAY(5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5),
    21             'FALSE',
    22             0.005);
    23
    24  DBMS_OUTPUT.PUT_LINE('Volume: ' || sdo_geom.sdo_volume(l_solid,0.005));
    25
    26  END;
    27  /
    Valid? TRUE
    DECLARE
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.ArrayIndexOutOfBoundsException
    ORA-06512: at "MDSYS.SDO_UTIL", line 241
    ORA-06512: at line 16Any ideas?

    Would you please have only 10 elements in your sdo_number_arrays in your case?Is this what you mean?
    SQL> DECLARE
      2    l_base_geom      SDO_GEOMETRY;
      3    l_solid  SDO_GEOMETRY;
      4   BEGIN
      5
      6    l_base_geom :=
      7     SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1, 21, 2003, 1),
      8     SDO_ORDINATE_ARRAY(568758.064, 835364.907, 568735.12, 835362.873, 568735.897, 835354.404, 568737.264, 835334.554,
      9     568738.711, 835317.612, 568758.063, 835319.294, 568790.598, 835322.124, 568787.473, 835358.924, 568786.671, 835367.888,
    10     568758.064, 835364.907, 568758.063, 835354.97, 568758.811, 835355.046, 568759.253, 835349.107, 568764.952, 835349.529,
    11     568764.51, 835355.468, 568778.388, 835356.625, 568778.627, 835353.883, 568778.681, 835353.252, 568778.757, 835352.388,
    12     568780.648, 835330.63, 568758.063, 835328.714, 568747.322, 835327.804, 568744.841, 835353.627, 568758.063, 835354.97));
    13
    14     DBMS_OUTPUT.PUT_LINE('Valid? ' || SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(l_base_geom, 0.005));
    15
    16     l_solid :=
    17     SDO_UTIL.EXTRUDE(
    18             l_base_geom,
    19             SDO_NUMBER_ARRAY(0,0,0,0,0,0,0,0,0,0),
    20             SDO_NUMBER_ARRAY(5,5,5,5,5,5,5,5,5,5),
    21             'FALSE',
    22             0.005);
    23
    24  DBMS_OUTPUT.PUT_LINE('Volume: ' || sdo_geom.sdo_volume(l_solid,0.005));
    25
    26  END;
    27  /
    Valid? TRUE
    DECLARE
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.Exception: 54550
    ORA-06512: at "MDSYS.SDO_UTIL", line 241
    ORA-06512: at line 16
    If the heights and ground heights are all the same in your sdo_number_arrays (as in this case), then you can just specify one number in each array instead of specifying a height/ground height for each vertex.Ok, I see what you mean. This works when I use just the outer ring.
    SQL> DECLARE
      2    l_base_geom      SDO_GEOMETRY;
      3    l_solid  SDO_GEOMETRY;
      4   BEGIN
      5
      6    l_base_geom :=
      7     SDO_UTIL.EXTRACT(
      8     SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1, 21, 2003, 1),
      9        SDO_ORDINATE_ARRAY(568758.064, 835364.907, 568735.12, 835362.873, 568735.897, 835354.404, 568737.264, 835334.554,
    10        568738.711, 835317.612, 568758.063, 835319.294, 568790.598, 835322.124, 568787.473, 835358.924, 568786.671, 835367.888,
    11        568758.064, 835364.907, 568758.063, 835354.97, 568758.811, 835355.046, 568759.253, 835349.107, 568764.952, 835349.529,
    12        568764.51, 835355.468, 568778.388, 835356.625, 568778.627, 835353.883, 568778.681, 835353.252, 568778.757, 835352.388,
    13        568780.648, 835330.63, 568758.063, 835328.714, 568747.322, 835327.804, 568744.841, 835353.627, 568758.063, 835354.97)),
    14     1,1);
    15
    16     DBMS_OUTPUT.PUT_LINE('Valid? ' || SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(l_base_geom, 0.005));
    17
    18     l_solid :=
    19     SDO_UTIL.EXTRUDE(
    20             l_base_geom,
    21             SDO_NUMBER_ARRAY(0),
    22             SDO_NUMBER_ARRAY(5),
    23             'FALSE',
    24             0.005);
    25
    26  DBMS_OUTPUT.PUT_LINE('Volume: ' || sdo_geom.sdo_volume(l_solid,0.005));
    27
    28  END;
    29  /
    Valid? TRUE
    Volume: 11839.18887702For the purposes of what I'm doing now, I think I'll just use the outer ring to create my solids, but it would be useful if SDO_UTIL.EXTRUDE works on polygons with multiple rings (maybe it does, I'm probably doing something wrong...).

  • How i can calculate area of polygon with java ??

    hello
    i've trouble with calculation polygon-area
    is there any body who is good at calculation of shapes?
    i explain my problem with pictures.
    on piture2, i can calculate red-area of polygon with reference "http://www.cs.princeton.edu/introcs/33modular/Polygon.java.html"
    but, i can't do it on picture1.
    please help me and understand that i'm poor at english
    picture 1.
    http://myhome.naver.net/imsangchin/trace1.jpg
    picture 2.
    http://myhome.naver.net/imsangchin/trace2.jpg

    Do you have a formula that generates picture 1?
    If so, then you can use the basic formula for integration... take very very small steps and sum up all the steps, you can get as close as you like by making the steps sufficiently small.
    If you don't have a formula to generate the picture, then you can do it by essentially counting the number of colored pixels in the shape and calling them any type of appropriate units or actually scaling converting them to inches or cm or what ever you are using. You can do this by just scanning across the image and counting how many pixes are on each line, then go to the next line. Do this for the entire image only counting the target color and then do your conversion.

  • When I create a new polygon with applescript in in design cs4, I want to make a drop shadow

    when I create a new polygon with applescript in in design cs4, I want to make a drop shadow
    Is it possible?
    I am working with MAC OS 10.6.7 and CS4
    Can somebody help me?

    Adding a drop shadow should work fine regardless of shape… As Im a big fan of using styles everywhere I can…
    tell application "Adobe InDesign CS5"
    activate
    tell the active document
    set GotNoStyle to make new object style
    set properties of drop shadow settings of fill transparency settings of GotNoStyle to ¬
    {mode:drop, distance:3, angle:135, spread:0, blend mode:multiply, opacity:50, honor other effects:true, x offset:3, y offset:3, knocked out:true, use global light:false}
    set SomeFill to the last swatch
    tell the first page
    make new rectangle with properties ¬
    {fill color:SomeFill, geometric bounds:{10, 10, 30, 30}}
    apply object style (the result) using GotNoStyle without clearing overrides
    make new oval with properties ¬
    {fill color:SomeFill, geometric bounds:{10, 40, 30, 70}}
    apply object style (the result) using GotNoStyle without clearing overrides
    end tell
    end tell
    end tell
    You can then edit the object style to make global changes… Sorry my values were for my euro metric head…

  • Compound polygon with SdoApi 8.1.6

    With SdoApi version 8.1.6, can I create a 'compound polygon'
    (polygon compound of arcs and lines)? is the same a 'curve' and
    'arc'?

    Yes i t is possible, this is how i do it.
    Note : curveStrings is a Vector of CurveStrings that i
    have built earlier and can contain arcs
    // we are building a polygon feature
    if(curveStrings.size() > 1){
    // polygon has more than one segment need to be a bit more
    tricky
    Segment segments[] = new Segment[curveStrings.size()];
    for(int i = 0; i < curveStrings.size(); i++){
    CurveString temp_cs = (CurveString) curveStrings.get(i);
    segments[i] = temp_cs.getSegmentAt(0);
    // build the holes for this multi-segment polygon
    CurveString holes[] = null;
    if(holeList.size() > 0){
    // polygon contains holes
    inHole = true;
    holes = new CurveString[holeList.size()];
    for(int i = 0; i < holeList.size(); i++){
    holes[i] = (CurveString) holeList.get(i);
    } else {
    // polygon does not contain holes
    inHole = false;
    CurveString cs = null;
    try {
    cs = mGeometryFactory.createCurveString(segments);
    } catch (InvalidGeometryException e){
    e.printStackTrace();
    logMsg("Failed to create hole geometry");
    return null;
    CurvePolygon cp = null;
    if(!inHole){
    try {
    cp = mGeometryFactory.createCurvePolygon(cs,null);
    } catch ( InvalidGeometryException e){
    e.printStackTrace();
    logMsg("Failed to create polygon");
    return null;
    } else {
    try {
    cp = mGeometryFactory.createCurvePolygon(cs,holes);
    } catch ( InvalidGeometryException e){
    e.printStackTrace();
    logMsg("Failed to create polygon");
    return null;
    geom = cp;
    return geom;
    Hope it helps
    James

  • How to create a polygon with the Lat/Long Coordinates

    I have set of Lat/Long coordinates and I need to create a polygon geofence. Can any of you know how to do this please share your thoughts with me
    I have the following coordinates
    -84.3087, 39.3465; -84.3118904, 39.3306296; -84.3265158, 39.3372422; -84.2866, 39.3371; -84.2958, 39.3284; -84.2888, 39.3241
    Thanks

    Assuming these are long/lat values, the polygon can be defined as:
    sdo_geometry(2003, 8307, null, sdo_elem_info_array(1, 1003, 1),
    sdo_ordinate_array(-84.3087, 39.3465, -84.3118904, 39.3306296, -84.3265158, 39.3372422, -84.2866, 39.3371,
    -84.2958, 39.3284, -84.2888, 39.3241, -84.3087, 39.3465))
    siva

  • Sdo_util.to_gmlgeometry on an optimized rectangle with a hole

    11.2.0.2 on Linux
    This is a bit of an obscure one - I've worked around it, but thought I'd put it up here anyway...
    I've got a polygon geometry that is an optimized rectangle outer ring with an optimized rectangle inner ring - I know, very odd and not really a good idea, but it does pass validation:
    SQL> select sdo_geom.validate_geometry_with_context(
      2    sdo_geometry(2003, null, null, sdo_elem_info_array(1, 1003, 3, 5, 2003, 3), sdo_ordinate_array(0, 0, 10, 10, 0.5, 0.5, 9.5, 9.5)),
      3    0.005) as valid
      4  from dual;
    VALID
    TRUE
    sdo_util.to_gmlgeometry produces a sensible result:
    SQL> select sdo_util.to_gmlgeometry(
      2    sdo_geometry(2003, null, null, sdo_elem_info_array(1, 1003, 3, 5, 2003, 3), sdo_ordinate_array(0, 0, 10, 10, 0.5, 0.5, 9.5, 9.5))) as gml
      3  from dual;
    GML
    <gml:Polygon srsName="SDO:" xmlns:gml="http://www.opengis.net/gml">
      <gml:outerBoundaryIs>
      <gml:LinearRing>
      <gml:coordinates decimal="." cs="," ts=" ">0.0,0.0 10.0,0.0 10.0,10.0 0.0,10.0 0.0,0.0 </gml:coordinates>
      </gml:LinearRing>
      </gml:outerBoundaryIs>
      <gml:innerBoundaryIs>
      <gml:LinearRing>
      <gml:coordinates decimal="." cs="," ts=" ">0.5,0.5 0.5,9.5 9.5,9.5 9.5,0.5 0.5,0.5 </gml:coordinates>
      </gml:LinearRing>
      </gml:innerBoundaryIs>
    </gml:Polygon>
    But sdo_util.to_wktgeometry makes a dogs dinner of it:
    SQL> select sdo_util.to_wktgeometry(
      2    sdo_geometry(2003, null, null, sdo_elem_info_array(1, 1003, 3, 5, 2003, 3), sdo_ordinate_array(0, 0, 10, 10, 0.5, 0.5, 9.5, 9.5))) as wkt
      3  from dual;
    WKT
    POLYGON ((0.0 0.0, 10.0 0.0, 10.0 10.0, 0.0 10.0, 0.0 0.0))
    Looks like a bug in sdo_util.to_wktgeometry?
    We'll get around it by writing these geometries out in the long format, but I'd expect sdo_util.to_wktgeometry to handle it nonetheless.
    John

    Same on 12.1.1.0 too.
    PDB1@ORCL> select banner from v$version;
    BANNER
    Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
    PL/SQL Release 12.1.0.1.0 - Production
    CORE 12.1.0.1.0 Production
    TNS for Linux: Version 12.1.0.1.0 - Production
    NLSRTL Version 12.1.0.1.0 - Production
    PDB1@ORCL> select sdo_util.to_wktgeometry(
      sdo_geometry(2003, null, null, sdo_elem_info_array(1, 1003, 3, 5, 2003, 3),
      sdo_ordinate_array(0, 0, 10, 10, 0.5, 0.5, 9.5, 9.5))) as wkt
    from dual;  2    3    4 
    WKT
    POLYGON ((0.0 0.0, 10.0 0.0, 10.0 10.0, 0.0 10.0, 0.0 0.0))

  • How to create a shape/mask with a hole in it?

    In graphics illustration applications, it's common to support boolean operations on shapes and paths, like subtracting one object from another resulting in a compound path (like a group of sub-paths).  This provides the ability to create shapes with "holes" in them where background content can show through.  Is it possible to do this with two (or more) shapes (or masks) in Motion 5?  For example, if I draw a rectangle shape and a smaller circle shape inset within the rectangle, to have the circle as a "hole" in the rectangle so that as the rectangle passes in front of other objects they show through the hole?  If the answer is yes this can be done, can you please descibe how?  Thanks!

    It's possible to create a lot of sophisticated masking effects in Motion and there are two different ways that can be used in combination or separately (depending on the type of object being masked -- some objects won't allow shape masks, but almost all objects allow Image Masks.)
    To set up what's going on below: the bottom layer is a Clouds generator. On top of it is a Spirals generator.
    The region in the center where the '8' figure is starts as a rectangle to which 4 circle shape masks are added. The Shape Mask tool is in the one to the right of the Text ( 'T' icon) tool in the toolbar at the bottom of the Motion window. When an "eligible" layer is selected in the Layers List its options will be selectable, otherwise it will stay dimmed.
    The first two circle masks added to the Rectangle are arranged one above the other (visually) and their Mask Blend Mode is set to Intersect and the Invert Mask options are checked for both. Two more circle masks are drawn for the same rectangle shape and placed to form the "holes" for the figure 8. Their Mask Blend Modes are set for Add.
    The region of the Spirals that form the outer border is another Rectangle Shape drawn to form the bounds. To that Rectangle I added an Image Mask (right click on the Layer and select Add Image Mask.) To the Image Mask sub-layer I dragged the original rectangle containing the 4 circle masks.
    Finally to the Spirals generator layer I added an Image Mask and dragged the second rectangle on the that sublayer.
    When objects are added to an Image Mask, Motion will automatically turn off those layers from being visible in the canvas.
    When working with masks, especially several levels of masking, sometimes you have to think in opposites. For instance, originally, the inner rectangle is solid and the figure 8 is the cutout. When added to the second rectangle, the "state" is reversed. Where you see the spiral are the solid portions of the final composite mask. If you select the Invert Mask option of the Spirals Image Mask, the entire thing "flips" (and the spirals would replace the clouds and vice versa).
    Shape Masks have four available Blend Modes (Add, Subract, Replace and Intersect). Shape Masks are "all or nothing" cutouts (with exception of feathering).
    Image Masks use Alpha, Individual Color channels (R,G, or B) or Luma to determine transparency. Image Masks can also use bezier shapes as sources, making almost the same as Shape Masks in this respect, except that Fill Opacity can be used to vary opacity within masked areas.
    HTH

  • A Flex component with transparent holes inside

    Hi there,
    Does anyone have any idea on how could I achieve something like this: I need to create a component that should be blur and semi-transparent with one or more rectangular transparent holes inside.
    Is it possible through the graphics API to cut holes in components?
    Thanks!

    Whereever there are no drawn pixels, you will have a hole.  Play around with the .mask property.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Error creating a simple polygon with lat/lon

    Hello,
    When I validate the result of the following code used to insert a polygon, I get oracle error 13050 - Contact Oracle. If I change the order of the points, I get error 13349 - Polygon crosses itself, so I feel I have the points in the correct order. Any ideas why this polygon won't validate to true?
    insert into tblname values(
    (mdsys.sdo_geometry(2003,null,null,
    mdsys.sdo_elem_info_array(1,1003,1),
    mdsys.sdo_ordinate_array
    (-89.228298,42.916663,
    -89.344087,43.247025,
    -89.016191,43.33739,
    -88.912663,43.079601,
    -89.02033,43.008463,
    -89.228298,42.916663))
    ), field 2, 'field3')
    Thanks for any thoughts,
    David

    Bruce,
    I was attempting solve a business/spatial problem the wrong way, based on limited experinece with Oracle spatial.
    I need to create a convex hull polygon from a splatering of points. (for sake of arguement, lets say the points are salesmans locations and there will be approx 2,000 salesmans locations. I need to create a convex hull of these 2000 points).
    My initial thought was to use the points as input to making a polygon. I was then going to use this polygon as input to making the convex hull. In order to make a valid polygon to feed into the generation of the convex hull, the points have to be in such an order so there are no crossing lines and the polygon closes itself, when creating a polygon.
    I have since been given the suggestion of using my ponits as input to making a linestring geometry, and then using this linestring geometry as input to creating a convex hull.
    Hope this explains my thought process. Thanks for your input.
    David
    null

Maybe you are looking for

  • Call Javascript function to pass a id  from APEX report column link

    Hi, Can anyone help me, in a report column link i'm calling a function to pass an id and i want to onclick change a icon on that column based on the value on the column status of this table. Is this possible?

  • How to get keep one column as a key and the other columns as a array list

    Hello, I am really new to Java...I am trying to read a text file containing different columns separated by comma and then create a hash map for the first column (key) and then rest as a array list for the key.I am not able to create the hash map and

  • Applying materials to loaded objects

    Hi, I'm trying to develop a program whereby users can change the colour of an object. The object is loaded from a 3ds file. Colour accuracy is important, so I was wondering if anyone had experience with altering the properties of a loaded objects mat

  • Error ....designer 6i 4.2 on XP, 9i.....

    OS is windows XP, installed by DB9i. after i download designer6i 4.2 version.. As soon as i doubleclick setup.exe, there is this error message. "orainst.exe?! 9.A&0! @V>n<- GA7N1W7%@; A>7aGX>_ GU4O4Y. :RFm@; 3"CD5e7A<- AK<[GU4O4Y." it means that "you

  • Why doesn't Artwork tab always appear?

    The 6th tab "ARTWORK" doesn't appear for obscure albums. This is frustrating, since I enjoy finding images to put there. A large part of my enjoyment with itunes is watching the artwork in Cover Flow View. I hate to look at the blank black covers whe