How to interpolate values on geography in QGIS? - qgis

I am trying to interpolate values on the geography and produce a contour map to show the interpolated values.
Thanks for your time!

See this excellent tutorial:
http://www.qgistutorials.com/en/docs/creating_heatmaps.html
Also you might have better luck asking questions about how to use GIS at https://gis.stackexchange.com/

Related

Shoelace formula in PostgreSQL

Quite new in SQL world here.
I have a database with coordinates to different places (x,y)
Have followed This guide to convert those coordinates to cartesian coordinates and create a list of ordered coordinates which form a polygon.
With that done, I now face the challenge of calculating the area of said polygon.
To achieve that, the best option seems to be an implementation of the Shoelace Formula.
I have found different ways to run the calculation in different languages (see here)
and here - page 28, area2d_polygon() function, but have not been successful at all in writing the SQL to perform the same calculation.
PostGIS does not seem to be an option for me here.
Have spent quite a few hours on this one by now. I need to write the SQL that calculates an area in km2 from a list of coordinates that form the polygon.
Any help would be greatly appreciated :)

Efficiently visualise large quantities of points with matlab.

I have a set of 3D points which numbers up around 1 million points. I am looking to visualise these with matlab.
I have tried the following functions:
plot3
scatter3
But they are both very sluggish. Is there a more efficient way to visualise this level of points in matlab? Maybe a way to mesh the points?
If not can anyone suggest a plug-in or even a different program for visualising 3D points?
You're going to run into efficiency issues no matter what plugin/program you use if you want all million+ points to show up in a plot. My suggestion would be to downsample. Use the plot3 or scatter3 function on every other point, or every nth point, until you get a figure that is not sluggish. As long as the variance in your data isn't astronomical, downsampling a little bit shouldn't affect the overall distribution of points (given that you have a million+ points). And any software that is able to display that much data without being sluggish is most likely downsampling/binning or using some interpolation technique to do so (so you might as well have control over it).
fscatter3 from the file exchange, does what you like.
Is there a specific reason to actually have it display that many points?
I Googled around a bit and found some people who have had similar issues (someone suggested Avizo as an alternate program but I've never used it):
http://www.mathworks.com/matlabcentral/newsreader/view_thread/308948
mathworks.com/matlabcentral/newsreader/view_thread/134022 (not clickable because I don't have enough rep to post more than two links)
An alternate solution would be to generate a histogram if you're more interested in the density of the data:
http://blogs.mathworks.com/videos/2010/01/22/advanced-making-a-2d-or-3d-histogram-to-visualize-data-density/
I you know beforehand roughly the coordinates of the feature you are looking for, try passing the cloud through a simple pass-through-filter, which essentially crops your point cloud. I.e. if you know that the feature is at a x-coordinate > 5, remove all points with x-coordinate < 5.
This filter could for the first coordinated be realized as
data = data(data(1,:) > 5,:);
Provided that your 3d data is stored in an n by 3 matrix.
This, together with downsampling, could help you out. If you still find the performance lagging, consider using something like the PCD viewer in PointCloudLibrary, check half way down the page at
http://pointclouds.org/documentation/overview/visualization.php
It is a stand alone app you could launch from matlab. I find it's performance far better than the sluggish matlab plotting tools.
For anyone who is interested I ended up finding a Point cloud visualiser called Cloud Compare. It is extremely fast and allows selection and segmentation as well as filtering on point clouds.

Plotting a decision boundary in matlab

I have two classes of data which are plotted in 2D and I wish to plot the nearest-neighbours decision boundary for a given value of k.
I realise that there is a similar example provided in Matlab's 'classify' help doc, however I do not see how I can use this within the context of k nearest-neighbours.
Thanks,
Josh
I think since you are in 2D space easiest would be to do the brute force approach, iterate over all (x,y) at a fixed resolution. For each point determine its class (or likelihood) and plot the values as an image.

how can i extract feature's of gyroscope,accelerometer and magnetomere?

I am a new learner about sensors. I have no knowledge about this sensors. However I have done some sensor module which contains with accelerometer,gyroscope and magnetometer. All of them have 3 axis data (X,Y,Z).Now i have data as a TXT file format but I couldn't find any solution for extraction this data features. I am going to use this data with NNet. Could anyone help me with making program in Matlab,please? Any suggestion and opinion will be useful for me.
Thanks in advance!
As zellus suggested, the reading from textfile is well documented in MATLAB. Look for functions textread or csvread.
As I understand it, you are looking for help understanding the data that you have collected. You may get some answers here, but you are most likely better off asking what you should be looking for in a physics/engineering related forum, then coming back here for help implementing your code if need be.
As a starting point, you could try:
Plotting the change in the data over time, for each direction.
Looking at the magnitude of each of accelerometer, gyroscope and magnetometer data (using norm), and plotting these over time
Making a scatter plot of the norms of, for example, acceleration vs magnetometer - is there any correlation?
Likewise a scatter plot of X acceleration vs Y acceleration, or X vs Z etc.
Remember, in MATLAB, the plotting tools are your friend.

Using matlab to calculate the properties of a polygon defined as a list of points

Does MATLAB have a built-in function to find general properties like center of mass & moments of inertia for a polygon defined as a list of (non-integer valued) points?
regionprops performs this task for integer valued points, on the assumption that these represent indices of pixels in an image. But the only functions I can find that treat non integral point lists are polyarea and inpolygon.
My kludge for now is to create a bwconncomp structure with all the points multiplied by some large value (like 10,000), then feeding it in to regionprops, but wondered if there is a more elegant solution.
You should check out the submission POLYGEOM by H.J. Sommer on the MathWorks File Exchange. It looks like it has all the property measurements you want, and nice documentation describing the formulae used in the code.
I don't know of a function in MATLAB that would do this for you.
However, poly2mask might be of use for you to create the pixel masks to feed into regionprops. I also suggest that, should you decide to go this route, you carefully test how much the discretization affects the results, so that you don't create crazy large arrays (and waste time) for no real gain in accuracy.
One possibility is to farm out the calculations to the Java Topology Suite. I don't know about "moments of inertia", but it does at least have a centroid method.