Value of oriented point geometry into SDO_ETYPE
Hello! I have this problem:
I tried to insert an oriented point geometry.
This coordinates (x,y,z) identifies the point (A ) that I want to place.
580117.84, 4998489.37, 0
This coordinates (x,y,z) identifies the coordinates of the end point (B) where is orientated the vector
580121.56, 4998490.93, 0
I have read the instruction http://download.oracle.com/docs/html/B14255_01/sdo_objrelschema.htm#CBBIAGFJ
and I have create this query
INSERT INTO TABLE_A
VALUES
SDO_GEOMETRY(3001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1, 4, 1, 0),
SDO_ORDINATE_ARRAY(580082.54, 4998456.45, 0, 580080.6, 4998496.5, 0))
SDO_ORDINATE_ARRAY(580117.84, 4998489.37 , 0, 3.72, 1.56 , 0 )),
If I make a select row of TABLE_A right for to see SDO_GEOMETRY I find:
GEOMETRY1(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
SDO_GEOMETRY(3001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1, 4, 1, 0),
SDO_ORDINATE_ARRAY(580117,84, 4998489,37, 0, 3,72, 1,56, 0))
I work with Geomedia intergraph and if I rotate or spin the symbol at the point and then I do again the same select
the result is:
GEOMETRY1(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
SDO_GEOMETRY(3001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORD
INATE_ARRAY(,598974545, -,80076807, 0, 580117,84, 4998489,37, 0))
I don't understand what mean the number of SDO_ETYPE inside SDO_ELEM_INFO_ARRAY.
also in SDO_ORDINATE_ARRAY this value identifies the orientation
,598974545, -,80076807, 0
but I can't realize from where this numbers come out.
Somebody can explain to me?
Thanks in advance.
Angelo!
Excuse!
I make a mistake the query is
INSERT INTO TABLE_A
VALUES
SDO_GEOMETRY(3001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1, 4, 1, 0),
SDO_ORDINATE_ARRAY(580117.84, 4998489.37 , 0, 3.72, 1.56 , 0 )),
and not
//INSERT INTO TABLE_A
// VALUES
// SDO_GEOMETRY(3001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1, 4, 1, 0),
// SDO_ORDINATE_ARRAY(580082.54, 4998456.45, 0, 580080.6, 4998496.5, 0))
// SDO_ORDINATE_ARRAY(580117.84, 4998489.37 , 0, 3.72, 1.56 , 0 )),
I wait your news.
Similar Messages
-
FOI marker trimmed when using oriented point geometry
Greetings,
I am trying to rotate a FOI polygon marker using oriented point geometry. While the angle of the marker (hollow arrow) is rendered properly in Oracle Maps, the size of the actual marker image shipped to the browser is always constant in size and does not account for the potential increase in image dimensions due to rotation. So, the image always is clipped at the corners, if rotation swings a portion of it outside the static image dimensions. The best way to replicate this behavior is by using a simple square marker on any rotated point geometry: the corners of the square get clipped.
I appreciate any advice on how to solve or work around this.
Regards,
-SimonJoao,
Thanks for your reply. I found that all types of markers, including images and TTF symbols get clipped. The only way that seems to work buffering an image marker symbol by empty pixels in order to provision space for its rotation.
Regards,
-Simon -
How to get all the values of the SDO_ORDINATE_ARRAY of a Oriented Point
Hi,
I'm trying to get the values of a Geometry wich is an Oriented Point. To that, i'm using SDO_UTIL.GETVERTICES, but this utility only obtains the point X,Y, it doesn't obtain the values of the orientation vector.
The Geometry is this:
MDSYS.SDO_GEOMETRY(
2001,8307,NULL,
MDSYS.SDO_ELEM_INFO_ARRAY(1,1,1,3,1,0),
MDSYS.SDO_ORDINATE_ARRAY(-75.586088632813272,6.1794352615514194,0.57278169530235967,-0.81970795380217887,0)
The query is this:
SELECT c.ipid, c.nombre, t.X, t.Y, t.Z, t.W
FROM Hidrantes c,
TABLE(SDO_UTIL.GETVERTICES(c.geometria)) t
where c.ipid = 4691117
ORDER BY c.ipid, t.id;
Result:
4691117 -75,5860886328133 6,17943526155142 (null) (null)
As you can see, it only obtains the X,Y values but not the values of the orientation vector, how can I get the values?.
Thanks in advanceTobonale,
Sql-Only approaches:
*[1] Return Oridinate Array*
Append .SDO_ORDINATES to your geometry object or column name:
SELECT MDSYS.SDO_GEOMETRY(
2001,8307,NULL,
MDSYS.SDO_ELEM_INFO_ARRAY(1,1,1,3,1,0),
MDSYS.SDO_ORDINATE_ARRAY(-75.586088632813272,6.1794352615514194,0.57278169530235967,-0.81970795380217887,0)
).SDO_ORDINATES
FROM dualResult:
SDO_ORDINATE_ARRAY(-75.586089, 6.17943526, .572781695, -.81970795, 0)*[2] Return Flattened Oradinate Array*
SELECT * FROM
TABLE (
MDSYS.SDO_GEOMETRY(
2001,8307,NULL,
MDSYS.SDO_ELEM_INFO_ARRAY(1,1,1,3,1,0),
MDSYS.SDO_ORDINATE_ARRAY(-75.586088632813272,6.1794352615514194,0.57278169530235967,-0.81970795380217887,0)).SDO_ORDINATES
)Result:
-75.586089
6.17943526
.572781695
-.81970795
0Regards,
Noel -
Creating a point geometry with coordinate transformation using JDBC
If I execute the following SQL statement using a tool such as TOAD then I get a correct value for the point in the oracle column.
INSERT INTO node (id, position) VALUES (53, SDO_CS.TRANSFORM(SDO_GEOMETRY(2001, 26910, SDO_POINT_TYPE(489535.0, 5457841.0, NULL), NULL, NULL), 4269))
Point geometry:
(2001, 4269, (-123.143865452971, 49.2732377100255, ), , )
If I execute the same statement using JDBC in a Statement or PreparedStatement the Point in the oracle column has 0,0 for the coordinates.
Point: geometry
(2001, 4269, (0, 0, ), , )
In both cases the SQL is exactly the same.
my JDBC code is
String insertSql = "INSERT INTO node (id, position) VALUES (" + id
+ ", SDO_CS.TRANSFORM(SDO_GEOMETRY(2001, " + geometrySrid
+ ", SDO_POINT_TYPE(" + coordinate2d.x + ", " + coordinate2d.y
+ ", NULL), NULL, NULL), " + srid + "))";
Statement insertStatement = connection.createStatement();
try {
insertStatement.execute(insertSql);
} finally {
JdbcUtils.closeStatement(insertStatement);
connection.commit();
Any ideas why this is happening?
I've tried to do the coordinate transformation in a separate call and pass in the STRUCT returned from that, using JGeometry to create a STRUCT for the value, using a WKT geometry and none of these approaches seem to workPaul,
I have seen this work using JGeometry and STRUCT objects with PreparedStatements. Here's some sample code that seems to work just fine:
ResultSet rs = null;
try {
PreparedStatement ps =
getConn().prepareStatement("select SDO_CS.TRANSFORM(?, ?) from dual");
/* constucts JGeometry objects using simple points (doubles) and SRID
* Per the Javadoc, JGeometry objects can be constructed using the same
* notation and signature as SDO_GEOMETRY objects -
* JGeometry(int gtype, int srid, double x, double y, double z, int[] elemInfo, double[] ordinates) */
JGeometry j_geom1 = new JGeometry(-122.4, 37.8, 8265);
int newSRID = 4269;
//convert JGeometry instances to DB STRUCT
STRUCT obj1 = JGeometry.store(j_geom1, getConn());
ps.setObject(1, obj1);
ps.setInt(2, newSRID);
rs = ps.executeQuery();
while (rs.next()) {
//System.out.println(rs.getString(1));
STRUCT st = (oracle.sql.STRUCT) rs.getObject(1);
JGeometry j_geom = JGeometry.load(st);
System.out.println(j_geom);
ps.close();
rs.close();
conn.close();
} catch (Exception e) {
System.err.print(e);
Hope this helps.
-Justin -
How to bridge (fill) gaps when converting a 2006 geometry into a 2002 geometry
Is it at all possible to bridge (fill) gaps when converting a 2006 geometry into a single 2002 geometry. I have a solution for the conversion from 2006 to 2002 provided by BHall but upon further investigation investigation of my dataset some of the multi line polygons have gaps which I need to fill and I am not sure how to go about this.
Here is a simple example of what I am trying to achieve
Before
SELECT (sdo_geometry(2006, 81989, NULL,
mdsys.sdo_elem_info_array(1,2,1,5,2,1,9,2,1,13,2,1),
mdsys.sdo_ordinate_array(16,0.999,16.998,-0.001,17.253,-0.001,18.003,0.999,18.003,0.999,19.001,0.999,19.001,0.999,19.999,-0.001)))
FROM dual
After
SELECT (sdo_geometry(2006, 81989,NULL,
mdsys.sdo_elem_info_array(1,2,1),
mdsys.sdo_ordinate_array(16,0.999,17.253,-0.001,18.003,0.999,19.001,0.999,19.999,-0.001))) FROM dual
Thanks in advanceOkay Roché,
You might need to break this problem down into smaller parts for the forum. All your examples show the gap being replaced by a single vertice - e.g. you want to "snap" the gap together. I'd suggest this is just complicating your question. Once the gap is filled (with a line) then you can run SDO_UTIL.REMOVE_DUPLICATE_VERTICES afterwards to remove the new line if its below your tolerance. I think that Bryan's code wrapped in remove duplicate vertices will solve your second scenario. But overall I think it would be helpful to focus just on the filling and leave the snapping for a follow-up question.
So back to scenario #1, below is some code I wrote a while back that might do what you want or at least get you started. Note that the input must be a multistring and the multistring cannot be "spaghetti". In other words each line in the multistring must be disjoint or at most touch other lines only at endpoints. The goal is to sift through the lines and create a single linestring using the smallest gaps. It's not subtle and will indeed produce bad geometries if the inputs are setup in an impossible manner. There are also some rare geodetic bugs with SDO_GEOM.RELATE that crop up. So you'll note I test both distance and relate in some places. That's intentional though kind of dumb.
Hopefully this helps. If you improve the code please shoot a copy back to me.
Cheers,
Paul
CREATE OR REPLACE PACKAGE dz_gap_fill
AUTHID CURRENT_USER
AS
FUNCTION linear_gap_filler(
p_input IN MDSYS.SDO_GEOMETRY
,p_tolerance IN NUMBER DEFAULT 0.05
) RETURN MDSYS.SDO_GEOMETRY;
END dz_gap_fill;
CREATE OR REPLACE PACKAGE BODY dz_gap_fill
AS
FUNCTION fast_point(
p_x IN NUMBER
,p_y IN NUMBER
,p_z IN NUMBER DEFAULT NULL
,p_m IN NUMBER DEFAULT NULL
,p_srid IN NUMBER DEFAULT 8265
) RETURN MDSYS.SDO_GEOMETRY
AS
BEGIN
-- Step 10
-- Check over incoming parameters
IF p_x IS NULL
OR p_y IS NULL
THEN
RAISE_APPLICATION_ERROR(-20001,'x and y cannot be NULL');
END IF;
-- Step 20
-- Do the simplest solution first
IF p_z IS NULL
AND p_m IS NULL
THEN
RETURN SDO_GEOMETRY(
2001
,p_srid
,SDO_POINT_TYPE(
p_x
,p_y
,NULL
,NULL
,NULL
END IF;
-- Step 30
-- Do the other wilder choices
IF p_z IS NULL
AND p_m IS NOT NULL
THEN
RETURN SDO_GEOMETRY(
3301
,p_srid
,SDO_POINT_TYPE(
p_x
,p_y
,p_m
,NULL
,NULL
ELSIF p_z IS NOT NULL
AND p_m IS NULL
THEN
RETURN SDO_GEOMETRY(
3001
,p_srid
,SDO_POINT_TYPE(
p_x
,p_y
,p_z
,NULL
,NULL
ELSIF p_z IS NOT NULL
AND p_m IS NOT NULL
THEN
RETURN SDO_GEOMETRY(
4401
,p_srid
,NULL
,SDO_ELEM_INFO_ARRAY(1,1,1)
,SDO_ORDINATE_ARRAY(p_x,p_y,p_z,p_m)
ELSE
RAISE_APPLICATION_ERROR(-20001,'ERR!');
END IF;
END fast_point;
FUNCTION get_start_point(
p_input IN MDSYS.SDO_GEOMETRY
) RETURN MDSYS.SDO_GEOMETRY
AS
int_dims PLS_INTEGER;
int_gtyp PLS_INTEGER;
int_lrs PLS_INTEGER;
BEGIN
-- Step 10
-- Check over incoming parameters
IF p_input IS NULL
THEN
RETURN NULL;
END IF;
-- Step 20
-- Gather information about the geometry
int_dims := p_input.get_dims();
int_gtyp := p_input.get_gtype();
int_lrs := p_input.get_lrs_dim();
-- Step 30
-- Handle point and multipoint inputs
IF int_gtyp = 1
THEN
RETURN p_input;
ELSIF int_gtyp = 5
THEN
RETURN SDO_UTIL.EXTRACT(p_input,1);
END IF;
-- Step 40
-- Return results
IF int_dims = 2
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(1)
,p_input.SDO_ORDINATES(2)
,NULL
,NULL
,p_input.SDO_SRID
ELSIF int_dims = 3
AND int_lrs = 3
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(1)
,p_input.SDO_ORDINATES(2)
,NULL
,p_input.SDO_ORDINATES(3)
,p_input.SDO_SRID
ELSIF int_dims = 3
AND int_lrs = 0
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(1)
,p_input.SDO_ORDINATES(2)
,p_input.SDO_ORDINATES(3)
,NULL
,p_input.SDO_SRID
ELSIF int_dims = 4
AND int_lrs IN (4,0)
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(1)
,p_input.SDO_ORDINATES(2)
,p_input.SDO_ORDINATES(3)
,p_input.SDO_ORDINATES(4)
,p_input.SDO_SRID
ELSIF int_dims = 4
AND int_lrs = 3
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(1)
,p_input.SDO_ORDINATES(2)
,p_input.SDO_ORDINATES(4)
,p_input.SDO_ORDINATES(3)
,p_input.SDO_SRID
ELSE
RAISE_APPLICATION_ERROR(-20001,'ERR!');
END IF;
END get_start_point;
FUNCTION get_end_point(
p_input IN MDSYS.SDO_GEOMETRY
) RETURN MDSYS.SDO_GEOMETRY
AS
int_dims PLS_INTEGER;
int_gtyp PLS_INTEGER;
int_lrs PLS_INTEGER;
int_len PLS_INTEGER;
BEGIN
-- Step 10
-- Check over incoming parameters
IF p_input IS NULL
THEN
RETURN NULL;
END IF;
-- Step 20
-- Gather information about the geometry
int_dims := p_input.get_dims();
int_gtyp := p_input.get_gtype();
int_lrs := p_input.get_lrs_dim();
int_len := p_input.SDO_ORDINATES.COUNT();
-- Step 30
-- Handle point and multipoint inputs
IF int_gtyp = 1
THEN
RETURN p_input;
ELSIF int_gtyp = 5
THEN
RETURN SDO_UTIL.EXTRACT(
p_input
,SDO_UTIL.GETNUMELEM(p_input)
END IF;
-- Step 40
-- Return results
IF int_dims = 2
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(int_len - 1)
,p_input.SDO_ORDINATES(int_len)
,NULL
,NULL
,p_input.SDO_SRID
ELSIF int_dims = 3
AND int_lrs = 3
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(int_len - 2)
,p_input.SDO_ORDINATES(int_len - 1)
,NULL
,p_input.SDO_ORDINATES(int_len)
,p_input.SDO_SRID
ELSIF int_dims = 3
AND int_lrs = 0
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(int_len - 2)
,p_input.SDO_ORDINATES(int_len - 1)
,p_input.SDO_ORDINATES(int_len)
,NULL
,p_input.SDO_SRID
ELSIF int_dims = 4
AND int_lrs IN (4,0)
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(int_len - 3)
,p_input.SDO_ORDINATES(int_len - 2)
,p_input.SDO_ORDINATES(int_len - 1)
,p_input.SDO_ORDINATES(int_len)
,p_input.SDO_SRID
ELSIF int_dims = 4
AND int_lrs = 3
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(int_len - 3)
,p_input.SDO_ORDINATES(int_len - 2)
,p_input.SDO_ORDINATES(int_len)
,p_input.SDO_ORDINATES(int_len - 1)
,p_input.SDO_SRID
ELSE
RAISE_APPLICATION_ERROR(-20001,'ERR!');
END IF;
END get_end_point;
FUNCTION is_spaghetti(
p_input IN MDSYS.SDO_GEOMETRY
,p_tolerance IN NUMBER DEFAULT 0.05
) RETURN VARCHAR2
AS
num_tolerance NUMBER := p_tolerance;
ary_strings MDSYS.SDO_GEOMETRY_ARRAY := MDSYS.SDO_GEOMETRY_ARRAY();
ary_starts MDSYS.SDO_GEOMETRY_ARRAY := MDSYS.SDO_GEOMETRY_ARRAY();
ary_ends MDSYS.SDO_GEOMETRY_ARRAY := MDSYS.SDO_GEOMETRY_ARRAY();
int_count PLS_INTEGER;
ary_start_count MDSYS.SDO_NUMBER_ARRAY := MDSYS.SDO_NUMBER_ARRAY();
ary_end_count MDSYS.SDO_NUMBER_ARRAY := MDSYS.SDO_NUMBER_ARRAY();
ary_inside_count MDSYS.SDO_NUMBER_ARRAY := MDSYS.SDO_NUMBER_ARRAY();
BEGIN
-- Step 10
-- Check over incoming parameters
IF p_input IS NULL
THEN
RETURN NULL;
ELSIF p_input.get_gtype = 2
THEN
RETURN 'FALSE';
ELSIF p_input.get_gtype <> 6
THEN
RAISE_APPLICATION_ERROR(-20001,'input gtype must be 2 or 6');
END IF;
IF num_tolerance IS NULL
THEN
num_tolerance := 0.05;
END IF;
-- Step 20
-- Break multistring into single linestrings with nodes
int_count := SDO_UTIL.GETNUMELEM(p_input);
ary_strings.EXTEND(int_count);
ary_starts.EXTEND(int_count);
ary_ends.EXTEND(int_count);
ary_start_count.EXTEND(int_count);
ary_end_count.EXTEND(int_count);
ary_inside_count.EXTEND(int_count);
FOR i IN 1 .. int_count
LOOP
ary_strings(i) := SDO_UTIL.EXTRACT(p_input,i);
ary_starts(i) := get_start_point(ary_strings(i));
ary_ends(i) := get_end_point(ary_strings(i));
END LOOP;
-- Step 30
-- Loop through and count the nodes connections
FOR i IN 1 .. int_count
LOOP
ary_start_count(i) := 0;
ary_end_count(i) := 0;
ary_inside_count(i) := 0;
FOR j IN 1 .. int_count
LOOP
IF i != j
THEN
IF SDO_GEOM.RELATE(
ary_starts(i),
'DETERMINE',
ary_strings(j),
num_tolerance
) IN ('TOUCH','CONTAINS','COVERS','ON')
THEN
ary_start_count(i) := ary_start_count(i) + 1;
ELSIF SDO_GEOM.RELATE(
ary_ends(i),
'DETERMINE',
ary_strings(j),
num_tolerance
) IN ('TOUCH','CONTAINS','COVERS','ON')
THEN
ary_end_count(i) := ary_end_count(i) + 1;
ELSIF SDO_GEOM.RELATE(
ary_strings(i),
'DETERMINE',
ary_strings(j),
num_tolerance
) IN ('TOUCH','CONTAINS','COVERS','OVERLAPBYINTERSECT')
THEN
ary_inside_count(i) := ary_inside_count(i) + 1;
END IF;
END IF;
END LOOP;
IF ary_start_count(i) > 1
OR ary_end_count(i) > 1
OR ary_inside_count(i) > 0
THEN
RETURN 'TRUE';
END IF;
END LOOP;
RETURN 'FALSE';
END is_spaghetti;
FUNCTION points2segment(
p_point_one IN MDSYS.SDO_POINT_TYPE
,p_point_two IN MDSYS.SDO_POINT_TYPE
,p_srid IN NUMBER
) RETURN MDSYS.SDO_GEOMETRY
AS
BEGIN
IF ( p_point_one.Z IS NULL AND p_point_two.Z IS NOT NULL )
OR ( p_point_one.Z IS NOT NULL AND p_point_two.Z IS NULL )
THEN
RAISE_APPLICATION_ERROR(
-20001,
'both points must have the same number of dimensions, point_one Z is ' ||
NVL(TO_CHAR(p_point_one.Z),'') ||
' and point_two Z is ' ||
NVL(TO_CHAR(p_point_two.Z),'')
END IF;
IF p_point_one.Z IS NULL
THEN
RETURN SDO_GEOMETRY(
2002
,p_srid
,NULL
,SDO_ELEM_INFO_ARRAY(1,2,1)
,SDO_ORDINATE_ARRAY(p_point_one.X,p_point_one.Y,p_point_two.X,p_point_two.Y)
ELSE
RETURN SDO_GEOMETRY(
3002
,p_srid
,NULL
,SDO_ELEM_INFO_ARRAY(1,2,1)
,SDO_ORDINATE_ARRAY(p_point_one.X,p_point_one.Y,p_point_one.Z,p_point_two.X,p_point_two.Y,p_point_two.Z)
END IF;
END points2segment;
FUNCTION points2segment(
p_point_one IN MDSYS.SDO_GEOMETRY
,p_point_two IN MDSYS.SDO_GEOMETRY
) RETURN MDSYS.SDO_GEOMETRY
AS
int_gtype1 PLS_INTEGER;
int_dims1 PLS_INTEGER;
int_gtype2 PLS_INTEGER;
int_dims2 PLS_INTEGER;
point_one MDSYS.SDO_POINT_TYPE;
point_two MDSYS.SDO_POINT_TYPE;
BEGIN
int_gtype1 := p_point_one.get_gtype();
int_dims1 := p_point_one.get_dims();
int_gtype2 := p_point_two.get_gtype();
int_dims2 := p_point_two.get_dims();
IF int_gtype1 = 1
AND int_gtype2 = 1
AND int_dims1 = int_dims2
AND p_point_one.SDO_SRID = p_point_two.SDO_SRID
THEN
NULL; -- Good
ELSE
RAISE_APPLICATION_ERROR(
-20001
,'both point objects must be points and have the same number of dimensions and SRIDs'
END IF;
IF int_dims1 = 4
THEN
RETURN SDO_GEOMETRY(
4402
,p_point_one.SDO_SRID
,NULL
,SDO_ELEM_INFO_ARRAY(1,2,1)
,SDO_ORDINATE_ARRAY(
p_point_one.SDO_ORDINATES(1)
,p_point_one.SDO_ORDINATES(2)
,p_point_one.SDO_ORDINATES(3)
,p_point_one.SDO_ORDINATES(4)
,p_point_two.SDO_ORDINATES(1)
,p_point_two.SDO_ORDINATES(2)
,p_point_two.SDO_ORDINATES(3)
,p_point_two.SDO_ORDINATES(4)
ELSE
-- Use the sdo_point_type method for the rest
IF p_point_one.SDO_POINT IS NOT NULL
THEN
point_one := p_point_one.SDO_POINT;
ELSE
IF int_dims1 = 3
THEN
point_one := SDO_POINT_TYPE(
p_point_one.SDO_ORDINATES(1)
,p_point_one.SDO_ORDINATES(2)
,p_point_one.SDO_ORDINATES(3)
ELSE
point_one := SDO_POINT_TYPE(
p_point_one.SDO_ORDINATES(1)
,p_point_one.SDO_ORDINATES(2)
,NULL
END IF;
END IF;
IF p_point_two.SDO_POINT IS NOT NULL
THEN
point_two := p_point_two.SDO_POINT;
ELSE
IF int_dims1 = 3
THEN
point_two := SDO_POINT_TYPE(
p_point_two.SDO_ORDINATES(1)
,p_point_two.SDO_ORDINATES(2)
,p_point_two.SDO_ORDINATES(3)
ELSE
point_two := SDO_POINT_TYPE(
p_point_two.SDO_ORDINATES(1)
,p_point_two.SDO_ORDINATES(2)
,NULL
END IF;
END IF;
RETURN points2segment(
p_point_one => point_one
,p_point_two => point_two
,p_srid => p_point_one.SDO_SRID
END IF;
END points2segment;
FUNCTION linear_gap_filler(
p_input IN MDSYS.SDO_GEOMETRY
,p_tolerance IN NUMBER DEFAULT 0.05
) RETURN MDSYS.SDO_GEOMETRY
AS
sdo_input MDSYS.SDO_GEOMETRY := p_input;
num_tolerance NUMBER;
int_counter PLS_INTEGER;
ary_edges MDSYS.SDO_GEOMETRY_ARRAY;
ary_starts MDSYS.SDO_GEOMETRY_ARRAY;
ary_ends MDSYS.SDO_GEOMETRY_ARRAY;
ary_nearest MDSYS.SDO_NUMBER_ARRAY;
ary_distance MDSYS.SDO_NUMBER_ARRAY;
num_temp NUMBER;
num_nearest NUMBER;
int_winner PLS_INTEGER;
int_winner2 PLS_INTEGER;
sdo_point1 MDSYS.SDO_GEOMETRY;
sdo_point2 MDSYS.SDO_GEOMETRY;
boo_done BOOLEAN;
num_one NUMBER;
num_two NUMBER;
int_looper PLS_INTEGER := 1;
BEGIN
-- Step 10
-- Check over incoming parameters
IF num_tolerance IS NULL
THEN
num_tolerance := 0.05;
END IF;
IF sdo_input IS NULL
OR sdo_input.get_gtype() <> 6
THEN
RETURN sdo_input;
END IF;
IF is_spaghetti(sdo_input,p_tolerance) = 'TRUE'
THEN
RETURN sdo_input;
END IF;
<> ary_edges := MDSYS.SDO_GEOMETRY_ARRAY();
ary_starts := MDSYS.SDO_GEOMETRY_ARRAY();
ary_ends := MDSYS.SDO_GEOMETRY_ARRAY();
ary_nearest := MDSYS.SDO_NUMBER_ARRAY();
ary_distance := MDSYS.SDO_NUMBER_ARRAY();
-- Step 20
-- Break multistring into edges and start and end nodes
int_counter := SDO_UTIL.GETNUMELEM(sdo_input);
ary_edges.EXTEND(int_counter);
ary_starts.EXTEND(int_counter);
ary_ends.EXTEND(int_counter);
FOR i IN 1 .. int_counter
LOOP
ary_edges(i) := SDO_UTIL.EXTRACT(sdo_input,i);
ary_starts(i) := get_start_point(ary_edges(i));
ary_ends(i) := get_end_point(ary_edges(i));
END LOOP;
-- Step 30
-- Determine the closest endpoints
ary_nearest.EXTEND(int_counter);
ary_distance.EXTEND(int_counter);
FOR i IN 1 .. int_counter
LOOP
num_nearest := NULL;
int_winner := NULL;
FOR j IN 1 .. int_counter
LOOP
IF j != i
THEN
num_temp := SDO_GEOM.SDO_DISTANCE(
ary_edges(i)
,ary_edges(j)
,num_tolerance
IF num_nearest IS NULL
OR num_temp < num_nearest
THEN
num_nearest := num_temp;
int_winner := j;
END IF;
END IF;
END LOOP;
ary_nearest(i) := int_winner;
ary_distance(i) := num_nearest;
END LOOP;
-- Step 40
-- Find the smallest gap
int_winner := NULL;
num_nearest := NULL;
FOR i IN 1 .. int_counter
LOOP
IF num_nearest IS NULL
OR ary_distance(i) < num_nearest
THEN
int_winner := i;
num_nearest := ary_distance(i);
int_winner2 := ary_nearest(i);
END IF;
END LOOP;
-- Step 50
-- Determine the endpoints to connect
num_one := SDO_GEOM.SDO_DISTANCE(
get_start_point(ary_edges(int_winner)),
ary_edges(int_winner2),
num_tolerance
num_two := SDO_GEOM.SDO_DISTANCE(
get_end_point(ary_edges(int_winner)),
ary_edges(int_winner2),
num_tolerance
IF ( num_one = 0 AND SDO_GEOM.RELATE(
get_start_point(ary_edges(int_winner)),
'ANYINTERACT',
ary_edges(int_winner2),
num_tolerance
) = 'TRUE' )
OR ( num_two = 0 AND SDO_GEOM.RELATE(
get_end_point(ary_edges(int_winner)),
'ANYINTERACT',
ary_edges(int_winner2),
num_tolerance
) = 'TRUE' )
THEN
sdo_point1 := NULL;
ELSIF num_one < num_two
THEN
sdo_point1 := get_start_point(ary_edges(int_winner));
ELSE
sdo_point1 := get_end_point(ary_edges(int_winner));
END IF;
num_one := SDO_GEOM.SDO_DISTANCE(
get_start_point(ary_edges(int_winner2)),
ary_edges(int_winner),
num_tolerance
num_two := SDO_GEOM.SDO_DISTANCE(
get_end_point(ary_edges(int_winner2)),
ary_edges(int_winner),
num_tolerance
IF ( num_one = 0 AND SDO_GEOM.RELATE(
get_start_point(ary_edges(int_winner2)),
'ANYINTERACT',
ary_edges(int_winner),
num_tolerance
) = 'TRUE' )
OR ( num_two = 0 AND SDO_GEOM.RELATE(
get_end_point(ary_edges(int_winner2)),
'ANYINTERACT',
ary_edges(int_winner),
num_tolerance
) = 'TRUE' )
THEN
sdo_point2 := NULL;
ELSIF num_one < num_two
THEN
sdo_point2 := get_start_point(ary_edges(int_winner2));
ELSE
sdo_point2 := get_end_point(ary_edges(int_winner2));
END IF;
-- Step 50
-- Smash together
IF sdo_point1 IS NULL
OR sdo_point2 IS NULL
THEN
sdo_input := SDO_UTIL.CONCAT_LINES(
ary_edges(int_winner),
ary_edges(int_winner2)
ELSE
sdo_input := SDO_UTIL.CONCAT_LINES(
SDO_UTIL.CONCAT_LINES(
ary_edges(int_winner),
points2segment(sdo_point1,sdo_point2)
ary_edges(int_winner2)
END IF;
boo_done := TRUE;
FOR i IN 1 .. int_counter
LOOP
IF i NOT IN (int_winner,int_winner2)
THEN
sdo_input := SDO_UTIL.APPEND(sdo_input,ary_edges(i));
boo_done := FALSE;
END IF;
END LOOP;
-- Step 60
-- Check if valid if returning
IF sdo_input.get_gtype() = 2
OR boo_done = TRUE
THEN
RETURN sdo_input;
END IF;
int_looper := int_looper + 1;
GOTO TOP_OF_IT;
END linear_gap_filler;
END dz_gap_fill; -
Select values from table%ROWTYPE variable into a cursor
I have a stored procedure which has an OUT parameter of table1%ROWTYPE.
In future we might have to add more OUT parameters of table2%ROWTYPE etc. But at any point of time only one will have values.
So instead of having table%ROWTYPE as OUT parameter, can I send these single row ( with variable values) in a cursor, so that declaration part atleast will not change.
Is it possible to select values from table%ROWTYPE variable into a cursor.
cursorOUT IS
SELECT * FROM varREC;
where varREC is table.ROWTYPE variable.
Or which is the better solution in this situation.
Thanks.SQL> var a refcursor
SQL> declare
2 bb emp%ROWTYPE;
3 begin
4 select * into bb from emp where rownum = 1;
5 open :a for select bb.ename ename, bb.empno empno from dual;
6 end;
7 /
PL/SQL procedure successfully completed.
SQL> print a
ENAME EMPNO
SMITH 7369Rgds. -
Hi,
How do I return two values from a
stored procedure into an "Execute SQL Task" please? Each of these two values need to be populated into an SSIS variable for later processing, e.g. StartDate and EndDate.
Thinking about stored procedure output parameters for example. Is there anything special I need to bear in mind to ensure that the SSIS variables are populated with the updated stored procedure output parameter values?
Something like ?
CREATE PROCEDURE [etl].[ConvertPeriodToStartAndEndDate]
@intPeriod INT,
@strPeriod_Length NVARCHAR(1),
@dtStart NVARCHAR(8) OUTPUT,
@dtEnd NVARCHAR(8) OUTPUT
AS
then within the SSIS component; -
Kind Regards,
Kieran.
Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/Below execute statement should work along the parameter mapping which you have provided. Also try specifying the parameter size property as default.
Exec [etl].[ConvertPeriodToStartAndEndDate] ?,?,? output, ? output
Add a script task to check ssis variables values using,
Msgbox(Dts.Variables("User::strExtractStartDate").Value)
Do not forget to add the property "readOnlyVariables" as strExtractStartDate variable to check for only one variable.
Regards, RSingh -
Copy selected values from a table control into another table control
hi there,
as seen in the subject i need to copy selected values from a table control into another table control in the same screen. as i dont know much about table controls i made 2 table controls with the wizard and started to change the code... right now im totally messed up. nothing works anymore and i don't know where to start over.
i looked up the forums and google, but there is nothing to help me with this problem (or i suck in searching the internet for solutions)
i have 2 buttons. one to push the selected data from the top table control into the bottom tc and the other button is to push selected data from the bottom tc into the top tc. does somebody has a sample code to do this?you're funny
i still don't get it... can't believe, there is no tutorial or sample code around how to copy multiple selected rows from a tc.
here's my code, maybe you can tell me exactly were i have to change it:
tc1 = upper table control
tc2 = lower table control
SCREEN 0100:
PROCESS BEFORE OUTPUT.
MODULE status_0100.
MODULE get_nfo. --> gets data from the dictionary table
MODULE tc1_change_tc_attr.
LOOP AT it_roles_tc1
INTO wa_roles_tc1
WITH CONTROL tc1
CURSOR tc1-current_line.
ENDLOOP.
MODULE tc2_change_tc_attr.
LOOP AT it_roles_tc2
INTO wa_roles_tc2l
WITH CONTROL tc2
CURSOR tc2-current_line.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT it_roles_tc1.
CHAIN.
FIELD wa_roles_tc1-agr_name.
FIELD wa_roles_tc1-text.
ENDCHAIN.
FIELD wa_roles_tc1-mark
MODULE tc1_mark ON REQUEST.
ENDLOOP.
LOOP AT it_roles_tc2.
CHAIN.
FIELD wa_roles_tc2-agr_name.
FIELD wa_roles_tc2-text.
ENDCHAIN.
FIELD wa_roles_tc2-mark
MODULE tc2_mark ON REQUEST.
ENDLOOP.
MODULE ok_code.
MODULE user_command_0100.
INCLUDE PAI:
MODULE tc1_mark INPUT.
IF tc1-line_sel_mode = 2
AND wa_roles_tc1-mark = 'X'.
LOOP AT it_roles_tc1 INTO g_tc1_wa2
WHERE mark = 'X'. -
> big problem here is, that no entry has an 'X' there
g_tc1_wa2-mark = ''.
MODIFY it_roles_tc1
FROM g_tc1_wa2
TRANSPORTING mark.
ENDLOOP.
ENDIF.
MODIFY it_roles_tc1
FROM wa_roles_tc1
INDEX tc1-current_line
TRANSPORTING mark.
ENDMODULE. "TC1_MARK INPUT
MODULE tc2_mark INPUT.
IF tc2-line_sel_mode = 2
AND wa_roles_tc2-mark = 'X'.
LOOP AT it_roles_tc2 INTO g_tc2_wa2
WHERE mark = 'X'. -
> same here, it doesn't gets any data
g_tc2_wa2-mark = ''.
MODIFY it_roles_tc2
FROM g_tc2_wa2
TRANSPORTING mark.
ENDLOOP.
ENDIF.
MODIFY it_roles_tc2
FROM wa_roles_tc2
INDEX tc2-current_line
TRANSPORTING mark.
ENDMODULE.
thx for anybody who can help with this! -
In LR 5.5 (same in previous versions) the RGB values in the histogram are shown in percent (relativ) values. I prefere to see the absolute values, but I can`t find any way to switch. Maybe this option is intentional disabled, because LR works in 16-Bit mode this would result in values up to 2^16. But as i compared the relativ values from LR with the absolute values from PS i run into a conversion problem. The following example shows the differences:
CameraRAW : RGB, 128,0,0
Lightroom: RGB, 43,8%, 19,0%, 6,2%
CameraRAW: RGB, 0,128,0
Lightroom: RGB, 29,8%, 47,5%, 17,5%
Mainly i have two questions:
1. Is there any possibility to change the percent RGB values in LR to absolut values?
2. How can i convert CameraRAW values to LR values (see above)?TThe reason that a design decision was made from the beginning of LR to show only the percentage values was that RGB values are dependent on the color space and the LR histogram and numerical readout are derived from the Develop module's display space which is a hybrid color space with ProPhoto RGB primaries and the sRGB TRC. Thus the numerical values in the display would be different from the exported RGB image (in an orthodox space) and it was feared that this would be misleading. When soft proofing was introduced, because it involved converting the display to an orthodox space, it became possible to use the 0-255 scale in that mode.
-
Insert a value of type Date/Time into a database
I am trying to insert a value of type date time into an access database. What is the format needed to insert the date/time.
Thanks,
-AmosI had all kinds of problems getting a datetime inserted into a SQl Server DB. Probably similar so this is what I do:
String date = new String("01/01/97 12:00:00");
stmt.setObject(1, date);
I tried using TimeStamp's but found I got an occasional Fractional Truncation exception back from the driver. Never had a problem inserting a String using the setObject() method though.
Hope this helps -
How to download values in an internal table into an excel file
is there any fn module to download the values in an internal table into an excel file..
hi
the function module "GUI_DOWNLOAD" downloads the data from
an internal table into a file (can be xl, dat ,doc etc) .
Plz follow the usage below ;
Parameters : pa_pfile LIKE rlgrap-filename OBLIGATORY.
Data : lv_filename TYPE STRING.
lv_filename = pa_pfile.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = lv_filename
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = tb_download " table data to b downlaoded
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards
Pankaj -
Can I export values from an excel spreadsheet into a dropdown field in Acrobat?
I'm creating a form in Acrobat with a dropdown field as an option, I would like to know if I could export the values from an Excel spreadsheet into this field (there are 600 records)?
Sorry this is not something that we currently support. You have to enter your items manually. Once you created you field though you can copy in paste to other forms so you only have to create it once.
-
SQL Loader-How to insert -ve & date values from flat text file into coloumn
Question: How to insert -ve & date values from flat text file into coloumns in a table.
Explanation: In the text file, the negative values are like -10201.30 or 15317.10- and the date values are as DDMMYYYY (like 10052001 for 10th May, 2002).
How to load such values in columns of database using SQL Loader?
Please guide.Question: How to insert -ve & date values from flat text file into coloumns in a table.
Explanation: In the text file, the negative values are like -10201.30 or 15317.10- and the date values are as DDMMYYYY (like 10052001 for 10th May, 2002).
How to load such values in columns of database using SQL Loader?
Please guide. Try something like
someDate DATE 'DDMMYYYY'
someNumber1 "TO_NUMBER ('s99999999.00')"
someNumber2 "TO_NUMBER ('99999999.00s')"Good luck,
Eric Kamradt -
How to get DocSet property values in a SharePoint library into a CSV file using Powershell
Hi,
How to get DocSet property values in a SharePoint library into a CSV file using Powershell?
Any help would be greatly appreciated.
Thank you.
AA.Hi AOK,
Would you please post your current script and the issue for more effcient support.
In addition, to manage document set in sharepoint please refer to this script to start:
### Load SharePoint SnapIn
2.if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
3.{
4. Add-PSSnapin Microsoft.SharePoint.PowerShell
5.}
6.### Load SharePoint Object Model
7.[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”)
8.
9.### Get web and list
10.$web = Get-SPWeb http://myweb
11.$list = $web.Lists["List with Document Sets"]
12.
13.### Get Document Set Content Type from list
14.$cType = $list.ContentTypes["Document Set Content Type Name"]
15.
16.### Create Document Set Properties Hashtable
17.[Hashtable]$docsetProperties = @{"DocumentSetDescription"="A Document Set"}
18.$docsetProperties = @{"CustomColumn1"="Value 1"}
19.$docsetProperties = @{"CustomColum2"="Value2"}
20. ### Add all your Columns for your Document Set
21.
22.### Create new Document Set
23.$newDocumentSet = [Microsoft.Office.DocumentManagement.DocumentSets.DocumentSet]::Create($list.RootFolder,"Document Set Title",$cType.Id,$docsetProperties)
24.$web.Dispose()
http://www.letssharepoint.com/2011/06/document-sets-und-powershell.html
If there is anything else regarding this issue, please feel free to post back.
Best Regards,
Anna Wang
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected] -
Pass multiple values as single input parameter into pipelined function
Hi all,
My need is to pass multiple values as single input parameter into pipelined function.
For example - "2" and "3" are values of input parameter "t":
with data as (
select 1 as t from dual union all
select 2 as t from dual union all
select 3 as t from dual union all
select 4 as t from dual union all
select 5 as t from dual
select * from data where t in (2,3)Is it possible at all?Not exactly sure, but usually 'multiple values'+'pipelined function' = some IN-LIST related approach?
See:
SQL> create table data as
2 select 1 as t from dual union all
3 select 2 as t from dual union all
4 select 3 as t from dual union all
5 select 4 as t from dual union all
6 select 5 as t from dual;
Table created.
SQL> --
SQL> CREATE OR REPLACE FUNCTION in_list (p_in_list IN VARCHAR2)
2 RETURN sys.odcivarchar2list PIPELINED
3 AS
4 l_text VARCHAR2(32767) := p_in_list || ',';
5 l_idx NUMBER;
6 BEGIN
7 LOOP
8 l_idx := INSTR(l_text, ',');
9 EXIT WHEN NVL(l_idx, 0) = 0;
10 PIPE ROW (TRIM(SUBSTR(l_text, 1, l_idx - 1)));
11 l_text := SUBSTR(l_text, l_idx + 1);
12 END LOOP;
13
14 RETURN;
15 END;
16 /
Function created.
SQL> --
SQL> select *
2 from data
3 where t in ( select *
4 from table(in_list('1,2'))
5 );
T
1
2
2 rows selected.http://www.oracle-base.com/articles/misc/dynamic-in-lists.php
or
http://tkyte.blogspot.nl/2006/06/varying-in-lists.html
Maybe you are looking for
-
Writing a large amount of data out.
I am working on a large simulation application. The simulation keeps track of up to 1000 nodes. The simulation is designed to simulate about 20 properties per node every 5 minutes over the course of a year. So for every 5 minutes for that year (about
-
How do I get video (.f4v) to play and sync side by side powerpoint slides
I have a talking head video (converted to .f4v) that I would like to position on the left side of the screen and sync with a powerpoint deck on the right side of the screen. Does anyone know how to accomplish this in Adobe Captivate?
-
Visio interactive org chart display issue
Hi, I've imported data from exchange server to automatically generate structure chart for a department. I've then saved it as a webpage as well as the normal visio file. I save all the files on a network folder, before transferring them to the 'live
-
Hi, Our BI dataabase growing everyday 4 - 5 GB, but actually our source system database size ECC - 700GB and BI database size 1200GB.We are not sure how it growing irrespective of source system.We are using BI7.0, MS SQL Is there a way we can restric
-
Never even thought about them before, so I'm only vaguely aware that Groups are available at book level. Can I pull a selection of files into a group and then generate a ToC just for the group? or is there some other mechanism better suited for this