PHP Classes

not working class

Recommend this page to a friend!

      PHP Concave Hull  >  All threads  >  not working class  >  (Un) Subscribe thread alerts  
Subject:not working class
Summary:Division by zero
Messages:15
Author:John York
Date:2014-04-06 07:20:41
Update:2014-05-10 00:23:54
 
  1 - 10   11 - 15  

  1. not working class   Reply   Report abuse  
Picture of John York John York - 2014-04-06 07:20:41
Hello,
I downloaded and run your phpclass but - receive this error:


Warning: Division by zero in ../concave-hull.php on line 226

Warning: Division by zero in ../concave-hull.php on line 248

  2. Re: not working class   Reply   Report abuse  
Picture of Chi H. Chi H. - 2014-04-07 10:06:57 - In reply to message 1 from John York
Hello,
Can you try again please? It's just a warning not a functional error. Anyway I make php to ignore all errors. Thank you!

  3. Re: not working class   Reply   Report abuse  
Picture of Daniel Fischer Daniel Fischer - 2014-05-09 01:08:24 - In reply to message 2 from Chi H.
Very interesting class, which I would like to get working for me!

How would I go about using it to build an array of points of the concavehull itself? I've tried a few things, but nothing has worked so far. When mapping the hull, the lines zig-zag instead of surrounding the provided points.

Any advice you have would be greatly appreciated.

  4. Re: not working class   Reply   Report abuse  
Picture of Chi H. Chi H. - 2014-05-09 07:27:02 - In reply to message 3 from Daniel Fischer
You can also contact me.

  5. Re: not working class   Reply   Report abuse  
Picture of Daniel Fischer Daniel Fischer - 2014-05-09 23:04:06 - In reply to message 4 from Chi H.
Thanks for your reply!

Perhaps this class is not well suited to latitude / longitude?

Your included example (example 3), does not appear to produce an image that could be considered useful. and its that very example I am most interested in returning an array of point for.

  6. Re: not working class   Reply   Report abuse  
Picture of Chi H. Chi H. - 2014-05-09 23:25:42 - In reply to message 5 from Daniel Fischer
Interesting. Perhaps the co-ordinates is not interesting? Interesting that you are working on my example #3? Not sure what it's not working? Can you elaborate? Where it's not working? By the way you can look here a working version:http://www.phpdevpad.de/geofence/.

  7. Re: not working class   Reply   Report abuse  
Picture of Daniel Fischer Daniel Fischer - 2014-05-09 23:35:06 - In reply to message 6 from Chi H.
Thanks again for your reply!

When I run your example #3, the image produced looks like this:

drive.google.com/file/d/0B2o_34PKlX ...

I viewed your webpage and it seems to run well there. I am trying to represent a MUCH smaller geographical location than a country.

Ideally I would like to be able to return an array of coordinates which represent the hull, but I can see no way of doing that as the input array is resorted.

  8. Re: not working class   Reply   Report abuse  
Picture of Chi H. Chi H. - 2014-05-09 23:51:58 - In reply to message 7 from Daniel Fischer
Yes, it works. I won a prize! Not sure why I must defend myself? Can you post it? Usually geo-coordinates are angles and the map is 2d. In my script there is mapWidth and mapHeight. Maybe you can play with it?

  9. Re: not working class   Reply   Report abuse  
Picture of Daniel Fischer Daniel Fischer - 2014-05-10 00:17:40 - In reply to message 8 from Chi H.
Sir you misunderstand me. I am not asking you to defend yourself at all. I was asking for your help. Sorry if it was unclear. I will find another solution.

Congratulations on your prize.

  10. Re: not working class   Reply   Report abuse  
Picture of Chi H. Chi H. - 2014-05-10 00:20:03 - In reply to message 7 from Daniel Fischer
Hmm, I see. There was an error. The projected map wasn't stored or saved and give to the function. I fixed it, cam you try again? Jusst in case here is the fix:

foreach ($set as $key => $arr)
{
list($lon,$lat) = $arr;
$tx = ($lon - $mapLonLeft) * ($newWidth/$mapLonDelta)*$mapRatioW;
$f = sin($lat*M_PI/180);
$ty = ($mapHeightD-(($worldMapWidth/2 * log((1+$f)/(1-$f)))-$mapOffsetY));
$proj[]=array($tx,$ty);
}

$hull=new hull();
$hull->main($proj,$mapWidth,$mapHeightD);



 
  1 - 10   11 - 15