Inserting sdo_geometry object
I'm trying to insert an sdo_geometry object as an oracle.sql.STRUCT object using a prepared statement in Java but can't get it right: keep getting :"Inconsistent java and sql object types" message. Does any1 have an example or can help plz?
Hi!
Yes, the GML, WKT and WKB functions at 10gR2 are all 2D.
I have a package that I recently extended to include a TO_3D() function (it already has a TO_2D() function).
The package also has an AsEWKT which will return an sdo_geometry that is 2, 3 or 4D into an "extended" WKT format which is based on the next release of the OGC standard (and as in the Open Source FDO package). I have a VB6 library that implements an AsEWKT function. It would, most likely, not take me that much time to convert this to ToEWKT() but you could do it yourself by downloading the existing packages/VB6 code from my website at www dot spatialdbadvisor dot com.
I have not uploaded the changed package with the TO_3D() function in it onto my website (for free download) but if you contact me I will let you know when it is has been uploaded. My email address is: simon at spatialdbadvisor dot com.
You could get some GML 3 compliant Java code and drop it in the database with a PL/SQL wrapper over it. There is code in GeoTools to spatial objects to/from Oracle SDO_Geometry format and I guess there might be something in there for reading GML 3.0. There is a GML2Geometry function in the packages that uses Java but I have not done one for GML3ToGeometry. But it would be a useful start.
Hope this helps!
regards
S
Similar Messages
-
Insert SDO_GEOMETRY using array binding
Hi,
does anyone know howto insert the elem_info array and the ordinates array of a SDO_GEOMETRY object using array binding and ODP or if there is a way to insert the SDO_GEOMETRY object using the same technique.
/AndersThe current releases of ODP.NET do not support object types, hence no "proper" SDO_GEOMETRY support. You can retrieve the data as an XML-type as illustrated here:
Re: ODP.Net + Spatial
I know of no way to insert an SDO_GEOMETRY object using array binding at this time.
If someone else has a solution, please do post!
- Mark -
How To Insert A object into Conext
Hi Techies,
I have 8 tables in my designer
and I have two contexts at designer level
And how to insert a object into a context that is not referencing any table.
For Example I have an object like "rownum" (Which should must be added at Universe level only not at report level). Here this object is not referencing any table and I want this to be used in a query where the remaining objects are coming from the context..
Thanks in Advance..Double-click the Objects and click the TABLES button and select the table you want to associate the object to for the context to work properly (see below).
Regards,
Ajay -
Insert ActiveX Object - not in list
Hi, guys.
After one time, I'm not able to install by myself ActiveX controls and embed these controls into ActiveX containers yet. I refer to ActiveX controls that can be embedded into ActiveX containers, not those used to instantiate other applications.
I want a certain ActiveX Control to be displayed in an ActiveX Container on the Front Panel. In this particular case, it's a Mozilla Firefox ActiveX Control. According to http://forums.ni.com/t5/LabVIEW/activex-firefox-and-mozilla/td-p/356235 (see message 5), after getting the component from the link provided and installing it, I should be able to insert onto the empty ActiveX Container by clicking over it and selecting "Insert ActiveX Object...". In this case, "MozillaBrowser class" should appear in the list, but not.
However, if I place a Property Node or Invoke Node without reference on the Block Diagram, click on it, then "Select Class" -> "ActiveX" -> "Browse", I find the class "MozillaControl 1.0 Type Library Version 1.0", that, among others, it contains the class "IWebBrowser2". This class happens to be called "MOZILLACONTROLLib.IWebBrowser2". But, once I have the Property Node or Invoke Node, I can't create the container from it (create control from its reference) neither place an empty ActiveX container and wire its reference to the Property Node.
I also tried registering the ActiveX Control, by typing "regsvr32 <control_name.dll>" in the command prompt, but nothing changes.
But this doesn't happen to me only with this particular ActiveX control. Every time I want to find in the list a certain ActiveX component after installing it, I can't find it, and I end up copying ActiveX container blocks from VI examples I found on the forums... One example is using AcroPDF ActiveX Control.
Any suggestion? Has anybody faced the same problem?
Regards,
Francisco
Attachments:
ActiveX Container.png 26 KB
Property Node.png 35 KBHello,
Probably you can
see the server in the pop-up menu because the server is not in the PC but is in
the registry. Remove the checkbox “Validate Servers” to see if the Mozilla
server appears. According to this LV help link...
http://zone.ni.com/reference/en-XX/help/371361G-01/lvhowto/creating_new_controls_in_a/
... looks like the server is not installed in the PC... or it’s not registered. -
How to get the x1,y1 and z1 coordinates out of an sdo_geometry object?
Hello,
i have stored several boxes into an sdo_geometry object like the following:
mdsys.sdo_geometry(3003,null,null,
mdsys.sdo_elem_info_array(1,1003,3),
mdsys.sdo_ordinate_array(x1,y1,z1,x2,y2,z2)
now i would like to get the x1,y1,z1 coordinates from the boxes. how can i get them with a simple sql-statement?
When i do "SELECT v.shape.sdo_ordinates ..." then i get a sdo_ordinate_array. But how can i get only the first coorinates?
I know how it works to get x1,y1 and z1 over a java-prog. But i want to get them with a sql-statement as i also want to get the min and max x1,y1,z1.
Hope there is anybody that can help me. Thanks in advance.
Markus VeithYou can get coordinates from an SDO_POINT_TYPE as follows:
SELECT t.GEOMETRY.SDO_POINT.x,t.GEOMETRY.SDO_POINT.y
FROM TABLE T
(where geometry is the geometry column and table is the geometry table, note
that a table alias must be used.)
Getting the coordinates from the SDO_ORDINATES is a little trickier.
You'll need to use a loop in PL/SQL, eg:
SET SERVEROUT ON
DECLARE
i number;
j NUMBER;
BEGIN
FOR sel IN (SELECT <geom_column> FROM <geom_table> WHERE ROWNUM < 10) LOOP
i := 1;
while i < sel.<geom_column>.sdo_ordinates.count LOOP
j:= sel.GEOMETRY.sdo_ordinates(i);
dbms_output.put_line(j);
i := i + 1;
j:= sel.GEOMETRY.sdo_ordinates(i);
end loop;
dbms_output.put_line(j);
END LOOP;
END;
This will print the SDO_ORDINATES to the SQLPLUS screen, put a WHERE clause to reduce output.
To use these values in a query, put them in a cursor. -
Hi
When I was a PC user, I could insert an object such as a video into my MS Word document - and it would appear as an icon, which when clicked, would begin to play the video.
I find that I cannot insert such videos/movies into my Pages document on my iPad, but maybe I am missing something, being new to the Apple way of doing things?:) Would appreciate any help, thanks!"maybe I am missing something"
Maybe you are.
This forum/community is named "AppleWorks" because it is intended to discuss issues and techniques involving the now discontinued Apple productivity application AppleWorks.
Your question concerns Pages, and specifically, Pages for iOS, the version that runs on iPad (and other iOS devices).
Admittedly, the Pages for iOS community is difficult to locate. It's rolled in with the other iWork applications in a community named iWork for iOS, where you'll find several people willing and able to answer your question. The link will take you there.
Regards,
Barry -
Program to Insert BI Objects in a Transport
Hi Experts,
I am looking for a function module/program to insert BI Objects in a transport request (i need to include this in another code).
Thanks in advance for your help.
ArminderNo solution, so just closing the thread
-
Problem with displaying sdo_geometry objects
Hi all,
formerly in sql developer at my query result tab, the sdo_geometry objects used to look like this: mdsys.sdo_geometry(2001, 8307, sdo_point_type(12, 8, null), null, null)
now for all the columns with sdo_geometry objects I'm getting [mdsys.sdo_geometry].
I'm using sql developer 3.1.07 with oracle 10g express edition.
Does anybody know how I can switch to the previous view?
ThanksWelcome to the forum.
Thanks for reposting here. The people that read this forum use and know sql developer so you should be able to get help.
I'm not familiar with SDO_GEOMETRY but I did find this other recent thread in this forum.
You might want to look at it to see if it has any info you can use.
Re: SQL Developer 3.0.04 - SDO_GEOM Issues
That thread has this reply at the bottom
>
To add to Gary, the SDO_GEOMETRY cell will now show "SDO_GEOMETRY" & you can see it's value in the popup cell viewer/editor (double clicking inside the cell & then clicking the "..." button).
>
Is that what you needed?
That thread also mentions this thread
Re: SQLD 3.1EA - Fails to render resultset output containing SDO_GEOMETRY
Where one of the developers appears to say that made is not show the content automatically to address a performance issue. So maybe the double-click will work to display it when you want it or maybe there is a tools-preference setting. -
Insert revenue object (Products dependency is that true)
Hi, while inserting Revenue Object in Opportunities POD, is it necessary to relate it with Product object ?
Do we receive errors and exceptions when we try to insert the List of Revenue directly into CRM On Demand ?
If so what is the exception and what is the workaround ?The answer is, Yes, it is true.
Opportunity Product Revenue (called different names in WS 1.0 and 2.0, etc) is an item related to both Opportunity and Product.
The error message would differ depending on version of WS: 1.0 or 2.0, but there is no workaround: you would have to specify the related product - by its name, row Id, or External System Id. -
Ole2 question about inserting document object in Word
I thought I had it figured out but it doesn't seem to work. From a Oracle Forms 6i application, I want to insert an object(a file) in a word document as an icon.
The vb code generated when I record the macro of inserting an object as an icon is:
Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.8", FileName _
:="string defining the location of the file object", LinkToFile:=False _
, DisplayAsIcon:=True, IconFileName:= _
"C:\WINDOWS\Installer\{90110409-6000-11D3-8CFE-0050048383C9}\wordicon.exe" _
, IconIndex:=1, IconLabel:= _
"string defining the location of the file object"
Using this I wrote the following code: ( I am leaving out the declaration of the ole2.obj_type and other variables)
args := ole2.create_arglist;
ole2.add_arg (args, 'string defining the location of the file object');
hinlineshapes :=
ole2.get_obj_property (hselection, 'InlineShapes');
ole2.invoke (hinlineshapes
,'AddOLEObject'
,args
ole2.destroy_arglist (args);
holeformat := ole2.get_obj_property (hinlineshapes, 'OLEFormat');
ole2.set_property (holeformat
,'ClassType'
,'Word.Document.8'
ole2.set_property (holeformat
,'DisplayAsIcon'
,TRUE
ole2.set_property (holeformat
,'IconLabel'
,'string defining the location of the file object'
When I run the code I get the following message from MS Word:
" This object was created in 'string defining the location of the file object'.
This application is not available to open this object.
Make sure the application is properly installed and that it has not deleted, moved or renamed."
Can someone please help? Thanks in advance.Second, when it inserts the date, it makes it an "update automatically" date that updates to the current time every time I open the document
Sure, that's because you specifically tell it to. Your script inserts a 'new field' which is analogous to Word's dynamic text objects (date, time, page number, etc.)
Instead, what you want to do is insert an actual string of characters - sure, to you and I that string of characters might look like a date and time, but to Word it's nothing more than a series of characters.
For that we can fall back on AppleScript's date features, specifically current date, like:
tell application "Microsoft Word"
tell selection
type text text "Left message " & (current date as text)
end tell
end tell
Note that current date as text returns a rather verbose form of the date. If that's too much for you there are alternate options, such as:
short date string of (current date) & space & time string of (current date)
which will look more like: "6/10/10 3:26:50 PM"
But there is also a myriad of other ways (with seconds, without seconds, 12/24 hr, etc.) depending on what you want.
Third, if possible, I would also like it to be in italics.
I'll have to look at that one, unless someone else beats me to it. -
Multiple SDO_GEOMETRY Objects of type CIRCLE with the same LOCATION
Can i have a single MERCHANT LOCATION hold multiple SDO_GEOMETRY Objects of type CIRCLE ?
For example the use case , i need to have a SDO_GEOMETRY TYPE CIRCLE circle defined for a single MERCHANT LOCATION with a 2 Mile radius as well as a 5 Mile Radius.
is that even possible with Spatial? I know i can add a single geometry for a merchant at once, but i want to give the user the flexibility of choosing the type of geometry for the merchant based on set of rules. hence want to check if this can be done or not?
Thanks in AdvancePerson with no name,
Not clear exactly what you need to do here.
You can store two circles with the same centre in a single sdo_geometry but only if you use a polygon with the circle with the greatest radius being the outer ring and the smaller radius the inner ring.
I have a utility in my free COGO plsql package that allows me to create circles for PLANAR data pretty easily as follows:
-- Function...
Create
function CreateCircle(dCentreX in Number,
dCentreY in Number,
dRadius in Number)
return mDSYS.sdo_geometry
IS
dPnt1X NUMBER;
dPnt1Y NUMBER;
dPnt2X NUMBER;
dPnt2Y NUMBER;
dPnt3X NUMBER;
dPnt3Y NUMBER;
BEGIN
-- Compute three points on the circle's circumference
dPnt1X := dCentreX - dRadius;
dPnt1Y := dCentreY;
dPnt2X := dCentreX + dRadius;
dPnt2Y := dCentreY;
dPnt3X := dCentreX;
dPnt3Y := dCentreY + dRadius;
RETURN MDSYS.SDO_GEOMETRY(2003,NULL,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,4),MDSYS.SDO_ORDINATE_ARRAY(dPnt1X, dPnt1Y, dPnt2X, dPnt2Y, dPnt3X, dPnt3Y));
End;
select sdo_geometry(f.geom.sdo_gtype,
f.geom.sdo_srid,
sdo_point_type(f.centreX,f.centreY,null),
f.geom.sdo_elem_info,
f.geom.sdo_ordinates) as mcircle
from (select 10 as centreX,
10 as centreY,
sdo_geom.sdo_xor(cogo.CreateCircle(10,10,2),
cogo.CreateCircle(10,10,5),
0.005) as geom
from dual ) f;
-- Results
MCIRCLE
SDO_GEOMETRY(2003,NULL,SDO_POINT_TYPE(10.0,10.0,NULL),SDO_ELEM_INFO_ARRAY(1,1003,2, 11,2003,2),SDO_ORDINATE_ARRAY(10.0,15.0, 5.0,10.0, 10.0,5.0, 15.0,10.0, 10.0,15.0, 10.0,8.0, 8.0,10.0, 10.0,12.0, 12.0,10.0, 10.0,8.0))(This geometry looks like a donut.)
Note that I have included the centre coordinates in the sdo_point of the result sdo_geometry.
To extract each ring:
-- We need a function to return number of rings in a polygon as sdo_util.getNumElems() does not
Create
Function GetNumRings( p_geometry in mdsys.sdo_geometry,
p_ring_type in integer /* 0 = ALL; 1 = OUTER; 2 = INNER */ )
Return Number
Is
v_elements pls_integer := 0;
v_ring_count pls_integer := 0;
v_etype pls_integer;
v_ring_type pls_integer := case when ( p_ring_type is null OR
p_ring_type not in (0,1,2) )
Then 0
Else p_ring_type
End;
Begin
If ( p_geometry is not null ) Then
v_elements := ( ( p_geometry.sdo_elem_info.COUNT / 3 ) - 1 );
<<element_extraction>>
FOR v_i IN 0 .. v_elements LOOP
v_etype := p_geometry.sdo_elem_info(v_i * 3 + 2);
If ( ( v_etype in (1003,1005,2003,2005) and 0 = v_ring_type )
OR ( v_etype in (1003,1005) and 1 = v_ring_type )
OR ( v_etype in (2003,2005) and 2 = v_ring_type ) ) Then
v_ring_count := v_ring_count + 1;
End If;
END LOOP element_extraction;
End If;
Return v_ring_count;
End GetNumRings;
-- Query
with circles as (
SELECT SDO_GEOMETRY(2003,NULL,SDO_POINT_TYPE(10.0,10.0,NULL),SDO_ELEM_INFO_ARRAY(1,1003,2, 11,2003,2),SDO_ORDINATE_ARRAY(10.0,15.0, 5.0,10.0, 10.0,5.0, 15.0,10.0, 10.0,15.0, 10.0,8.0, 8.0,10.0, 10.0,12.0, 12.0,10.0, 10.0,8.0))
as geom
FROM dual
select sdo_util.extract(a.geom,1,e.ringNo) as circle
from circles a,
(select level as ringNo from circles a connect by level <= GETNUMRINGS(a.geom)) e;
-- Result
CIRCLE
SDO_GEOMETRY(2003,NULL,SDO_POINT_TYPE(10.0,10.0,NULL),SDO_ELEM_INFO_ARRAY(1,1003,2),SDO_ORDINATE_ARRAY(10.0,15.0, 5.0,10.0, 10.0,5.0, 15.0,10.0, 10.0,15.0))
SDO_GEOMETRY(2003,NULL,SDO_POINT_TYPE(10.0,10.0,NULL),SDO_ELEM_INFO_ARRAY(1,1003,2),SDO_ORDINATE_ARRAY(10.0,8.0, 12.0,10.0, 10.0,12.0, 8.0,10.0, 10.0,8.0))Not sure if this helps you at all....
regards
Simon -
How do I insert an object in an array?
How can I insert an object in an array of variable size?
I input two numbers from keyboard
1
2that form the following object (Pair)
(1,2)
how can I add such objects to an array
private Pair s[];
e.g.
public PairList(int x){
top = -1;
s = new Pair[x];
}//constructor
public void getPairs()throws FullException{
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
try{
a=input.readLine();b=input.readLine();
}//try
catch(IOException e){System.out.println("Can't read input");}//catch
int x=0;
int y=0;
try{
x=Integer.parseInt(a);}//try
catch(NumberFormatException e){}
try{
y=Integer.parseInt(b);}//try
catch(NumberFormatException e){}
Pair k=new Pair(x,y);
System.out.println(k);
s[++top]=k; --here is my problem
}//getPairsI tried making as few changes to your code as possible, but your idea should basically work. Potential problems:
1. Doesn't allow for more input than 1 pair.
2. By storing pair in an array, you must know the exact size of the array you will need beforehand. You might be better off storing the Pair(s) in a Vector and then converting that to an array.
3.Your exception handlers need some work. Basically, your exception handlers put out a message or do nothing and then you continue processing. Not good.
4. No cleanup of file resources after you have completed
import java.io.*;
public class PairList{
private Pair s[];
private int top;
public PairList(int x){
top = -1;
s = new Pair[x];
}//constructor
public void getPairs()throws Exception{
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
String a = null, b = null;
try{
a=input.readLine();
b=input.readLine();
}//try
catch(IOException e){
System.out.println("Can't read input");
}//catch
int x=0;
int y=0;
try{
x=Integer.parseInt(a);
}//try
catch(NumberFormatException e){
try{
y=Integer.parseInt(b);}//try
catch(NumberFormatException e){
Pair k=new Pair(x,y);
System.out.println(k.toString());
s[++top]=k; //here is my problem
}//getPairs
class Pair {
private int xx;
private int yy;
public Pair(int x, int y) {
xx = x;
yy = y;
public String toString() {
return("X = " + xx + " Y = " + yy);
} -
TopLink does not generate SQL statements for inserting new objects
TopLink does not generate SQL statements for inserting new objects. Why?
Thanks in advance...Please see the response in
Why does not unitofwork.commit write data to the database?
Regards,
Chris -
How to insert Transition object into html document
Hello Friends,
I am trying to insert Transition object ( downloaded from
Extension) into HTML document.
I tried Insert -> HTML -> Head Tags -> Transitions,
but after doing all this I am not able to insert
this extension in my document.
As I am beginner to Dreamweaver, Can anyone pls. help me out?
I am using Dreamweaver 8.
Do I need to select <img> tag before inserting
Transition Object?
Pls. pls. help me out.....
Waiting for reply.
Thanks in advance for your help.When I used to do tabs I would set up a page that was as wide as the tab sheet including the tab, then add text frames in each tab position.
-
Delete and insert same Object in one transaction?
Hi all,
Can be possible in one transaction delete and then insert same object into the database?
If I want change PK in some record in DB, then I must delete the Object and then insert new Object (row). And this I want realize in one transaction - Unit of Work.
Is this possible?
Thx advance,
best regards,
KLD
P.S. Sry for my EnglishGenerally not always a good idea, but may be possible. If you are using JPA, you should be able to do a flush() after deleting the object, then re-persist the new one.
For the UnitOfWork API, writeChanges() is the same as flush, but it only allowed to be called once, so you may need to use the RepeatableWriteUnitOfWork, or performDeletesFirst option.
Or just use two separate units of work.
James : http://www.eclipselink.org
Maybe you are looking for
-
Consolidation of my photos scattered on my c drive and my h drive
Please help me! How do I consolidate my photos into one folder? I have Lightroom 3. All of my photos have been imported already but some are on my C drive and others are on my H drive. How do I consolidate those on my C drive into one pre- existing f
-
Size of web pages and inserted files (assets).
Hi, everyone. As I am optimizing some web pages on my site I would like to see the overall size of each page and individual images displayed on iWeb. Is there a way to see what the overall size of each page in iWeb will be once finished as well as th
-
The #DATA# field in Chart XML takes the data from your SQL query and wraps it in XML so that AnyChart can render the chart correctly. Is there a way for me to customize how the XML is generated? Where do I find the definition for the #DATA# field? Th
-
I'm pretty miffed. I'm asking someone already about the problem with my applet. I.E. keeps telling me that my applet can't be instantiated, but my applet works fine with appletviewer, what gives? My program ListApplet has a class that is made by me c
-
Curves isn't offered in the layer dropdown. Why?
I uploaded a raw photo and was going to work in layers with curves, but it wasn't offered in dropdown. I've had that happen a few times after working with curves once or twice, but the third time it wasn't offered in dropdown. Why?