Regd. map grid structure in GPS data mining - gps

I have been exploring the GPS data mining literature esp. for problems like anomalous trajectory detection, time travel prediction, etc and one very common method I see is dividing the data or map into grids. Can any one please explain the logic of this? Are the coordinates euclidean in this case? Is grid decomposition really necessary?
I would be grateful if someone can also give/ quote some links or materials I should explore. I am new to this field, so please pardon me if the question is very obvious.
Thanks & Regards,
Lesnar

No they are not euclidean. But they don't have to be. The grids are not rectangles anymore, but can be treated as such for some operations.
If you create a lat/long grid, then each cell by means of meters is not rectangular. However it defines a zone where you add a counter, which has a clear inside/outside definition. And you can use cartesian operations (Rectangle.inside())
So the lat / lon span is constant for each cell, but not the longitudinal meters span, which shrinks by cos(latitude).
If one needs a grid with equal grid cells sizes by means of meters, then one
has to transform the geo coordinates before.

Related

Calculating heading value in a quad copter

I'm building an autonomous quad copter I'm trying to move the quad to a target GPS co-ordinate, I'm calculating the distance of the target using haversine formula, and now I want to calculate the heading.
For example, I want the quad to turn to the direction of the target and move forward until it reaches the destination (this part is already done).
How do I calculate the yaw so that it turns to the direction of target?
Calculating it using only the GPS co-ordinates is very inaccurate. If I use a magnetometer, the declination angle changes from place to place.
How do I calculate this? How does ardu pilot do this calculation?
One way to develop control algorithms that deal with inaccurate measures is to combine different measures by some sort of filtering. In that sense, your set point reference is built based on both GPS and magnetometer measures.
There are several ways to accomplish this task. Many applications use data fusion based on Kalman Filters. The general idea is that you are going to use a predictor (or state observer) to achieve a better estimate of the heading. I suggest some research on these topics: data fusion, Kalman filtering.
Here is an example:
http://scholarscompass.vcu.edu/cgi/viewcontent.cgi?article=4188&context=etd

Paraview. Volume fraction and/or mass flow rate

My goal is to achieve something that was previously asked in this site (outside from SO). In this external site the questions is unanswered, and in order to give more visibility and to try to get an answer I translate it to here:
The issue is:
I have a small simulation of particles flowing through a wire mesh structure, and I'm interested in calculating the mass flow rate and volume fraction of particles at certain cross sections. I think I understand how to calculate mass flow rate by setting up small regions and dumping particle count and velocity from that region. I assume that volume fraction works in a similar fashion, except I only need to know the size of my particles and my dump region.
What I'm wondering is this - is it possible to do these things in Paraview? I can set up planes and slices and such, but I can't seem to extract much useful information out of them.
Further on down the road, what I would like to do would be to plot contours of volume fraction at certain planes, and plot the volume fraction along the vertical axis so I can see how high the particles are piling up on top of the screen, based on particle size, wire size, etc. Can Paraview do any of this?
This is a visualization issue. I don't know how make it with Paraview. The idea is count how much particles cross the slice.
My first approach was piped: DataReader | Spherical Glyph | Slice with normal fixed handly along z axis but nothing results. Also I tried to adding the filter Surface Flow and nothing too. Probably I am piping the data in a bad way.
To see the pipelining process I add an image (focus in PlotOverLine1 and its above pipes):

Optimizing the Layout of Arbitrary Shapes in a Plane

I am trying to create an algorithm that can take a set of objects and organize them in a given area such that a box bounding all of the shapes is optimized (either by area used, or by maximizing the span along one of the dimensions, etc.). All of the shapes are closed and bounded.
The purpose of this is to try and minimize material waste from using a laser cutter. The shapes are generated in CAD and can read into this algorithm. The algorithm will then take arguments for the working area (effective laser cutting area) as well as the minimum separation between any two objects, then attempt to organize the objects within the specified dimensions while trying to minimize the area usage. Alternatively, the algorithm can also try to maximize the object locations along one axis while minimizing the span along the other dimension. This would be akin to cutting off a smaller workpiece to cut from.
Ideally, the algorithm would be able to make translations AND rotations, but rotations aren't necessary.
For example, this Picture depicts the required transformation.
It should work with an arbitrary, but small (<25) number of objects.
Lastly, I don't expect anyone to solve this for me, but I would appreciate help toward either finding an algorithm that can do this, or developing my own. Thank you.
I dont know to what extent you want to create said algorithm or how you want to implement it, But i know of a program called OptiNest that can do what you ask. It organizes geometric shapes to optimize the layout and minimize waste on a plane, i think in an autocad format.

