Hi James,

What I am doing is like that. I am reading the points from an XML
file. & right now, trying to figure out a math.
Somehow, somewhere there is a problem with this code & I cant seem to
find where.
See, If u can find.

*********************************************Code STarts
Here********************************************************
function testPolyArray2()
{
//********************************************Initilize Lat & Long &
Create Array***********************************
  for(var p = 0; p < dataArray.length; p++)
  {
        ptsg3.push (new GLatLng(dataArray[p][0], dataArray[p][1]));
  }
//
********************************************************************************************************************
var newStpt =0;
var yul =0;
var njStart=0;
var newBreak =1;
  for(var p = newStpt; p < dataArray.length; p++)
  {
        for(var o = p+1; o < dataArray.length; o++)
        {
  var def = dataArray[p][0] + "," + dataArray[p][1]
        var lef = dataArray[o][0] + "," + dataArray[o][1]
        if(def == lef)
  {
                                                                for(var yu 
=newBreak;yu<o;yu++)
                                                                //for(var yu 
=0;yu<172;yu++)
                                                {
                                                var str = String(ptsg3[yu]);
                                                str = str.replace("(", " ");
                                                str = str.replace(")", " ");
                                                holdop = str.split(',')
                if(o > 296)
                                                                {
                                                                
//alert("Breaking.....");
                                                                break;
                                                                }
                                                                else
                                                                {
                                                                
getDistance[yul] = calcDist(dataArray[o+1][1],dataArray[o+1]
[0],holdop[1],holdop[0])
                                                                }
                                                myarray[yul] = getDistance[yul] 
+ "--" + holdop[1] + "," +
holdop[0]
                                                
//document.getElementById("selected").value =
document.getElementById("selected").value + myarray[yul] + "\n";
                                                                yul = yul +1;
                                                }
                                                                //alert(o+1);
                                                                
document.getElementById("selected").value =
document.getElementById("selected").value + "\n***Start Group***\n";
                                                                
//alert(dataArray[o+1][1] + " , " + dataArray[o+1][0]);
                                                                yul =0;
                                                var getMin = getDistance.min();
                                        //alert("The Smallest Point is: " + 
getMin + " And the Break
point is:" + o);
                                      newBreak = o;
                                                for(var mj 
=0;mj<myarray.length;mj++)
                                                {
                                                                
//alert(myarray);
                                                        if(Left(myarray[mj], 8) 
== Left(getMin, 8))
                                                        {
                                                                var mjSplit = 
myarray[mj].split("--");
                                                                var findStr = 
Left(mjSplit[1],mjSplit[1].search(/,/i));
                                                                findStr1 = 
Mid(mjSplit[1], mjSplit[1].search(/,/i)+2,
mjSplit[1].length)
                                                                var newrt = 
String("(" + trimAll(findStr1) + ", " +
trimAll(findStr) + ")");
                                                                var newmj = 
FNArrayGetSearchLinearRowI(newrt,ptsg3);
                                                        //alert("Start Slicing 
from: " + newmj + " to :" + o + "Then
From: " + njStart + " to: " + eval(newmj+1));

                                                        var str4 = 
ptsg3.slice(njStart,newmj+1);
                                                        var str5 = 
ptsg3.slice(newmj,o);
                                                        var newStr2 = str5 + 
"," + str4
                        var mySplitResult = newStr2.split("),");
                                                                                
                //alert(mySplitResult.length);
                                                                        for(var 
kl
=0;kl<mySplitResult.length-1;kl++)
                                                                        {
                                                                        var 
abcd =
mySplitResult[kl].replace("(","");
                                                                        var 
mySplit2 = abcd.split(",");
                                                                        
ptsgNew2.push(new GLatLng(mySplit2[0],mySplit2[1]));
                                                                        }

                                                                                
                njStart = ptsgNew2.length + 1;
                                                                                
                getDistance.length =0;
                                                                myarray.length 
=0;

                                                        }
                                                    }
        newStpt = o;
        }
        }
//break;
  }
poly2 = new GPolygon(ptsgNew2,"#000000",1,1,"#0000FF",0.5,
{clickable:false});
map.addOverlay(poly2);
map.setCenter(new GLatLng(dataArray[dataArray.length-1][0],
dataArray[dataArray.length-1][1]), 11);
}
**************************************************************************************************************************

On Oct 15, 2:33 pm, jameslove <[EMAIL PROTECTED]> wrote:
> Hi Sunny,
> Why don't know where the second polygon starts?  Are you talking about
> a series of polygons which are contained within one series of points
> but you need to break them out into a series of polygons? If this is
> the case, I'd look for differences in proximity. If the polygons are
> sufficiently far enough apart, you could differentiate them that way.
> This seems so unique you'll need to figure out the math yourself,
> since finding an existing algorithm seems doubtful.
>
> -James Love
> Vernon, BC
> Canadawww.jameslove.com
>
> On Oct 15, 11:25 am, Sunny <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > Do anyone Know, How we can reorder the polygons based on points.
> > Like If you have coordinates for three polygons.But you dont know,
> > from where the second polygon starts. You loop through the points &
> > See, where the first polygon ends., when It ends, you take the next
> > point, where first one ends & again search where this one ends.
> > Some algorithm to arrange these points may help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to