Combining SDO_JOIN with other spatial selections
Hello Forum,
I would like to use SDO_JOIN in combination with other spatial selections on the same set of geometries. e.g. first select a set of lines using SDO_WITHIN_DISTANCE, then joining these upon each other using SDO_JOIN, the latter much like the "cola markets" example
If I do something like this:
select /*+ ordered */ a.shape AS aSHAPE,
b.id as bd,
b.shape AS bSHAPE
from TABLE(SDO_JOIN(table1, shape, tabel1, shape, anyinteract)),
table1 a,
table1 b
WHERE joinrelations,
AND SDO_WITHIN_DISTANCE( b.SHAPE, apoint, adistance)
this works, but is very slow.
I get the impression that sdo_join is performed before selecting the data using sdo_within_distance. As I have very large tables, I would prefer something like:
select /*+ ordered */ a.shape AS aSHAPE,
b.id as bd,
b.shape AS bSHAPE
from TABLE(SDO_JOIN(RESULTSET_OF_SDO_WITHIN_DISTANCE)),
table1 a,
table1 b
WHERE joinrelations
where RESULTSET_OF_SDO_WITHIN_DISTANCE is a query result of the SDO_WITHIN_DISTANCE, however I don't know how to get the syntax right (or if this is even possible)
thanks in advance,
Niels
Hello Bryan,
thanks for your response.
I have a network of segments (all in 1 table) and want to find all segments that are:
- within a certain distance of one segment
- physically linked to this segment
The combination of these should mimic a network trace
To get the distance I plan on using SDO_WITHIN_DISTANCE( b.SHAPE, apoint, adistance)
where b.shape is the geom column of the segments table
Next I plan on joining the result set onto itself using sdo_join, much like the exampe given in the spatial users guide, for the function sdo_join:
SELECT a.name, b.name FROM cola_markets a, cola_markets b,
TABLE(SDO_JOIN('COLA_MARKETS', 'SHAPE', 'COLA_MARKETS', 'SHAPE',
'mask=ANYINTERACT')) c
WHERE c.rowid1 = a.rowid AND c.rowid2 = b.rowid ORDER BY a.name;
The above selects the marktes that have any spatial interaction.
My join releations are very much alike the ones in this example
I need to determine the the spatial interaction as not all segements within the given distance are connected to the selected segment.
As I said before the amount of data is too large to first sdo_join everything, them make the spatial selection, so I was hoping on reversing the prves, first making the spatial selection, then sdo_join'ing the result set.
thanks for any ideas
Niels
Similar Messages
-
Combining selectOneRadio with other content but text?
Hi!
I got a quite simpel task I am currently not able to manage with JSF. I want to combine some Radio-Buttons with content like images or video, simply showing a radiobox in front an image and another and so on.
So in terms of JSF i thought i had to combine selectOneRadio, selectItem and graphicImage tags. But this doens't work. According to api selectOneRadio-Tags can only contain selectItem- or selectItems-tags.
So how can i manage to show some other content behing my radio buttons without writing my own tag? Mus be an eady solution...i hope ;o)
Thanks!Hi all.
I know this thread is quite old, but does anyone knows (now) if there is a simple solution, or one need to write a custom compoment?
What I need is also a group of radio buttons with an associated image instead of text.
Thanks. -
Some chart types cannot be combined with other chart types
Good morning,
I am working on a MacBook Air (purchased Oct 2009) running Lion. While working in Excel 2011, I encounter the error "Some chart types cannot be combined with other chart types. Please select a different chart type." I am highlighting 46 cells to create a marked line graph. There are no other charts in the file. I called Microsoft support who told me they had not heard of this problem in Excel (only in PowerPoint). I also took it to an Apple Store Genius, who was unable to solve the problem, which is understandable, given that he does not work for Microsoft.
To try to resolve this issue, I have recopied the data to a new spreadsheet, re-typed all the data to a new spreadsheet, and deleted plist files. When I sent it to a different computer (which was running Excel 2011 and Snow Leopard), I could make the figure but I cannot edit the figure or add data on my laptop.
Any suggestions that you have would be much appreciated,
Signed,
One stressed out PhD student who desperately needs Excel to workHi, folks.
Apparently, when using Excel 2011 and running Lion, if the tab names in excel contain a period (.), this error occurs. I removed the periods and now I can graph again. I hope this helps anyone else who may experience this problem. -
I have selected my website as safe. While on the site I fill out a form, then when going to the next page to view results, Firefox says I've been logged out. I hit the back button and go back to the form fill in page. It will not take me to the page of results. This does not happen in other browsers.
This also happens with other websites.Hi,
You can consider the [https://support.mozilla.org/en-US/kb/reset-firefox-easily-fix-most-problems Reset Firefox] feature via '''Help''' ('''Alt''' + '''H''') > '''Troubleshooting Information'''.
(To revert to the previous profile, close the new profile, start Firefox and choose the '''*.default''' profile. While the [https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles Profile Manager] is open, you can also delete the newly reset profile (the one containing random numbers)).
[https://support.mozilla.org/en-US/kb/Managing-profiles Managing profiles]
[https://support.mozilla.org/en-US/kb/Profiles?s=profile&r=2&e=sph&as=s Profiles Howto] -
Combine LR Pages with other templates, How?
Just bought LR pages from The Turning Gate. There is some info on their
website about combining LR pages with other templates. But I already
get stuck reading this information. Is there someone who would explain
this to me? I know a lot about photoshop, but this is something different.
Best regards, MarionHi Sean,
Thank you for the advice
best regards, Marion
Op 17 jun 2009, om 13:24 heeft Seán McCormack het volgende geschreven:
You really need to deal with Matthew on this Marion.
>
Here's the relevant support link:
>
http://www.lightroomforums.net/showthread.php?t=1527
> -
How to combine rows with small numbers into single "other" row?
How can I combine rows with value 6(for example) or lower to single row representing the SUM of all this values and label OTHER, so the pie chart will have a chance to display all small values combined?
I'm using Numbers 09HI Peter,
When you write a decimal number, is the decimal separator a period ( . ) or a comma ( , )? If it's a comma, then the syntax error can be corrected by replacing the list separator in the formula, a comma in Jerry's formula, with a semi colon ( ; ):
=SUMIF(B; "<6"; B)
(Added): The two Bs appear in blue 'lozenges' in Jerry's image because that is the way cell (or column) references are displayed in Numbers when a formula has correct syntax.
Regards,
Barry
Message was edited by: Barry -
How I can combine pdf file with other pdf file
How I can combine pdf file with other pdf file ?
Or from Adobe Reader via https://createpdf.acrobat.com/
-
I have downloaded the latest version of icloud control panel to a PC with Windows 7. My "master" data is always on my PC. With other synch software I always select "One Way Outlook to Device". I synched icloud with Outlook and it has trashed my Outlook with duplicate contacts. Is there a solution. Is there selective synchronisation available?
Make sure you don't have any notes that have no content or subject or this can prevent syncing with Outlook. If you do, delete them.
If you don't, try unchecking "Mail,Contacts,Calendars & Tasks with Outlook" on the iCloud control panel for Windows, choose Delete at the prompt (the data will still be in iCloud), restart your PC, then go back and check this setting again. (Your iCloud data will reappear in Outlook after a brief delay as it redownloads.)
Then create a new note on one of your iOS devices and see if it appears in the Notes folder in Outlook mail after a few minutes. -
Share selected Events with other users of my MBP
Is it possible to share selected events (iPhoto 09) with other users of my mac book pro?
Thanks
KeithNo. You can however make Albums of you Events and share those selectively.
Regards
TD -
Poor performance with Oracle Spatial when spatial query invoked remotely
Is anyone aware of any problems with Oracle Spatial (10.2.0.4 with patches 6989483 and 7003151 on Red Hat Linux 4) which might explain why a spatial query (SDO_WITHIN_DISTANCE) would perform 20 times worse when it was invoked remotely from another computer (using SQLplus) vs. invoking the very same query from the database server itself (also using SQLplus)?
Does Oracle Spatial have any known problems with servers which use SAN disk storage? That is the primary difference between a server in which I see this poor performance and another server where the performance is fine.
Thank you in advance for any thoughts you might share.OK, that's clearer.
Are you sure it is the SQL inside the procedure that is causing the problem? To check, try extracting the SQL from inside the procedure and run it in SQLPLUS with
set autotrace on
set timing on
SELECT ....If the plans and performance are the same then it may be something inside the procedure itself.
Have you profiled the procedure? Here is an example of how to do it:
Prompt Firstly, create PL/SQL profiler table
@$ORACLE_HOME/rdbms/admin/proftab.sql
Prompt Secondly, use the profiler to gather stats on execution characteristics
DECLARE
l_run_num PLS_INTEGER := 1;
l_max_num PLS_INTEGER := 1;
v_geom mdsys.sdo_geometry := mdsys.sdo_geometry(2002,null,null,sdo_elem_info_array(1,2,1),sdo_ordinate_array(0,0,45,45,90,0,135,45,180,0,180,-45,45,-45,0,0));
BEGIN
dbms_output.put_line('Start Profiler Result = ' || DBMS_PROFILER.START_PROFILER(run_comment => 'PARALLEL PROFILE')); -- The comment name can be anything: here it is related to the Parallel procedure I am testing.
v_geom := Parallel(v_geom,10,0.05,1); -- Put your procedure call here
dbms_output.put_line('Stop Profiler Result = ' || DBMS_PROFILER.STOP_PROFILER );
END;
SHOW ERRORS
Prompt Finally, report activity
COLUMN runid FORMAT 99999
COLUMN run_comment FORMAT A40
SELECT runid || ',' || run_date || ',' || run_comment || ',' || run_total_time
FROM plsql_profiler_runs
ORDER BY runid;
COLUMN runid FORMAT 99999
COLUMN unit_number FORMAT 99999
COLUMN unit_type FORMAT A20
COLUMN unit_owner FORMAT A20
COLUMN text FORMAT A100
compute sum label 'Total_Time' of total_time on runid
break on runid skip 1
set linesize 200
SELECT u.runid || ',' ||
u.unit_name,
d.line#,
d.total_occur,
d.total_time,
text
FROM plsql_profiler_units u
JOIN plsql_profiler_data d ON u.runid = d.runid
AND
u.unit_number = d.unit_number
JOIN all_source als ON ( als.owner = 'CODESYS'
AND als.type = u.unit_type
AND als.name = u.unit_name
AND als.line = d.line# )
WHERE u.runid = (SELECT max(runid) FROM plsql_profiler_runs)
ORDER BY d.total_time desc;Run the profiler in both environments and see if you can see where the slowdown exists.
regards
Simon -
Using combination of insert into and select to create a new record in the table
Hello:
I'm trying to write a stored procedure that receives a record locator parameter
and then uses this parameter to locate the record and then copy this record
into the table with a few columns changed.
I'll use a sample to clarify my question a bit further
-- Create New Amendment
function create_amendment(p_mipr_number in mipr.mipr_number%TYPE, p_new_amendment_number in mipr.amendment_number%TYPE)
return integer is
new_mipr_id integer;
begin
THIS is causing me grief See comments after this block of code
insert into mipr
(select mipr_id from mipr where mipr_number=p_mipr_number),
(select fsc from mipr where mipr_number=p_mipr_number),
45,
(select price from mipr where mipr_number=p_mipr_number),
practical,
(select part_number from mipr where mipr_number=p_mipr_number);
THe above will work if I say the following
insert into mipr
(select * from mipr where mipr_number=p_mipr_number);
BUt, Of course this isn't what I want to do... I want to duplicate a record and change about 3 or 4 fields .
How do I use a combination of more than one select and hard coded values to insert a new record into the table.
/** Ignore below this is fine... I just put a snippet of a function in here ** The above insert statement is what I need help with
select (mipr_id) into new_mipr_id from mipr where mipr_number=p_mipr_number + amendment_number=(select max(amendment_number) + 1);
return new_mipr_id;
end;
THANK YOU IN ADVANCE!
KTfunction create_amendment(p_mipr_number in mipr.mipr_number%TYPE)
return integer is
new_mipr_id integer;
tmp_number number;
tmp_mipr_id integer;
begin
tmp_number :=(select max(amendment_number) from mipr where mipr_number=p_mipr_number);
Question:
tmp_number :=1; works..
tmp_number doesn't work with the select statement?
Obviously I'm a novice! I can't find anything in my book regarding tmp variables... What should I look under is tmp_number a
variable or what? In my Oracle book, variable means something different.
Thanks!
KT
I have the following code in my stored procedure:
Good luck,
Eric Kamradt -
Combining results with a Query of Queries - NOT QUITE THERE!!!
I have included a small sample of my database, specifically the four tables I am trying to work with in the hopes that someone can steer me down the right path. Here are the four tables and the bottom is a visual desciption of what I am trying to achieve;
ORDERS
SALES CALLS
ID
SaleDate
TerritoryManager
UserID
SaleDate
TerritoryManager
ID
UserID
426
01-Oct-09
Mike B
10112
10/1/2009
Mike B
253
10112
427
01-Oct-09
Russ C
10115
10/1/2009
Mike B
254
10112
430
01-Oct-09
Jerry W
10145
10/1/2009
Mike B
255
10112
432
01-Oct-09
Ron H
10118
10/1/2009
Mike B
256
10112
433
01-Oct-09
Ron H
10118
10/1/2009
Ron H
257
10118
10/1/2009
Ron H
258
10118
PRODUCTS ORDERED
10/1/2009
Ron H
260
10118
OrderID
Quantity
NewExisting
UserID
10/1/2009
Russ C
261
10115
426
12
0
10112
10/1/2009
Mike B
267
10112
427
2
0
10115
10/1/2009
Mike B
268
10112
427
3
1
10115
430
1
0
10145
USERS
430
1
0
10145
TerritoryManager
Zone
UserID
432
1
0
10118
Mike B
Central
10112
432
1
0
10118
Russ C
Central
10115
432
1
1
10118
Jerry W
Central
10145
432
1
1
10118
Ron H
Central
10118
433
2
1
10120
Don M
Central
10120
Central Zone
Ttl Calls
Ttl Orders
Ttl Items
Ttl New Items
Mike B
5
1
12
1
Russ C
1
1
5
Jerry W
1
2
Ron H
3
2
6
3
I have tried to achieve this result in many ways to no avail. If I try to combine PRODUCTS ORDERED with ORDERS I get an erroneous count. I finally resigned myself to getting all the info I needed with separate queries and then trying to combine them with a query of queries. This worked fine until the last query of queries which timed out with no results. I am a newbie and would appreciate any constructive help with this. I am including my queries below as well;
<cfquery name="qGetOrders" datasource="manna_premier">
SELECT Count(Orders.ID) AS CountOfID,
Orders.UserID AS Orders_UserID,
Users.UserID AS Users_UserID,
Users.TMName
FROM Users INNER JOIN Orders ON Users.[UserID] = Orders.[UserID]
GROUP BY Orders.UserID, Users.UserID, Users.TMName;
</cfquery>
<cfquery name="qGetSalesCalls" datasource="manna_premier">
SELECT Count(Sales_Calls.ID) AS CountOfID,
Users.UserID AS Users_UserID,
Users.TMName,
Sales_Calls.UserID AS Sales_Calls_UserID
FROM Users INNER JOIN Sales_Calls ON Users.[UserID] = Sales_Calls.[UserID]
GROUP BY Sales_Calls.UserID, Users.UserID, Users.TMName;
</cfquery>
<cfquery name="qGetProducts" datasource="manna_premier">
SELECT Count(ProductOrders.OrderID) AS CountOfOrderID,
Sum(ProductOrders.Quantity) AS SumOfQuantity,
Sum(ProductOrders.NewExisting) AS SumOfNewExisting,
ProductOrders.UserID
FROM Orders INNER JOIN ProductOrders ON Orders.[ID] = ProductOrders.[OrderID]
GROUP BY ProductOrders.UserID;
</cfquery>
<cfquery name="qqCombOrd_Prod" dbtype="query">
SELECT *
FROM qGetOrders, qGetProducts
</cfquery>
<cfquery name="qqCombOrd_ProdtoSales" dbtype="query">
SELECT *
FROM qqCombOrd_Prod, qGetSalesCalls
</cfquery>
PLEASE HELP!!! I'm about to go scouting for bridges to leap from!You might be able to simplify that query by getting rid of the subqueries. Something like this
SELECT TerritoryManager
, count(sc.userid) totalcalls
, sum(po.quantity) total
, sum(newexisting) totalnew
, count(o.userid) totalorders
from users u join salescalls sc on u.userid = sc.userid
join orders o on u.userid = o.userid
join productorders po on u.userid = po.userid
where userzone = 'CENTRAL' -
Is a WITH...SELECT query more efficient than a SELECT query ?
Hi folks,
Is the WITH...SELECT just a convenience or is it really efficient than a simple SELECT with UNION ALL ? e.g. is the following:
with rset as (select dname,empno,ename,hiredate,sal from emp e,dept d where e.deptno=d.deptno)
select dname,empno,ename,hiredate,sal,
case
when trunc(hiredate) < to_date('19800101','yyyymmdd') then 'Hired before 1980'
when trunc(hiredate) between to_date('19800101','yyyymmdd') and to_date('19851231','yyyymmdd') then 'Hired between 1980 and 1985'
else 'Hired after 1985'
end as notes
from rset
union all
select dname,empno,ename,hiredate,sal,
case
when sal < 500 then 'Salary less than 500'
when sal between 501 and 1500 then 'Salary between 501 and 1500'
else 'Salary greater than 1500'
end as notes
from rset;
better than the following:
select dname,empno,ename,hiredate,sal,
case
when trunc(hiredate) < to_date('19800101','yyyymmdd') then 'Hired before 1980'
when trunc(hiredate) between to_date('19800101','yyyymmdd') and to_date('19851231','yyyymmdd') then 'Hired between 1980 and 1985'
else 'Hired after 1985'
end as notes
from emp e,dept d where e.deptno=d.deptno
union all
select dname,empno,ename,hiredate,sal,
case
when sal < 500 then 'Salary less than 500'
when sal between 501 and 1500 then 'Salary between 501 and 1500'
else 'Salary greater than 1500'
end as notes
from emp e,dept d where e.deptno=d.deptno;
I am a newbie at sql tuning. Apparently, the first query should be faster because it runs the actual query only once and then just works on the resultset obtained. Is this thinking correct ?
Thanks a lot!!
JPAlso I tried a test here with a ten million row emp table queried five times, and explain plan showed the optimizer would read emp five times and not once.
Re: Intresting question
Apparently, the first query should be faster because it runs the actual query only once
and then just works on the resultset obtained.But my test combined with Jonathan's article made me question whether materializing ten million rows somewhere would be faster than querying them five times. Somehow I doubt it. -
How to use Count with other all fields
Hello guys. Sorry about my question because it s syntax but i didnt find in google.
How can i use count combined with other all fields.
Like SELECT count(*) 'other all fields like * ' FROM VBAK .
Thank you very much.Don't sure to understand your requirement (count would always be 1, aggregates are only defined with grouping)
So either use two SELECT (or replace count(*) counting Nr of records selected) if no relation between count and field values....
Or use a dynamic SELECT syntax. Use FM DDIF_FIELDINFO_GET to get field list, then create fieldlist with every field name and count(*), create grouplist with every field name
SELECT (fieldlist)
INTO ...
FROM table
GROUP BY (grouplist).
Regards,
Ramond -
my start up disc is full i have a macbook air, i back everuthing up with time capsule and have movies all my music libraries and photos onto that too so as i have free space, but my max still says my startup disc is full with "other"
First, empty the Trash if you haven't already done so. Then reboot. That will temporarily free up some space.
According to Apple documentation, you need at least 9 GB of available space on the startup volume (as shown in the Finder Info window) for normal operation. You also need enough space left over to allow for growth of your data. There is little or no performance advantage to having more available space than the minimum Apple recommends. Available storage space that you'll never use is wasted space.
If you're using Time Machine to back up a portable Mac, some of the available space will be used to make local snapshots, which are backup copies of files you've recently deleted. The space occupied by local snapshots is reported as available by the Finder, and should be considered as such. In the Storage display of System Information, local snapshots are shown as "Backups." The snapshots are automatically deleted when they expire or when free space falls below a certain level. You ordinarily don't need to, and should not, delete local snapshots yourself.
To locate large files, you can use Spotlight as described here. That method may not find large folders that contain a lot of small files.
You can also use a tool such as OmniDiskSweeper (ODS) to explore your volume and find out what's taking up the space. You can delete files with it, but don't do that unless you're sure that you know what you're deleting and that all data is safely backed up. That means you have multiple backups, not just one.
Proceed further only if the problem hasn't been solved.
ODS can't see the whole filesystem when you run it just by double-clicking; it only sees files that you have permission to read. To see everything, you have to run it as root.
Back up all data now.
Install ODS in the Applications folder as usual.
Triple-click the line of text below to select it, then copy the selected text to the Clipboard (command-C):sudo /Applications/OmniDiskSweeper.app/Contents/MacOS/OmniDiskSweeper
Launch the Terminal application in any of the following ways:
☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
I don't recommend that you make a habit of doing this. Don't delete anything while running ODS as root. If something needs to be deleted, make sure you know what it is and how it got there, and then delete it by other, safer, means.
When you're done with ODS, quit it and also quit Terminal.
Maybe you are looking for
-
How can I set the submit button to email only certain pages of the pdf not the entire pdf?
We have a pdf that is a hundred pages or so where each page is an individual product that the customer can select for purchase. At the end of the pdf is an order form. We want to be able to email just the few pages which are the form as a pdf. The de
-
2 Adobe flash site issues..
Questions1: I have a script error message of. scene=scene1, layer=actions, frame=2, line=9. Error opening including file gs/datatransfer/xmlfunctions.as File not found. how do I fix this, I won't load my site when I hit publish preview. Have been fig
-
So What's the Consensus on USB Interfaces with Logic?
Digidesign's new ELEVEN Rack has a coreaudio driver and therefore can be used as a main interface. This is good news for those who like to use both Logic and Pro Tools, perhaps depending on the project, or to track in Logic and mix in PT. But, Digi h
-
W7 64 LR4.1 CS5 CS6: correct folder for .lcp profiles
Windows 7 64 LR 4.1 CS5 CS6 ACR 7.1 I have lcp files in : C:\Program Files\Adobe\Adobe Photoshop Lightroom 4.1\Resources\LensProfiles\1.0\ and in : C:\ProgramData\Adobe\CameraRaw\LensProfiles\1.0\ and in : C:\Users\All Users\Adobe\CameraRaw\LensProfi
-
How do I view multiple images from different projects at the same time?
Hello I've been trying to find the answer in the user manual, but no luck so far. I did find how to open 2 projects at once, but I can only see one image at a time in the viewer and I have to keep going back and forth between projects to compare imag