transform a path along an arc

Im trying to transform a path along an arc.
My project is running on osX 10.8.2 and the painting is done via CoreAnimation in CALayers.
There is a waveform in my project which will be painted by a path. There are about 200 sample points which are mirrored to the bottom side. These are painted 60 times per second and updated to a song postion.
Please ignore the white line, it is just a rotation indicator.
What i am trying to achieve is drawing a waveform along an arc. "Up" should point to the middle. It does not need to go all the way around. The waveform should be painted along the green circle. Please take a look at the sketch provided below.
Im not sure how to achieve this in a performant manner. There are many points per second that need coordinate correction.
I tried coming up with some ideas of my own:
1) There is the possibility to add linear transformations to paths, which, i think, will not help me here. The only thing i can think of is adding a point, rotating the path with a transformation, adding another point, rotating and so on. But this would be very slow i think
2) Drawing the path into an image and bending it would surely lead to image-artifacts.
3) Maybe the best idea would be to precompute sample points on an arc, then save save a vector to the center. Taking the y-coordinates of the waveform, placing them on the sample points and moving them along the vector to the center.
But maybe i am just not seeing some kind of easy solution to this problem. Help is really appreciated and fresh ideas very welcome. Thank you in advance!
IMHO, the most efficient way to go (in terms of CPU usage) would be to use some form of pre-computed approach that would take into account the resolution of the display.
Cleverly precomputed values
I would go for the mathematical transformation (from linear to polar) and combine two facts:
There is no need to perform expansive mathematical computation
There is no need to render two points that are too close from each other
I have no ready-made algorithm for you, but you could use a pre-computed sin or cos table, and match the data range to the display size in order to work with integers.
For instance imagine we have some data ranging from 0 to 1E6 and we need to display the sin value of each point in a 100 pix height rectangle. We can use a pre-computed sin table and work with integers. This way displaying the sin value of a point would be much quicker. This concept can be refined to get a nicer result.
Also, there are some ways to retain only significant points of a curve so that the displayed curve actually looks like the original (see the Ramer–Douglas–Peucker algorithm on wikipedia). But I found it to be inefficient for quickly displaying ever-changing data.
Using multicore rendering
You could compute different areas of the curve using multiple cores (can be tricky)
Or you could use pre-computing using several cores, and one core to do finish the job.

Algorithm for reducing GPS track data to discard redundant data?

We're building a GIS interface to display GPS track data, e.g. imagine the raw data set from a guy wandering around a neighborhood on a bike for an hour. A set of data like this with perhaps a new point recorded every 5 seconds, will be large and displaying it in a browser or a handheld device will be challenging. Also, displaying every single point is usually not necessary since a user can't visually resolve that much data anyway.
So for performance reasons we are looking for algorithms that are good at 'reducing' data like this so that the number of points being displayed is reduced significantly but in such a way that it doesn't risk data mis-interpretation. For example, if our fictional bike rider stops for a drink, we certainly don't want to draw 100 lat/lon points in a cluster around the 7-Eleven.
We are aware of clustering, which is good for when looking at a bunch of disconnected points, however what we need is something that applies to tracks as described above. Thanks.
A more scientific and perhaps more math heavy solution is to use the Ramer-Douglas-Peucker algorithm to generalize your path. I used it when I studied for my Master of Surveying so it's a proven thing. :-)
Giving your path and the minimum angle you can tolerate in your path, it simplifies the path by reducing the number of points.
Typically the best way of doing that is:
Determine the minimum number of screen pixels you want between GPS points displayed.
Determine the distance represented by each pixel in the current zoom level.
Multiply answer 1 by answer 2 to get the minimum distance between coordinates you want to display.
starting from the first coordinate in the journey path, read each next coordinate until you've reached the required minimum distance from the current point. Repeat.