Create heightmap in C# based on elevation data - heightmap

I recently came accross a site
http://www.daftlogic.com/sandbox-google-maps-find-altitude.htm
which gives me the elevation data of each point of any earth's location.
Now I want to build a desktop application in C# , using google maps api or otherwise , in which the user will search for the location and the image will be displayed of that location , where user can zoom in or out and select the required area. After selection , the tool will get elevation data of every point in the selected area , and it will create respective color in that point , so the highest point will have white and lowest point will have black , then it will convert the data into an image format. So if I can do this , I can basically create heightmap in seconds.
Can anyone tell me how to achieve this ? I don't have any idea regarding how to get the elevation data of every point in selected region , and how to calculate and create color image from that data.
Thanks.

I've had a look at the Google address you've pasted. My answer here is not exactly about that but it might halp you understand how elevation works. Google, as many other websites, uses a DEM map (Digital Elevation Maps: http://en.wikipedia.org/wiki/Digital_elevation_model) which is a rasterized image of a certain area, in which every pixel represent a real sample from the Satellite/Shuttle (or the interpolation between two sampled points).
These maps are quite huge, depending on the sampling frequence. For some area of the Globe the sampling area is very dense, while for other areas is more sparse. The USA have the best detail.
If you want to download the free DEMs this is a good starting point: http://srtm.csi.cgiar.org/SELECTION/inputCoord.asp
You could download a sample of every part of the area you want to include in your application, convert the data into a database (latitude, longitude, altitude) and have your application query the DB and return a set of pixels that you can paint in different colors, accordingly with your altitude ranges.
Hope this helped

Related

How does one creates a raster layer from SQL Server in GeoServer

I want to implement a weather layer that displays temperatures from -40 to 40 degress in a map using GeoServer. I got an SQL Server table that looks something like:
create table temperature (id int identity primary key, geom geometry, temperature float)
Geom contains a Point for which a given temperature measure is applicable. I have added the table as layer in GeoServer but i'm stuck to actually be able to render it. Right now, the best i get is a big red square :D So, it seems like it renders as a pure point, and not a raster.
How does one creates correct bindings etc for the raster to be displayed nicely?
Is it done on SLD level or somewhere else?
You could use the BarnesSurface transformation as described in this question. But since the transformation will be carried out each and every time the map is displayed it would be more efficient to rasterize the points once and then use that raster in GeoServer.

Sort images in grid based on user input

I have a few hundred images that I would like to have a user manually sort along two axes. Each row represents a users perceived nominal label, eg red, orange, yellow, green, ... The images in a row are ordered according to some feature perceived by the user (eg brightness). So given an image the person sorting should be able to determine which row it belongs to and which two images it should be between in the row and insert it there.
Initially I tried using Google sheets and loading the images into cells in the spreadsheet. The problem I encountered are the images are really low resolution and Google sheets applies some blending to the pixels (eg linear?, bicubic?) which made understanding the images too difficult for my user. If I could load an image and have it resize using the nearest pixel color I think it would be fine.
I have looked at some photo organizing software, the closest feature I can find is organizing photos based on geo-coordinates onto a 2D map, which isn't intuitive for my user.
I suppose I could create a webapp that the user could assign a row and column too, but it seems like there should be an easier way.
The intent is to apply machine learning on the provided labels so that we can automatically sort larger datasets, so it would be great if the solution could be used with machine provided metadata, which could then be visually inspected for accuracy.

How can I make a google maps like interface

Hi I want to create a google maps like interface from very high resolution maps. eg. 11k x 11k resolution. My goal is to be able to pan/zoom and put pins on desired locations on the map. I was able to implement zooming/panning of the image using mapbox plugin. my question is how to place a pin on (x,y) location on image and keep the pin while zooming in/out.
Thanks
The easiest way would be to treat the entire image as a 11k by 11k grid with (0,0) in the top right corner. Then, the pin would be located at (x,y). Then, when you scale the image, you treat the new view as a subset of the main grid.
For example, it may start at (5000, 3500) and be 500 by 500 pixels. Then, if the pin is in those coords, you calculate where to place it.
Let's say you have two pins: {(5230, 3550), (5400, 3700)}.
Now, if your zoomed on 5000, 3500 and the view port is 500x500, your pins real locations are:
{(230, 3550), (5400, 3700)}
The way you'll need to do the translations exactly will vary on how exactly your handling zooming/panning, but that should be the general idea.

Get POINT CLOUD through 360 Degree Rotation and Image Processing

My Question is as below in two parts……
QUESTION (IN SHORT):
• To generate point cloud of real-world object….
• Through 360 degree rotation of it….on rotating table
• Getting 360 images… one image at each degree (1° to 360°).
• I know how to process image and getting pixel value of it.
• See one sample image below…you can see image is black and white...because I have to deal with the objects which are much shiny (glittery)…and it is DIAMOND. So I have setting up background so that shiny object (diamond) converted in to B/W object. And so I can easily scan outer edge of object (e.g. Diamond).
• And one thing to consider is I don’t using any laser… I just using one rotating table and one camera for taking image…you can see one sample project over here… but there MATLAB hides all the things…because that guy using MATLAB’s in Built functionality.
• Actually I am looking for Math routine or Algorithm or any Technique which helping me out to how getting point cloud…….using the way I have mentioned……..
MORE ELABORATION:
I need to have point-cloud of real-world object. So, I can display it in Computer Screen.
For that I am using one rotating table. I will put my object on it and I will rotate table a complete 360° degree rotation and I will take 360 images…one image at each degree (1° to 360°).
Camera which is used for taking image is well calibrated. I have given one sample image as below. I also know how to scan image and getting pixel value of it.
Also take in consideration that my images are Silhouette type…means just black and white... No color images.
But my problem is or where I am trapped down is in...
Getting Points cloud of object…….from the data which I have getting through processing of image.
One same kind of project I found over here……..
But it just using built in MATLAB functions…I am using Microsoft Visual C#.Net so I have to build the entire algorithm myself….because MATLAB hides all the things which I want to know….
Is there any master…….who know this entire thing well and getting me out of trap...!!!!
Thanks…..
I have no experience of this but If I wanted to do something like this I would have tried this:
Use a single color light source
if Possible create a lightsource which falls on a thin verticle slice of the object.
have 360 B/W Images, those Images will be images of a verticle line having variyng intensity. If you use matlab your matrix will have a/few column with sime values.
now asume a verticle line(your Axis of rotation).
5 plot or convert (imageno, rownoOfMatrix, ValueInPopulatedColumnInSameRow)... [Assuming numbering Image from 0 to 360]
under ideal conditions A lame way To get X and Y use K1 * cos imgNo * ValInCol and K1 * sin imgNo * ValInCol, and Z will be some K2 * rowNum.. K1 and K2 can be caliberated knowing actual size of object.
I mean Something like this:
http://fab.cba.mit.edu/content/processes/structured_light/
but instead of using structured light using a single verticle light
http://www.geom.uiuc.edu/~samuelp/del_project.html This link might help in triangulation...

Algorithm to find 'hot spots' in a database of GPS coordinates

I've got an amount of data that I'm about to put into a database, it's a list of GPS points.
I want to iterate over this database and create a table of 'hot spots' where there are a high number of database points in a certain size of area (either a square area, or a circular area - I don't need to be exact).
Can anyone recommend existing algorithms that might help me with this?
Thanks in advance!
r3mo
K-Means clustering would be a good starting point, for identifying hot-spots. See wikipedia entry.
How about creating a raster with a given cell size and assigning the raster value to the number of points falling within each pixel (a density plot)? It's a basic approach with some limitations (where you place the grid and the pixel size will affect the outcome), but if that's all you need... This could be accomplished easily in R using the spatstat package. Check out this pdf tutorial on spatstat for examples.
Unless another variable is attached to your points, it's not really hotspot detection, just a determination of point density...

Resources