> I do have excel (2010 and 2013), so please send it.
>
> The coords you sent should also server for debugging. I'll give them
> a go.
>
> Regards,
> Shawn.
>
>
> On Mon Feb 10 15:29:57 2014, daniel.smith@baesystems.com wrote:
> > Hi
> > I will do that tomorrow, I am at work at the moment and going home
> > soon
> > Do you have excel by the way, if so I can send you an excel 2010 (or
> > 2003 if you like) analysis of what goes wrong
> >
> > In my original ticket, I mentioned shapes {0,10,0,10} and
> > {1,11,1,9},:
> > If you make one of those into a shape, and the other into a bounding
> > box, you will see that the existing code says they do not overlap,
> > but
> > my improved code says they do overlap. If you draw them they
> > obviously
> > overlap too.
> >
> >
> >
> > Daniel Smith
> > Radar Systems Engineer, Sampson
> > BAE Systems Maritime Services,
> > Newport Road,
> > Cowes,
> > Isle of Wight, PO31 8PF, UK
> > I: +44 (0) 198320 2937
> > :: daniel.smith@baesystems.com / www.baesystems.com
> >
> > BAE Systems Integrated System Technologies Limited
> > Registered Office: Warwick House, PO Box 87, Farnborough Aerospace
> > Centre, Farnborough, Hants, GU14 6YU, UK.
> > Registered in England & Wales No: 3456325
> >
> > Please consider the environment before printing this email.
> >
> >
> > -----Original Message-----
> > From: Shawn Laffan via RT [mailto:bug-Geo-ShapeFile@rt.cpan.org]
> > Sent: 10 February 2014 20:13
> > To: Smith, Daniel E (UK)
> > Subject: [rt.cpan.org #89563] Shapes_In_Area Function is incorrect
> >
> > ----------------------! WARNING ! ---------------------- This message
> > originates from outside our organisation, either from an external
> > partner or from the internet.
> > Consider carefully whether you should click on any links, open any
> > attachments or reply.
> > Follow the 'Report Suspicious Emails' link on IT matters for
> > instructions on reporting suspicious email messages.
> > --------------------------------------------------------
> >
> > <URL:
https://rt.cpan.org/Ticket/Display.html?id=89563 >
> >
> > Thanks for the response Daniel.
> >
> > Could you send me the URL for the shapefiles? And also send me a
> > bounding box which did not work? That way I can replicate the issue
> > on
> > my machine.
> >
> > Don't worry about the pull request and test suite. They're useful if
> > you're able to edit the code and provide fixes via git (see, for
> > example,
https://help.github.com/articles/using-pull-requests ).
> >
> > Regards,
> > Shawn.
> >
> >
> >
> >
> > On Mon Feb 10 07:08:06 2014, daniel.smith@baesystems.com wrote:
> > > Thanks for getting back to me Shawn!
> > > I may need a bit of hand holding
> > > What I have here is a bugfixed version which I am using, I tested
> > > it
> > > as follows:
> > >
> > > I downloaded a set of shapefiles which cover the whole of the earth
> > > (openly available fom nasa) I tested the new shapefile routines by
> > > using them to pull out the shapes that overlap with a lat long box,
> > > and seeing that when I found the shapes in a box containing (say)
> > > the
> > > arabian gulf, or the uk, I could plot those shapes in an excel
> > > chart
> > > and the resultant map looked like the correct bits of the
> > > coastline.
> > >
> > > This was good enough for my purposes, but probably not what you
> > > need
> > > because:
> > >
> > > a) The test data set is huge.
> > > b) The pass criteria is subjective
> > >
> > > What we really need is a small set of simple polygons that
> > > definitely
> > > overlap with a box but were not detected by the old routines and
> > > are
> > > by the new one.
> > >
> > > However I also do not really know what you mean by "a pull
> > > request",
> > > or how to integrate my tests into the "test suite".
> > >
> > > Daniel Smith
> > > Radar Systems Engineer, Sampson
> > > BAE Systems Maritime Services,
> > > Newport Road,
> > > Cowes,
> > > Isle of Wight, PO31 8PF, UK
> > > I: +44 (0) 198320 2937
> > > :: daniel.smith@baesystems.com / www.baesystems.com
> > >
> > > BAE Systems Integrated System Technologies Limited Registered
> > > Office:
> > > Warwick House, PO Box 87, Farnborough Aerospace Centre,
> > > Farnborough,
> > > Hants, GU14 6YU, UK.
> > > Registered in England & Wales No: 3456325
> > >
> > > P Please consider the environment before printing this email.
> > >
> > > -----Original Message-----
> > > From: Shawn Laffan via RT [mailto:bug-Geo-ShapeFile@rt.cpan.org]
> > > Sent: 09 February 2014 08:19
> > > To: Smith, Daniel E (UK)
> > > Subject: [rt.cpan.org #89563] Shapes_In_Area Function is incorrect
> > >
> > > ----------------------! WARNING ! ---------------------- This
> > > message
> > > originates from outside our organisation, either from an external
> > > partner or from the internet.
> > > Consider carefully whether you should click on any links, open any
> > > attachments or reply.
> > > Follow the 'Report Suspicious Emails' link on IT matters for
> > > instructions on reporting suspicious email messages.
> > > --------------------------------------------------------
> > >
> > > <URL:
https://rt.cpan.org/Ticket/Display.html?id=89563 >
> > >
> > > Hello Dan,
> > >
> > > Development for this module is now on github.
> > >
https://github.com/shawnlaffan/Geo-ShapeFile
> > >
> > > Are you able to submit a pull request with these changes, and
> > > ideally
> > > some tests or an update to the test suite?
> > >
> > >
> > > Thanks,
> > > Shawn.
> > >
> > >
> > >
> > > On Wed Oct 16 11:49:28 2013, daniel.smith@baesystems.com wrote:
> > > > The Shapes in Area function misses out a LOT of overlapping
> > > > shapes
> > > > because of an erroneous check_in_area test Here it the essential
> > > > part of check_in_area it stands:
> > > > my $lhit = self->between(x1_min,$x2_min,$x2,max);
> > > > my $rhit = self->between(x1_max,$x2_min,$x2,max);
> > > > my $thit = self->between(y1_min,$y2_min,$y2,max);
> > > > my $bhit = self->between(y1_max,$x2_min,$x2,max);
> > > > return (#collision
> > > > ($lhit && $thit) || ($rhit && $thit) || ($lhit && $bhit) ||
> > > > ($rhit
> > > > &&
> > > > $bhit)
> > > > ) || ( #containment
> > > > ($lhit && $thit) || ($rhit && $thit) || ($lhit && $bhit) ||
> > > > ($rhit
> > > > &&
> > > > $bhit)
> > > > );
> > > >
> > > > This is does not return true if the two areas overlap on one
> > > > side
> > > > only, it only fires if at least one corner of each shape is
> > > > within
> > > > the other (or one contains the other) For instance the areas
> > > > {0,10,0,10} and {1,11,1,9}, which are obviously overlapping, are
> > > > not
> > > > detected by the algorithm because:
> > > > between(x1_min,$x2_min,$x2,max) FALSE
> > > > between(x1_max,$x2_min,$x2,max) TRUE
> > > > between(y1_min,$y2_min,$y2,max) FALSE
> > > > between(y1_max,$x2_min,$x2,max) FALSE Since only one of the tests
> > > > is
> > > > true the algorithm returns false because it needs at least two of
> > > > the tests to fire.
> > > >
> > > > A working algorithm only needs one line as follows:
> > > > return !($x1_min > $x2_max or $x1_max < $x2_min or $y1_min >
> > > > $y2_max or $y1_max < $y2_min);
> > > >
> > > > This has the beneficial side effect that it fires if A contains B
> > > > AND if B contains A, as well as if they overlap Therefore the
> > > > call
> > > > to check_in_area in "shapes_in_area" can be optimised from the
> > > > current:
> > > > If ($self->check_in_area(@p,@area) ||
> > > > $self->check_in_area(@area,@p)) {
> > > >
> > > > To
> > > >
> > > > If ($self->check_in_area(@p,@area)) {
> > > >
> > > > Hope that is clear, if not contact me for a patch.
> > > > Dan Smith
> > > > ********************************************************************
> > > > This email and any attachments are confidential to the intended
> > > > recipient and may also be privileged. If you are not the intended
> > > > recipient please delete it from your system and notify the
> > > > sender.
> > > > You should not copy it or use it for any purpose nor disclose or
> > > > distribute its contents to any other person.
> > > > ********************************************************************
> > >
> > >
> > >
> >
> >
> >