Finding whether a line string is self crossing
I want to find out whether a line string is self crossing but I am unable to determine how to do this.
Any help will be appreciated
TIA,
SP
You can do an intersection of the line with itslef.
The resulting geometry will have atleast one repeated vertex
if the line is self intersecting.
siva
Similar Messages
-
I have a string variable and I have to find whether the value of the variable is
number or characters.
How can I do it in java?
I was thinking of casting the variable to integer and if true then the value
is integer, if false then string. I think this is not a good way of doing it?
any idea. thanks.This is what i did, and its not showing any error at the moment.
Is the following right way to do it
> if(somevariable.getClass().toString()).equals("java.lang.String")){
}else{
That's not the way to do it because your 'somevariable' is a String.
Either check every character in that string for being a digit or not, or
let the Integer class do the dirty work:try {
int theValue= Integer.parseInt(somevariable);
// yes, it succeeded, so it was an int ...
catch (NumberFormatException nfe) {
// nope, the string didn't represent an integer number
}kind regards,
Jos -
Oracle Spatial function to find nearest line string based on lat/long
Hi,
Here is my scenario. I have a table that contains geometries of type line strings (the roadway network). The line geomteries are of type Ohio state plane south (SRID 41104).
I have a requirement - given a lat/long, find the line string that snaps to that lat/long or the nearest set of line strings within a distance of 0.02 miles.
This is a typical example of trying to identify a crash location on our roadway network. The crashes being reported to us in lat/long thru the GPS system.
How can i acheive this through any spatial functions?
Thanks for the help in advance.
thanx,
L.Hi L,
That is not the way I would do it. I would convert my road segments to LRS data, then you can do all queries on the same data.
Or, if you do not want to modify your original data, create a copy of your road segments with the same ID's and convert the copy into LRS data. If you keep the ID's identical, you can easily use geometry from one and LRS data from the other - as long as you are sure the ID is the same.
Which will make the workflow a bit easier:
1. Use SDO_NN to get the closest segments
2. Use SDO_LRS.PROJECT_PT to get the projected point
3. Use SDO_LRS.GET_MEASURE to get the measure
And most of these you can incorporate into one single query. Now I am writing this of the top of my head (It's been a while since I played with LRS). so this has not been tested, but something like this should work (but could probably be greatly improved - it's getting late for me :-) ):
SELECT
SDO_LRS.FIND_MEASURE --//find_measure needs an LRS segment and a point
SELECT --//here we select the LRS segment
r.geometry
FROM
roadsegments r
WHERE SDO_NN(r.geometry, --//based on the given GPS point
sdo_geometry(2001, 41104, sdo_point_type(lat,lon,NULL), NULL, NULL),
'sdo_num_res=2 distance=0.02 unit=mile') = 'TRUE'
SDO_LRS.PROJECT_PT --//We project the point on the LRS segment
SELECT --//here we select the LRS segment (again, which could probably be improved!!)
r.geometry
FROM
roadsegments r
WHERE SDO_NN(r.geometry,
sdo_geometry(2001, 41104, sdo_point_type(lat,lon,NULL), NULL, NULL),
'sdo_num_res=2 distance=0.02 unit=mile') = 'TRUE'
sdo_geometry(2001, 41104, sdo_point_type(lat,lon,NULL), NULL, NULL) --//The GPS point again
AS milemarker from dual;So it is not as complicated as you think, it can easily be done with just one query (SQL can do a lot more than you think ;-) ).
Good luck,
Stefan -
How to find whether an Invoice is been posted for a particular PO
Hi,
How to find whether an Invoice is been posted for a particular PO.
I have a scenario where I fetch data into an internal table T_CDHDR(It has PO and other details). For each and every entry(PO) in that internal table I have to see whether an Invoice is been posted or not. They told to use <b>EKBE(Purchasing document history)</b> table. But, I don't know which field to check for and based on what conditions.
Can someone help me with sample code or some valuable inputs.
Thanks in advance.
Regards,
Paddu.HI,
TABLE IS RIGHT.
IN THAT TABLE FOR THE FIELD BEWTP CHECK WHETHER ENTRY IS "Q".
Q STANDS FOR IR-L THAT MEANS INVOICE IS DONE.
ON THE SELECTION SCREEN OF EKBE TABLE ENTER THE PO NUMBER.
THEN CHECK WHETHER IT HAS ENTRY FOR BEWTP 'Q'.
YOU CAN CROSS-CHECK THIS DATA FROM TABLE WITH THAT IN ACTUAL PO IN T.CODE - ME23N.
ENTER PO NUMBER ,THEN IN ITEM DETAILS , IN HISTORY TAB SEE FOR THAT INVOICE NO. -
Error SDO_WITHIN_DISTANCE of a line string
I am writing a number of queries for a prototype application. All of my queries are working except for when I try to find POINTS which are a certain distance from a line string.
select
poi.*
from
point_of_interest poi
where
SDO_WITHIN_DISTANCE(poi.location,
SDO_GEOMETRY(2003,8307,null,
SDO_ELEM_INFO_ARRAY(1,2,1),
SDO_ORDINATE_ARRAY(45.0264,32.0082,44.998,32.0027,44.9858,32.0008,44.9797,32.0001)),'distance=5 unit=KM') = 'TRUE';
The error I receive is
ERROR at line 1:
ORA-29902: error in executing ODCIIndexStart() routine
ORA-13032: Invalid NULL SDO_GEOMETRY object
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 333
The location fields in my table are points defined by
SDO_GEOMETRY(2001,8307,SDO_POINT_TYPE(<longitude>,<latitude>,null),null,null)
I can create a valid SDO_GEOMETRY on the line string. I only receive this error when I try to compare the points and line string with the SDO_WITHIN_DISTANCE.Oops, I finally see what I did wrong. My SDO_GTYPE was wrong 2003 should have been 2002.
-
How to find whether MIRO is done for a PO
Hi All,
Is there any indicator attached to POs that indicates whether MIRO is done for that PO?
I mean after PO creation in ME21N -> GR in MIGO -> Excise (if applicable) and -> MIRO... how to find whether MIRO is done for a particular PO?
Helpful tips will be gratefully rewarded...
Regards,
KarthikSee if an entry exist in EKBE for the PO Number and its items.
The complete process though is, to find the GR Quantity for each PO Item and see if it matches with the PO Item quantity.
SELECT EBELN
EBELP
MENGE
LOEKZ
FROM EKPO
INTO TABLE LT_EKPO
WHERE EBELN = P_EBELN.
IF NOT LT_EKPO[] IS INITIAL.
SELECT EBELN
EBELP
MENGE
BEWTP
GJAHR
BELNR
BUZEI
SHKZG
FROM EKBE
INTO TABLE LT_EKBE
FOR ALL ENTRIES IN LT_EKPO
WHERE EBELN = LT_EKPO-EBELN
AND EBELP = LT_EKPO-EBELP
AND VGABE = '1'.
ENDIF.
LOOP AT LT_EKBE.
* Change the sign of the quantity for debit
IF LT_EKBE-SHKZG = C_SHKZG_H.
LT_EKBE-MENGE = -1 * LT_EKBE-MENGE.
ENDIF.
MOVE-CORRESPONDING LT_EKBE TO LT_EKBE_SUM.
COLLECT LT_EKBE_SUM INTO LT_EKBE_SUM.
CLEAR LT_EKBE_SUM.
ENDLOOP.
loop at it_ekpo.
** For each line item, calculate the total GR Quanity
READ TABLE LT_EKBE_SUM WITH KEY EBELN = LT_EKPO-EBELN
EBELP = LT_AWKEY-EBELP.
IF SY-SUBRC = 0.
* If the PO Item Quantity is equal to GR Quantity
IF LT_EKPO-MENGE <= LT_EKBE_SUM-MENGE.
* The PO Item can be considered completed GRed
ENDIF.
ENDIF.
ENDLOOP. -
How to programatically find whether excel is installed in a client system o
Hi all,
I am developing a web application and need to send the op as excell so that end user sees it in excel format..
how could i find whether he is having excel instaled in the system or not...dont cross post
-
Need a Query to find whether the database needs any media recovery...
Hi,
I am at the mount stage of a database and yet be opened.at this stage any Query is available or any other way is there to find whether the database needs any media recovery or Instance recovery..?
my objective is before opening the database i need to make sure it is consistent or inconsistent and any form of recovery is needed..
thanks ®ards,
Ragunath
Edited by: ragu.dba.in on Mar 6, 2013 12:57 AMHi Ragunath,
Use these queries , SCN should be consistent .. no fuzzy files, check for recovery of files in v$recover_file .. pass sufficient archives & fulfill the checks before open reset-logs
set line 900
set pages 900
set echo on
alter session set nls_date_format='dd-mon-yyyy hh24:mi:ss';
set numwidth 13
col CHECKPOINT_CHANGE# for 9999999999999999
col CHANGE# for 9999999999999999
column error format a10
column member format a60
show parameter db_recover
select * from v$recover_file;
select file#, status from v$datafile;
select file#, checkpoint_change#, checkpoint_time, error from v$datafile_header;
select distinct status from v$backup;
select distinct checkpoint_change# from v$datafile_header;
select hxfil file_id, fhscn scn, fhthr thread, fhrba_seq sequence, fhsta status from x$kcvfh;
select distinct fhscn from x$kcvfh;
select hxfil file_id, fhtnm tablespace_name from x$kcvfh;
##### Fuzzy Check ####
alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS';
set feedback on
set heading on
set pagesize 1000
set linesize 175
column checkpoint_change# format 999999999999999999999
select status, checkpoint_change#, fuzzy,
to_char(checkpoint_time, 'DD-MON-YYYY HH24:MI:SS') as checkpoint_time,
count(*)
from v$datafile_header
group by status, checkpoint_change#, fuzzy, checkpoint_time
order by status, checkpoint_change#, fuzzy, checkpoint_time;Thanks,
Ajay More
http://www.moreajays.com -
How to find whether the created Sales Order is with BOM or without BOM ?
Hello,
I am technical guy i want to find whether the created sales order is with BOM or without bom.
Can anyone help me with table details.
Regards
VEk@Go to TVAP & in FIELD STRUM give 'A' & PSGRP as 'SD01'.It will giveyou all the Item categories maintained in BOM.
Now you can cross - check with the Item Category maintain in the Sales Order.
Best Regards,
Ankur -
Finding first numeric in string
Hi,
I am trying to find a way I can find the first numeric in a string.
This works but I have to do it 10 times:
String vtemp = vdoc.indexOf('1');Example of data:
AB123
CDE456
ABCD789I am trying to find a way to do something like: indexOf(any number); So I can get the result in one line of code.
Thanks for any helpHi GaryJSF,
You have to convert your string into an array of characters and for each character, check if it's a digit until you find the first one :
String str = "ABC123";
char[] crs = str.toCharArray();
for (int i = 0; i < crs.length; i++) {
if (Character(crs).isDigit()) {
System.out.println("first index = " + i);
break; -
Query engine : Can not find DSN in Connection String
DearSir/Madam,
Opearating System Windows 7 Professional(32-bit).
I am using Application, which is developed : Visual basic 6.0(32-bit), Report Writer : Crystal Report 9.2.693(32-bit) and database: Oracle 9.2.0.10(32-bit).
ODBC Data source : System DSN created and Connection established (Based on Driver : CR ORACLE ODBC Driver 4.10 (cror818.dll))
In windows 7 environment Data Base connectivity and data fetching also wroking fine.
My problem is while running reports it display error as "Query engine : Can not find DSN in Connection String"
I want run time reports.
For your kind information, at the same time in Windows XP Professional there is no problem found and working fine.
Kindly help me.
Thanks and regards,
SwarupCrystal Reports 9.x is not supported on Win 7. See the following wiki:
http://wiki.sdn.sap.com/wiki/x/b4JiAw
- Ludek -
I have a labview sub-VI reading the string being outputted by a pH meter. The meter outputs a 5 line string and labview is only reading up to each lines carriage return, there-by giving me 5 separate strings is there anyway to rectify this and have the 5 line read as one string?
NAS1
St Petersburg FL
Labview 2010Yes, LabVIEW will automatically update. What happens is that the old serial functions still exist in 7.1 and above but the code (the block diagram) has been modified to use VISA functions. Older versions of LabVIEW are fully supported in this manner. The only way you can avoid the automatic update is to have the old serial functions in an llb and your top level VI refer to these. Having any VI that was part of vi.lib in an llb is a very bad idea and the way to fix things is to remove any VIs in the llb that are part of the LabVIEW distribution.
I don't remember how the old serial config worked and what the new version does with the VISA Configure Serial Port. Your program should only have a single serial config and you might just be able to directly replace that with the VISA configure Serial Port. -
How to display two-lines strings item
Hi,
How can I display list of two-line string items? Each Item in the list should have a phone number and a time. It should look similar to the "dialled numbers" display where each item has an image, and two-line string.
Is it possible doing it with the high-level API or should I go low-level?
Thanks in advance
Imzadiuse: list.setFitPolicy(Choice.TEXT_WRAP_ON)
-
Windows PowerShell is a powerful command tool and we can use it for management and operations. In this article we introduce the detailed steps to use Windows PowerShell to find and replace test string in the
shapes in Excel Object.
Since the Excel.Application
is available for representing the entire Microsoft Excel application, we can invoke the relevant Properties and Methods to help us to
interact with Excel document.
The figure below is an excel file:
Figure 1.
You can use the PowerShell script below to list the text in the shapes and replace the text string to “text”:
$text = “text1”,”text2”,”text3”,”text3”
$Excel
= New-Object -ComObject Excel.Application
$Excel.visible = $true
$Workbook
= $Excel.workbooks.open("d:\shape.xlsx")
#Open the excel file
$Worksheet
= $Workbook.Worksheets.Item("shapes")
#Open the worksheet named "shapes"
$shape = $Worksheet.Shapes
# Get all the shapes
$i=0
# This number is used to replace the text in sequence as the variable “$text”
Foreach ($sh in $shape){
$sh.TextFrame.Characters().text
# Get the textbox in the shape
$sh.TextFrame.Characters().text =
$text[$i++]
#Change the value of the textbox in the shape one by one
$WorkBook.Save()
#Save workbook in excel
$WorkBook.Close()
#Close workbook in excel
[void]$excel.quit()
#Quit Excel
Before invoking the methods and properties, we can use the cmdlet “Get-Member” to list the available methods.
Besides, we can also find the documents about these methods and properties in MSDN:
Workbook.Worksheets Property (Excel):
http://msdn.microsoft.com/en-us/library/office/ff835542(v=office.15).aspx
Worksheet.Shapes Property:
http://msdn.microsoft.com/en-us/library/office/ff821817(v=office.15).aspx
Shape.TextFrame Property:
http://msdn.microsoft.com/en-us/library/office/ff839162(v=office.15).aspx
TextFrame.Characters Method (Excel):
http://msdn.microsoft.com/en-us/library/office/ff195027(v=office.15).aspx
Characters.Text Property (Excel):
http://msdn.microsoft.com/en-us/library/office/ff838596(v=office.15).aspx
After running the script above, we can see the changes in the figure below:
Figure 2.
Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.Thank you for the information, but does this thread really need to be stuck to the top of the forum?
If there must be a sticky, I'd rather see a link to a page on the wiki that has links to all of these ForumFAQ posts.
EDIT: I see this is no longer stuck to the top of the forum, thank you.
Don't retire TechNet! -
(Don't give up yet - 13,085+ strong and growing) -
Find and Replace text string in HTML
Opps... I hope this forum is not just for Outlook. My Html files reside on my hard-drive. I am looking for VBA code to open specified file names ####File.html and then find and replace text strings within the html for example "####Name" replaced
with "YYYYY"
I drive the "####File.html" names and the find and replace text strings from an Excel sheet. I am an artist and this Sub would give me time to paint instead of find and replace text. Thank you!
[email protected]Hello Phil,
The current forum is for developers and Outlook related programming questions. That's why I'd suggest hiring anybody for developing the code for you. You may find freelancers, for example. Try googling for any freelance-related web sites and asking such
questions there.
If you decide to develop an Outlook macro on your own, the
Getting Started with VBA in Outlook 2010 article is a good place to start from.
Maybe you are looking for
-
Safari 5.1.2 is now a relief to use....
It has been a while but now Safari 5.1.2 is almost the perfect browser to use. Since 5.1 was released and dropped for use by me with all of its shortcomings and shenangins, I can now say that I am most pleased to use the updated version; it is now v
-
Trying to turn the background black and white in lightroom 5. Using the adjustment brush. It isn't working.
-
I have configured my tablet to run Gallery when it is placed in the cradle. I have not been able to find ANY settings that allow me to change the timing on each photo, nor the zoom action. The apparent default of 3 seconds is way too fast and I do no
-
I'm a real newbie to iweb. I created a website and can find it by clicking the "visit" button at the bottom of the page where I created site but when I go to Google or other search engines and type in the site name, it doesn't show up. Can someone te
-
Hi Everyone. On My Home ASA i checked the logs it has few logs of Apr 16 2013 21:36:39: %ASA-7-710005: UDP request discarded from 192.168.52.7/7765 to inside:255.255.255.255/7765 where 192.168.52.7 is my PC IP. Need to know why this message is show