2015 Archives by date, by thread · List index

# Re: [libreoffice-users] Filter algorithm question

On 02/22/2015 10:02 AM, Jay Lozier wrote:

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

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

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

One thought might be to reduce the size of the square until the squares that overlap are not material. If you are looking for elephants in an irregular spaced area, and the size of the squares are less than the size of an elephant, you're home free. Of course as the size of the square gets smaller, there is more memory involved that more cpu processing time required, but that's what computers are for.

John

--
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