On 02/22/2015 12:18 PM, office76#xt wrote:
Hi,
This may sound like some ones homework but its really an algorithm
question I have.
Imagine you had a square plot of land. You could assign this to a grid and
create a two dimensional graph with an X and Y-axis. Now imagine an inner
square plot that's a wildlife sanctuary. Now you fly a camera drone over the
outer plot and photograph all the pelicans nesting there. So your covering
the outer plot and the inner sanctuary plot. Now you digitize the photo,
enabling you to turn the pelicans into points on the X & Y graph. Then you
take these X & Y points and either put them in a serial file or a
spreadsheet.
Now you want to filter the data, going through the X, Y pairs, and finding
only those within the boundaries of the inner sanctuary plot. If you could
do that you could count the pelicans, now represented by X, Y coordinates in
your database, within the sanctuary.
Say the outer plot is X = 20 and Y = 20. And the inner plot goes from 4 to 7
on the X axis and from 6 to 9 on the Y axis.
If you were reading your data into a BASIC program, you could use code like:
If (X > = 4 AND X < = 7) AND (Y > = 6 AND Y < = 9) THEN Count = Count + 1
This would look in the inner sanctuary boundaries, and if the data fell
within its boundaries, you'd increment a counter to count the pelicans.
This is great if the inner plot is rectangular. My question is, what if its
irregular like a kidney shaped swimming pool? What would the filter code
look like?
I'm not asking for you to solve the problem here for me. I'm asking for any
pointers to stuff on the web that may be applicable to this question. There
must be a name for this problem but I really don't know what it is or where
to start looking.
Any ideas appreciated.
--
View this message in context:
http://nabble.documentfoundation.org/Filter-algorithm-question-tp4141022.html
Sent from the Users mailing list archive at Nabble.com.
This should be problem that has occurred before, how to map and count
instead a non-geometrical shape. I am not sure if something like Google
Maps or Mapquest may have an API for something like this.
Depending on your programming skills, you might solve using a mapping
protocol/API using data file as the input.
Jay
--
Jay Lozier
jslozier@gmail.com
--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.