SDO_GEOM.SDO_CENTROID Ordinates X?
Hi,
I execute the next request:
select CLE,SDO_GEOM.SDO_CENTROID(geom,0.00005) AS CENTROIDE from espace where CLE in (6352,6390);
This is returns the geometric type but I want that this returns only the X and Y ordinates.
Why the solution please?
thanks
SDO_CENTROID returns a a point geometry
to get at ordinates use something like
<geom_column_name>.sdo_point.x
<geom_column_name>.sdo_point.y
example:
select sdo_geom.sdo_centroid(shape,.005).sdo_point.x X, sdo_geom.sdo_centroid(shape,.005).sdo_point.y Y, quad_name from quad24k_sdo where quad_name = 'SAN FRANCISCO NORTH';
X Y QUAD_NAME
549416.323 4185151.16 SAN FRANCISCO NORTH
hope this helps
--kassim
Similar Messages
-
SDO_CENTROID returning null
Hi,
I am having a few problems with SDO_Centroid returning null if I have a polygon and a point in one record. Is this expected and is there a way around it (if I do a MBR first and then sdo_centroid it works but is slow - it is accurate enought for my needs though).
thanks
ChrisChris2,
[1] For that function, the Oracle Docs say, +"The function returns a null value if geom1 is not a polygon, multipolygon, point, or point cluster, as identified by the SDO_GTYPE value in the SDO_GEOMETRY object"+. Your geometry is likely SDO_GTYPE 2004 (collection).
[2] Perhaps you could extract the polygon part and perform sdo_centroid on that.
-- "Assuming you always have 1 polygon and 1 point"
-- "AND assuming the polygon comes first (=1)"
SELECT SDO_GEOM.SDO_CENTROID(SDO_UTIL.EXTRACT(geometry, 1), 0.1) FROM MyTable;[3] So you have a collection comprised of a polygon and a point. Out of curiosity, where's the point with respect to the centroid?
[4] SpatialDB Advisor has some alternatives to sdo_centroid [url http://www.spatialdbadvisor.com/oracle_spatial_tips_tricks/75/multi-centroid-shootout]here and [url http://www.spatialdbadvisor.com/oracle_spatial_tips_tricks/75/multi-centroid-shootout]here. Scroll all the way down to the bottom of those pages to see an illustration of what those do.
Regards,
Noel -
Query slow using SDO_GEOM package
Hi,
i've a query that extract this data from a table:
SDO_GEOM.sdo_centroid (geometry, 0.5).sdo_point.x
It's very, but very slow, about 15sec for 300 records.
Remove this package from select it's very fast.
Any ideas to how tuning spacial package??
TNXWith column in select:
call count cpu elapsed disk query current rows
Parse 1 0.02 0.05 0 606 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 14 1.31 5.32 0 36 0 184
total 16 1.33 5.37 0 642 0 184
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 119
Rows Row Source Operation
184 TABLE ACCESS FULL CAA_PA (cr=129 pr=0 pw=0 time=2880603 us cost=7 size=219 card=1)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 14 0.00 0.00
Disk file operations I/O 1 0.00 0.00
SQL*Net message from client 14 24.76 24.80
********************************************************************************whitout package in select :
SELECT ID2 AS ID_COLUMN,
'' AS SYMBOL,
ICONCODE AS IMAGECODE_COLUMN,
ID_UNICO AS TOOLTIP_COLUMN,
1121 AS QUERYID,
'0' AS HASACTIONS,
1 AS ALIGNMENT
FROM IDT_SETPRIMARIO.V_CAA_XY
WHERE X > 1567630
AND X < 1872370
AND Y > 4998933
AND Y < 5139066
AND ICONCODE IS NOT NULL
ORDER BY ICONCODE
call count cpu elapsed disk query current rows
Parse 1 0.01 0.02 0 370 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 14 0.83 1.82 0 121 0 184
total 16 0.84 1.85 0 491 0 184
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 119
Rows Row Source Operation
184 TABLE ACCESS FULL CAA_PA (cr=121 pr=0 pw=0 time=1473516 us cost=7 size=219 card=1)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 14 0.00 0.00
Disk file operations I/O 1 0.00 0.00
SQL*Net message from client 14 20.27 20.30
******************************************************************************** -
Hallo,
I have a problem with sdo_centroid.
We have a 9i database where the following statement works but on the 10g it does not work and we don't know why.
SELECT SDO_GEOM.SDO_CENTROID(SDO_GEOM.AGGR(n.geometrie),0.001), SDO_GEOM.SDO_CENTROID(SDO_AGGR(n.geometrie),0.001) FROM nutzung n WHERE n.bezeichnung='P 819P';
Regards, KatrinHi Katrin,
what do you mean with "does not work"? Did you get a wrong result or an Error. If you get an error, can you please post the complete error message.
Did you checked the geometries with SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT?
Regards
Udo -
Finding the centroid of a polyline
Hi.
I am trying to write a function that will return the centroid of an input polyline. I have come up with two possible solutions, but both are problematic in different ways...
This first function returns an error:
ORA-00600: internal error code
Our DBA is looking in to this, but so far with no success
The second function seems to work ok, but is very slow. It takes over half an hour to process the first 10,000 records in my table (there are 270,000 in all)
Any suggestions as to what the problem might be with the first function, or how to speed up the second?
Thanks!
1
create or replace function get_line_centroid(geoloc MDSYS.SDO_GEOMETRY) return MDSYS.SDO_GEOMETRY
as
mbr MDSYS.SDO_GEOMETRY;
centroid MDSYS.SDO_GEOMETRY;
begin
mbr := MDSYS.SDO_GEOM.SDO_MBR(geoloc);
If SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(mbr, 0.05) = 'TRUE' Then
centroid := MDSYS.SDO_GEOM.SDO_CENTROID(mbr, 0.05);
End If;
return centroid;
end;
2
create or replace function get_line_centroid(geoloc MDSYS.SDO_GEOMETRY) return MDSYS.SDO_GEOMETRY
as
lrs_seg MDSYS.SDO_GEOMETRY;
centroid MDSYS.SDO_GEOMETRY;
begin
lrs_seg := SDO_LRS.CONVERT_TO_LRS_GEOM(geoloc);
centroid := SDO_LRS.LOCATE_PT(lrs_seg, SDO_LRS.PERCENTAGE_TO_MEASURE(lrs_seg, 50));
return SDO_LRS.CONVERT_TO_STD_GEOM(centroid);
end;Hi All.
Well I have still not figured why my first function was failing, but I have discovered a much faster alternative to the second one...
This is to perform a manual computation of the centroid using the coordinates in the ordinate array of the line.
Quite straight forward :) -
Distance to Centroid ??
How to i compute the distance between the centroid of a state, and city within the state ?? I know how to compute the distance between two cities etc, but im not sure how to incorporate the centroid part into the sdo_distance command ??
For instance if i want to find the distance between the centroid of Oregon to a city in Oregon, what would i do ??
The data are setup in 2 different tables, one stores the citys, and the other stores the states, i know how to get the citys in Oregon using a join command, but im not sure how to incorporate it so it shows the distances of only the citys in Oregon, and outputs the distances from the citys in Oregon to the Centroid of Oregon ? I have been trying different things for 2 hours and nothing is working, can you please help ??
The command
SELECT SDO_GEOM.SDO_CENTROID(geom,1)
FROM spatial.us_states uss
WHERE uss.state = 'Oregon';
Outputs the centroid data, but how do i get it so it just uses the points ?? Since i need the co-ordinates of the centroid to use the distance command ??SELECT sdo_geom.sdo_distance(SDO_GEOM.SDO_CENTROID(uss.geom,1),
usc.geom, 1)
FROM spatial.us_states uss, us_cities usc
WHERE uss.state = usc.state; -
Using SDO_UTIL.GETVERTICES() together with functions
Hi again
I'm having a problem here in my spatial database I trying to use the function
TABLE(SDO_UTIL.GETVERTICES(c.shape)) in order to get the coordinates of shapes. But I need to first extract data from spatial functions like the centroid function. How do I get these 2 functions to work together.
thanks very much
ThomazHi Thomaz,
Maybe I missed your point, but what about the following:
select t.y, t.x, t.id
from your_geom_table,
table(
sdo_util.GETVERTICES(
sdo_geom.sdo_centroid(geom, 0.005)
) t
regards,
Thomas -
Track a Line String with a Trigger
Hi,
(sorry for my bad english)
I need to know if i can track a Line String with a trigger. For example, in my case, i've to colums called "COORDINATEPARTENZA" and "COORDINATEARRIVO". From contains a CONTROID() coordinates, anche TO contains CENTROID() coordinates. Now, can i track a line in a colums "LINE" with a trigger? All in automatic?
There is a method to take the coordinates from "COORDINATEPARTENZA" and "COORDINATEARRIVO" and track an automatic stringline with a trigger?
This is the code:
This is the Trigger:
CREATE OR REPLACE TRIGGER "TRIGGERPERCORSO"
BEFORE INSERT OR UPDATE OF luo_nomeluogo ON "SPOSTAMENTI"
FOR EACH ROW
DECLARE
partenza VISUALPERCORSO.coordinatepartenza%TYPE;
arrivo VISUALPERCORSO.coordinatearrivo%TYPE;
vecchioluogo LUOGHI.nomeluogo%TYPE;
nuovocodicespostamento SPOSTAMENTI.codicespostamento%TYPE;
presenza NUMERIC;
BEGIN
SELECT COUNT(*) INTO presenza
FROM spostamenti
WHERE ope_codiceopera = :new.ope_codiceopera;
IF (presenza >= 1) then
SELECT luo_nomeluogo INTO vecchioluogo
FROM (SELECT * FROM spostamenti
WHERE ope_codiceopera = :new.ope_codiceopera
ORDER BY codicespostamento DESC)
WHERE ROWNUM <2;
SELECT SDO_GEOM.SDO_CENTROID (c.COLLOCAZIONE, m.diminfo) INTO partenza
FROM LUOGHI c, user_sdo_geom_metadata m
WHERE m.table_name = 'LUOGHI' AND m.column_name = 'COLLOCAZIONE' AND c.nomeluogo = vecchioluogo;
SELECT SDO_GEOM.SDO_CENTROID (d.COLLOCAZIONE, n.diminfo) INTO arrivo
FROM LUOGHI d, user_sdo_geom_metadata n
WHERE n.table_name = 'LUOGHI' AND n.column_name = 'COLLOCAZIONE' AND d.nomeluogo = :new.luo_nomeluogo;
INSERT INTO VISUALPERCORSO(LUOGOPARTENZA, OPE_CODICEOPERA, COORDINATEPARTENZA, LUOGOARRIVO, COORDINATEARRIVO) VALUES (vecchioluogo, :new.ope_codiceopera, partenza, :new.luo_nomeluogo, arrivo);
END IF;
END;
So, now i need to track a line (with oracle spatial) from "COORDINATEPARTENZA" to "COORDINATE ARRIVO". With another trigger.
Thanks a lot (sorry for my bad english)."COORDINATEPARTENZA" and "COORDINATEARRIVO" are points, correct?
If I understand, you need to create a line from initial point (PARTENZA) to final point (ARRIVO) in a trigger.
Yes, you can do it.
Anyway, you can write to me in italian (miguel dot fornari at gmail). -
Union of tables to give a spatial view
I have a series of tables that i am trying to join together and display in a view. Some of them have a slightly different structure. They all have either a east/north, easting or northing, or a centrex and centrey. I then want the centroids for each polygon. If i run the select statements seperatly they select what i want, however when i put a union in it gives the following error message :
ERROR at line 1:
ORA-22901: cannot compare nested table or VARRAY or LOB attributes of an object
type
The SQL is as follows :
CREATE or REPLACE VIEW ALLSITES_V AS
select
'SSSI' desg,SSSI_NAME site_name,SSSI_ID site_code,EAST CENTREX,NORTH CENTREY,TO_NUMBER(sssi_id) isis_id,MI_STYLE,MI_PRINX,GEOLOC,sdo_geom.sdo_centroid(geoloc,0.001)
from SSSI
union
select
'SPA' desig,SPA_NAME site_name,SPA_CODE site_code,EASTING CENTREX,NORTHING CENTREY,ISIS_ID isis_id,MI_STYLE,MI_PRINX,GEOLOC,sdo_geom.sdo_centroid(geoloc,0.001)
from SPA
union
select
'RAMSAR' desg,RAMSAR_NAME site_name,RAMSAR_CODE site_code,EASTING CENTREX,NORTHING CENTREY,ISIS_ID isis_id,MI_STYLE,MI_PRINX,GEOLOC,sdo_geom.sdo_centroid(geoloc,0.001)
from RAMSAR
union
select
'SAC' desg,SAC_NAME site_name, SITE_CODE site_code,ISIS_ID isis_id,CENTREX,CENTREY,MI_STYLE,MI_PRINX,GEOLOC,sdo_geom.sdo_centroid(geoloc,0.001)
from SAC
I am assuming it is because i have not used the SDO_GEOM function in it's correct format. I would also like the view to show the centrex and y and also the MBR. It is will be used when passed through a WMS. I have missed out something fairly fundermental but i am not sure how to incorperate it.Hi,
I created view:
CREATE OR REPLACE VIEW VIEW_ALL as
SELECT
ID, GEOMETRIE_ZNACKA as GEOMETRIE
FROM
TAB_A
WHERE
GEOMETRIE_ZNACKA is not null
UNION ALL
SELECT
ID, GEOMETRIE_SIPKA as GEOMETRIE
FROM
TAB_B
WHERE
GEOMETRIE_SIPKA is not null
I inserted geometry metadata:
insert into mdsys.user_sdo_geom_metadata (table_name,column_name,diminfo,SRID)
values ('VIEW_ALL','GEOMETRIE',MDSYS.SDO_DIM_ARRAY (MDSYS.SDO_DIM_ELEMENT('X',431700, 904600,0.01),
MDSYS.SDO_DIM_ELEMENT('Y',935200, 1227300,0.01)),2065);
Tables TAB_A and TAB_B have spatial index on column with geometry.
When I view the view VIEW_ALL in the spatial view (Georaptor) we get an error "ORA-01446".
Geometry data of tables TAB_A and TAB_B (directly) is viewed in spatial view (Georaptor) corectly.
Thanks
Petr Soucek -
Hi,
I am trying to find centroid of a polyline. The geometry function SDO_GEOM.SDO_CENTROID does not take polyline object. Is there any method to find the centroid of polyline?
Thanks in advance.
JaganHello Jagan
I guess you need the centroid on the polyline?
This is something that's provided in the LRS functions if i'm not mistaken. In case you do not want to use the LRS I've got here a part of a function which could help.
It is not the nicest code, still I should do the trick or at least maybe get you in the right direction.
The imput parameters are a the sdo_geometry 2D polyline and an interpolated factor. this should be 0.5 for the centroid, or midpoint of the polyline. (1.0 is end point, 0.0 is startpoint).
Hope this can help you.
Luc
(my_geometry IN MDSYS.SDO_GEOMETRY, vInterpolFactor IN REAL)
RETURN MDSYS.SDO_GEOMETRY AS
-- my_geometry IN is a 2D polyline --
-- vInterpolFactor IN is a factor indicating at which --
-- distancefactor a point needs be returned --
-- 0.0 is startpoint, 1.0 is endpoint --
-- 0.5 is midpoint (or centroid on the polyline itself --
-- returns an sdo_geometry POINT --
my_outPOI MDSYS.SDO_GEOMETRY;
my_length REAL;
my_IntDist REAL;
my_TempDist REAL := 0;
my_XCoord2 REAL;
my_YCoord2 REAL;
my_XCoord1 REAL;
my_YCoord1 REAL;
my_XCoordInt REAL;
my_YCoordInt REAL;
my_XCoordOffset REAL;
my_YCoordOffset REAL;
my_Count INTEGER;
i INTEGER := 1;
pi CONSTANT REAL := 4 * ATAN(1);
my_DeltaX REAL;
my_DeltaY REAL;
my_LastLeg Real;
my_LLIntDist REAL;
my_Argument REAL;
my_TGOmega REAL;
my_Rotation REAL;
my_dim CONSTANT INTEGER := 2;
my_Offsfactor CONSTANT INTEGER := 10;
l_tekst varchar2(250);
BEGIN
my_length := SDO_GEOM.SDO_LENGTH(my_geometry, my_dim);
my_IntDist := my_length * vInterpolFactor;
my_XCoord2 := my_geometry.SDO_ORDINATES(i);
my_yCoord2 := my_geometry.SDO_ORDINATES(i+1);
my_Count := my_geometry.SDO_ORDINATES.COUNT ;
i := i + my_dim;
WHILE NOT(FLOOR(my_IntDist) < my_TempDist) AND (NOT (i-my_dim = (my_Count - 1))) LOOP
-- i := i + my_dim;
my_XCoord1 := my_XCoord2;
my_YCoord1 := my_YCoord2;
my_XCoord2 := my_geometry.SDO_ORDINATES(i);
my_yCoord2 := my_geometry.SDO_ORDINATES(i+1);
my_DeltaX := my_XCoord2 - my_XCoord1;
my_DeltaY := my_YCoord2 - my_YCoord1;
my_LastLeg := SQRT((my_DeltaX**2) + (my_DeltaY**2));
my_TempDist := my_TempDist + my_LastLeg;
i := i + my_dim;
END LOOP;
my_LLIntDist := my_LastLeg - (my_TempDist - my_IntDist);
IF (my_DeltaY = 0) THEN
IF (my_DeltaX > 0) THEN
my_Argument := pi / 2;
ELSE
my_Argument := 3 * (pi / 2);
END IF;
ELSE
my_TGOmega := ABS(my_DELTAX) / ABS(my_DeltaY);
IF (my_DeltaX > 0) THEN
IF (my_DeltaY > 0) THEN
my_Argument := ATAN(my_TGOmega);
ELSE
my_Argument := pi - ATAN(my_TGOmega);
END IF;
ELSE
IF (my_DeltaY > 0) THEN
my_Argument := 2 * pi - ATAN(my_TGOmega);
ELSE
my_Argument := pi + ATAN(my_TGOmega);
END IF;
END IF;
END IF;
my_XcoordInt := my_Xcoord1 + my_LLIntDist * Sin(my_Argument);
my_YcoordInt := my_Ycoord1 + my_LLIntDist * Cos(my_Argument);
my_outPOI := MDSYS.SDO_GEOMETRY
2001,
NULL,
mdsys.sdo_point_type(my_XcoordInt , my_YcoordInt , NULL),
NULL,
NULL
RETURN my_outPOI;
END; -
Plx help on Spatial data urgent.....
I am doing a project that retrieve the data stored inside oracle 10g database using j2ee and jdeveloper...currently i am able to retrieve the data type String int etc...using the recordset and display it out...but how do i work wif the sdo_geometry object stored and displayed it out...if possible can gif me some example ??
and oracle.spatial.geometry.* is residing in wat jar and where can i download it ??How do i actually find the corrdinates of the STRUCT object after loading into JGEMOTEORY..
Currently my web service coding is as below:
public String SearchPlaceByPostCode(String post_code)
OracleResultSet rset = null;
Statement stmt = null;
String sql="SELECT HOUSE_BLK_NO,ROAD_NAME,POSTAL_CODE,BUILDING_NAME,sdo_geom.sdo_centroid(gblob_,0.05) centerPoint FROM SLA_LBSTR_INT_BLDG where postal_code like '%" userInput +"'";
System.out.print("sql");
String HOUSE_BLK_NO="",ROAD_NAME="",POSTAL_CODE="",BUILDING_NAME="";
STRUCT centerPoint=null;
JGeometry Loader=null;
try{
DBmgr dbMgr= new DBmgr();
Connection connection = dbMgr.dbConnection();
stmt = connection.createStatement();
rset = (OracleResultSet)stmt.executeQuery(sql);
if (rset.next())
HOUSE_BLK_NO=rset.getString("HOUSE_BLK_NO");
ROAD_NAME=rset.getString("ROAD_NAME");
POSTAL_CODE=rset.getString("POSTAL_CODE");
BUILDING_NAME=rset.getStrin("BUILDING_NAME");
centerPoint=(STRUCT)rset.getObject("centerPoint");
Loader = JGeometry.load(centerPoint);
//Which methods shld i use here to find the X,Y points ??
rset.close( );
stmt.close( );
catch(Exception e)
System.err.println(e);
return "The X coordinate is"+x "and Y coordinate is "+ y;
} -
How to recreate MDSYS schema.
We installed Oracle Xe 10.2 on Windows Xp (850 client). Mdsys schema was dropped after Xe install. How to recreate MDSYS schemas without reinstall XE?
I ran this script successfully with some error. But there was some invalid objects. After create mdsys I tested two sql. First sql wasn't ran. Second sql was ran successfully. I thing this method incorrect. I think, I will re-install XE edition.
Thank you your support...
SELECT c.IL_ADI, SDO_GEOM.SDO_CENTROID(c.geoloc, m.diminfo)
FROM il_v113 c, user_sdo_geom_metadata m
WHERE m.table_name = 'IL_V113';
SELECT M.* FROM IL_V113 M WHERE SDO_RELATE(M.GEOLOC, sdo_geometry(2001,8307,sdo_point_type(28.8110549178336,41.1581182896854,null),null,null), 'mask=ANYINTERACT') = 'TRUE' -
Help with displaying spatial data
Hi, i am new to spatial and have a table (temp_properties) that has numerous columns, one of which is called shape and is of mdsys.sdo_geometry type.
I also have a table in another database that also has a shape column the same, we cannot seem to use the shape column across the database link as we keep getting 'remote operations not permitted on object tables or user-defined type columns'
is this a known limitation or is it just the way i am trying to do it?
We would also like to be able to retrieve the coordinates in sql from this shape column, but keep getting errors.Hi,
before just one question : have you an column wich is called
se_anno_cad_data in your table with the shape field.
Spatial Operator :
For example if you have polygone in your shape field
you can obtain the centroid of the polygone by this
query:
select c.code_topo, c.centroid.sdo_point.x as X, c.centroid.sdo_point.y as Y
from (select e.code_topo, sdo_geom.sdo_centroid(sdo_geom.sdo_convexhull(e.geom, 0.05), 0.05) as CENTROID
from expl_local e) c
with expl_local : my table with the sdo_geometry type field and geom the name of the sdo_geometry field
sdo_geom.sdo_centroid and sdo_geom.sdo_convexhull are
spatial operator from Oracle Spatial Option.
nice to read you
Pascal -
Track a StringLine with a Trigger
Hi,
(sorry for my bad english)
I need to know if i can track a stringline with a trigger. For example, in my case, i've to colums called "From" and "To". From contains a CONTROID() coordinates, anche TO contains CENTROID() coordinates. Now, can i track a line in a colums "LINE" with a trigger? All in automatic?
There is a method to take the coordinates from "FROM" and "TO" and track an automatic stringline with a trigger?
The Table is composed by:
ID | FROM | TO | LINE
Thanks a lot (sorry for my bad english).Ok, i means a simple line (Line Sting http://www.oracle.com/pls/db111/to_URL?remark=ranked&urlname=http:%2F%2Fdownload.oracle.com%2Fdocs%2Fcd%2FB28359_01%2Fappdev.111%2Fb28400%2Fglossary.htm%23sthref2928)
This is the Trigger:
CREATE OR REPLACE TRIGGER "TRIGGERPERCORSO"
BEFORE INSERT OR UPDATE OF luo_nomeluogo ON "SPOSTAMENTI"
FOR EACH ROW
DECLARE
partenza VISUALPERCORSO.coordinatepartenza%TYPE;
arrivo VISUALPERCORSO.coordinatearrivo%TYPE;
vecchioluogo LUOGHI.nomeluogo%TYPE;
nuovocodicespostamento SPOSTAMENTI.codicespostamento%TYPE;
presenza NUMERIC;
BEGIN
SELECT COUNT(*) INTO presenza
FROM spostamenti
WHERE ope_codiceopera = :new.ope_codiceopera;
IF (presenza >= 1) then
SELECT luo_nomeluogo INTO vecchioluogo
FROM (SELECT * FROM spostamenti
WHERE ope_codiceopera = :new.ope_codiceopera
ORDER BY codicespostamento DESC)
WHERE ROWNUM <2;
SELECT SDO_GEOM.SDO_CENTROID (c.COLLOCAZIONE, m.diminfo) INTO partenza
FROM LUOGHI c, user_sdo_geom_metadata m
WHERE m.table_name = 'LUOGHI' AND m.column_name = 'COLLOCAZIONE' AND c.nomeluogo = vecchioluogo;
SELECT SDO_GEOM.SDO_CENTROID (d.COLLOCAZIONE, n.diminfo) INTO arrivo
FROM LUOGHI d, user_sdo_geom_metadata n
WHERE n.table_name = 'LUOGHI' AND n.column_name = 'COLLOCAZIONE' AND d.nomeluogo = :new.luo_nomeluogo;
INSERT INTO VISUALPERCORSO(LUOGOPARTENZA, OPE_CODICEOPERA, COORDINATEPARTENZA, LUOGOARRIVO, COORDINATEARRIVO) VALUES (vecchioluogo, :new.ope_codiceopera, partenza, :new.luo_nomeluogo, arrivo);
END IF;
END;
So, now i need to track a line (with oracle spatial) from "COORDINATEPARTENZA" to "COORDINATE ARRIVO". With another trigger.
Can you understand now? -
1.) Can someone give me an example of why you would want to
move the
center point in a symbol?
2.) Is it a better idea to move the center point for an
instance and not
the actual symbol?
Thanks.Is SDO_GEOM.SDO_CENTROID what you are looking for?
Format
SDO_GEOM.SDO_CENTROID(
geom1 IN SDO_GEOMETRY,
dim1 IN SDO_DIM_ARRAY
) RETURN SDO_GEOMETRY;
or
SDO_GEOM.SDO_CENTROID(
geom1 IN SDO_GEOMETRY,
tol IN NUMBER
) RETURN SDO_GEOMETRY;
Description
Returns a point geometry that is the centroid of a polygon, multipolygon, point, or point cluster. (The centroid is also known as the "center of gravity.")
For an input geometry consisting of multiple objects, the result is weighted by the area of each polygon in the geometry objects. If the geometry objects are a mixture of polygons and points, the points are not used in the calculation of the centroid. If the geometry objects are all points, the points have equal weight.
Maybe you are looking for
-
Every time I try to use my sync account, it informs me that "Sync encountered an error while connecting: Incorrect account name or password. Please try again." I tried changing my password. I even made a new account. It still does the same thing.
-
i am unable to zoom in/out using the touch pad; yesterday i could zoom in/out of website pages, pics, etc, now today it is not letting me; how do i fix this?
-
What is the function code of create new session?
what is the function code of create new session? thanks...
-
New battery needed and possibly new adapter?
I have a Macbook I bought back in 2008 and I know I need a new battery. My condition says "Replace now." Recently I've noticed that the light on my charger has been going out and sometimes isn't charging the battery. Is this just because I need a new
-
Late 2011 MBP model no dvd's?
I bought a new late 2011 13" mbp for my daughter. It came with Lion installed but I can't find the DVD's in the box. It is goofed up now and needs to be reloaded but I have no media. Has anyone else seen this packaging inconsistency in their purchase