I am working with a stream of coordinate data to plot points on a map in realtime. I want this data to expire based on age, so I'm using a
ring buffer to store the data, and overwrite in a FIFO manner. When I get to around 1500 points, the frame rate in my program starts to drop off severely. This causes my queue of coordinate data to get backlogged. So, I have to severely limit the size of the ring buffer (ends up being about 1000 coordinates, or a minute of data) to keep the data flowing properly.
My question is: what's an efficient way to store this data, display it, and expire it? Should I be able to draw 1500+ points of coordinate data from a ring buffer, or other data structure? I can't just store the state of the display output after each plot, since I need to eventually expire all displayed points. Ideas?
I am trying to display (many) points on a map from a stream of coordinate data. Specifically, I want to display the locations of IP addresses on a world map. I thought I had the hard part out of the way, and I usually figure these things out by myself, but I'm having some trouble finding a way to actually
display the data that I am generating. I hope that this is a general design problem, and not some limitation. Some background:
I'm using the jflow library to capture IP addresses from a router in real-time.
I'm using the GeoIP library to generate long/lat coordinates from these IPs.
I plan on using the Unfolding library to display maps, and draw points.
I'm using Processing (through Eclipse) to draw the output.
I am able to capture and print IP addresses and coordinates to the console. However, I cannot find a way to actually USE this data within the Processing draw() method. I think that this is because the jflow library collects (and does whatever else you want) in a separate accounting thread. "
Note that the collector is multithreaded. Calling start will start collecting in the background, the call will return immediately." If this is the case, what's the best way to access and draw the incoming data? Some kind of IPC? Somehow make the IP collection thread use the draw() method?
Below is an example IP collection class, with some edits showing how I would like to use it. What can I do with this separate thread?
This might lead to other questions, like, should I somehow run the draw() method at a constant rate and asynchronously update it with incoming data from the IP collection thread? Any advice is welcome. Please let me know if anything is not clear.
import java.net.InetAddress;
import java.net.SocketException;
import java.net.UnknownHostException;
import nettrack.net.netflow.*;
import com.maxmind.geoip.*;
import com.maxmind.geoip.Location;
public class V5Printer
{
static class PrintAccountant
implements Accountant
{
public void account(Flow f)
{
//method nest below are not real, just illustrating intent.