Determine type of terrain at location - google-maps

I'm trying to determine the terrain type at an arbitrary location. If I make use of Google Maps for instance, I can visually see what terrain is forest, built up areas and water for instance by the colour displayed on the map.
I'm trying to see whether there's any sort of API call I can use to get this basic information. I don't need it to be highly precise and I don't really need to determine the exact terrain type (so stuff like the Corine Land Cover is pure overkill). I'm going to need to make a number of these requests every few minutes. I've found a previously asked question around 3 years ago which wasn't really resolved, I'm hoping that there's been a change now.
Is there anything I can use? I'm actually considering reading the displayed map tile myself and grabbing the pixel colour, but I'd appreciate if there was a simpler method.

It doesn't seem like they provided the API to do that..
A work around would be to use their static maps API.
basically after you turn off everything but the water and greens, you get something like this:
http://maps.googleapis.com/maps/api/staticmap?center=37.7833,-122.4167&zoom=10&format=png&sensor=false&size=640x480&maptype=roadmap&style=visibility:off&style=feature:water|element:geometry|visibility:simplified&style=feature:poi.park|element:geometry|visibility:on
you can, make the size to be 1px by 1px, zoom in, and check the color of this image to decide the type of area of this location.

Related

Doing an Image Search?

Is it possible to perform an image search with google maps? For example, if I had a small section of a map, showing road configurations, but there were no labels to indicate street names or place names, is there a possible way to do an image search, similar to what you can do with regular google, to be able to identify that location? I have tried this with the regular google, and it does not work. Does anyone know of software or an app that has the ability to do this? Thanks!
Yes it may be possible , But I do not think any software or app that is currently available a program would be need to be written that takes that small section of a map that you have and it would have to be a rather good quality image and preferaby in a raw Bitmap format and then the small section of the map you provide would have to be overlaid over the main google map and then moved around the map... scanned and each pixel compared frame by frame as the search picture is scanned across the bigger map and then a best-fit process would be utilized , and then when it finds a match it can then let you know just how closely it matches and what the confidence level it is that that the location found is actually correct , it would be best to narrow it down as much as possible as well, also a bit of artificial intelligence might be very useful here too, a face recognition A.I. program could be modified to complete that task. but as far as I know none of that exists in a single readily available app or program , maybe someday someone would create such a program? it is possible.

Changing Maps "detail/resolution" while still zooming in/out

I'm toying around with d3.js and some other javascript libraries plotting geoJSON data in the browser. I've done some cool things with the data, but to give it a bit more context I want to lay it over a map that fills the browser (i'll probably make it opaque to not distract). I've spent a few hours with the google and bing API, which have great "zoom" options, but I want to specify how detailed the map becomes without further restricting how far I can zoom in. Is there a way to do this? I.e. I want to zoom further in and be able to pan around, without all of the side streets appearing-- maintaining the "main drags" of the city I'm working with.
I'm open to using different resources, but this is not a commercial product so I don't want to pay anything. As far as I know, the option for increasing and decreasing the detail/resolution of the pane is by increasing or decreasing the zoom variable. Thanks.
Edit: There really doesn't need to be much interaction with the map. This is kind of the intention http://www.caudillweb.com/temp/d3_choropleth.html, but since it will be at the city level, as you can see when you zoom in that far all sorts of different elements and side streets appear, taking away from the clean view at a more zoomed-out level and it begins to distract from the data.

open earth map with irregular station measurement overlays

I would like to draw a map of current temperatures (or air pressures, etc.) from many weather stations, with the underlying map still recognizable. the problem is easiest to think of as follows:
I have an array of spot measurements from irregularly spaced dots---think triples of GPS coordinates with one temperature value each. my stations can be very close to or very far apart from one another, and a user may want to zoom in or out. cold should be blue, warm should be red. Ideally, I would like to just pass the array, the color range, and have the rest be taken care of. I would prefer everything to be inside a web browser. The user needs to be able to zoom in, zoom out, move around, and get back to his current location.
I do not even know how to think about this problem. If a user has zoomed out enough, non-transparent dots could be so close as to obscure the terrain. However, zooming in, it would be nice to recognize the dot that is the station itself. This presumably requires some intelligence that realizes how many dots there are, e.g., relative to the density of the display? not sure.
I believe google maps charges for many API calls, so I would prefer using an open map and/or open API that can use different underlying maps. It does not have to be fancy. I don't care about directions, etc.---just a map that is recognizable at most zoom settings, with landmark and street names, and my nice temperature station overlay coloring, so that a user can visualize where it is cold and where it is warm.
(Stations come online and offline, but I don't need to update this more than once an hour. I can place the map measurements into a file that is URL web-accessible.)
is this an easy or a hard problem for the high-level web programmer?
/iaw
after looking around for a long time, I think the best way to do this is with html5 openlayers nexrad.
alas, the docs seem to be a mess. half the examples that I found did not seem to work. it's pretty hit-or-miss. similarly, the openlayers cookbook also seems to be outdated and has incorrect examples, but they did have a reasonably short example of such a nexrad map overlaid on the U.S., that one can further study.

Accessing google maps area coordinates (suburb boundaries)

I'm trying to show some data about Australian suburbs. 'Suburb' is the term that Australians use to describe an area, if you are from the rest of the world think post code or something similar.
I'd like to be able to get access to the area boundaries that are already in the map. These are examples of the kind of boundary that I'm talking about:
Marrickville, Sydney (2204): http://goo.gl/maps/QYRhx
Clapton, London (E5): http://goo.gl/maps/3an2Y
I want to be able to draw the boundary on the map, draw multiple boundaries on a map (e.g. show which areas make up the 'inner west'), shade the areas to indicate their vaue of something or other. Generally do stuff with them.
This question asks about how to get boundaries that are drawn manually, but I want to access the ones that already exist.
This question asks a similar question, but it isn't answered.
This question is similar, but the responses suggest using shape files, not getting them directly from Google.
I've also tried the maps styling wizard, and whilst the administrative, neighborhood boundary is what I need to show, it doesn't seem to be able to affect the map.
I've looked in the api docs to no avail. Does anyone know if this is possible?
No, it isn't possible.
The area boundaries feature is not (yet?) implemented in the API.
If you explicitly need data from Google then I can't help you.
But if you just need data on Australian suburbs and don't care where you get it from (and if you happen to be interested in SA or NSW) then you can get GeoJSON or KML for SA from data.sa.gov.au/data/dataset/suburb-boundaries and for NSW from data.gov.au/dataset/nsw-suburb-locality-boundaries-psma-administrative-boundaries.
You might find others at data.gov.au/dataset too, I haven't searched that much.

Advice on techniques for recognising land/sea mass in google maps

I am looking to develop some code that will be able to by looking at images downloaded from google maps, categorize which part of the image depicts the land and which part depicts the sea.
I am a bit of a newbie to computer vision and machine learning so I am looking for a few pointers on specific techniques or API's that may be useful (I am not looking for the code to this solution).
What I have some up with so far:
Edge detection may not be much help (on its own). Although it gives quite a nice outline of the coast, artefacts on the surface/above the sea may give false positives for land mass (stuff like clouds, ships, etc).
Extracting the blue colour element of an image may give a very good indication of which is sea or not (as obviously, the sea has a much higher level of blue saturation than the land)
Any help is of course, greatly appreciated.
EDIT (for anyone who may want to do something similar):
Use the static google maps API to
fetch map images (not satellite
photos, these have too much
noise/artefacts to be precise).
Example url-
http://maps.google.com/maps/api/staticmap?sensor=false&size=1000x1000&center=dover&zoom=12&style=feature:all|element:labels|visibility:off&style=feature:road|element:all|visibility:off
To generate my threshold images I used the Image processing lab. I would apply the normalized RGB -> extract blue channel filter and then apply Binarization -> otsu threshold. This has produced extremley useful images without the need to fiddle with thresholds values (the algorithm is very clever so I won't muddy the waters and attempt to explain it)
I assume you are using the satellite view images from Google Maps otherwise you wouldn't have written about ships or other artefacts.
As you already said it might be a good idea to simply try to extract the blue image part.
Just having a look at the blue channel of an RGB image isn't going to work (I just tried), since the woods and so on will not give a good threshold value on the water.
So you can try converting the image to YCbCr color space and have a look at the chrominance channels there.
This an example I just made with a screenshot from google maps. I converted it to YCbCr in Matlab and just took the Cb channel.
You can then binarize this image by a well set threshold, which shouldnt be too hard to find.
You probably will still have small artefacts for which you could use morphological operators (Opening the image several times).
This should remove small artefacts and leave the parts that are land and the parts that are water.
Hope it helps... if not, please keep asking...
EDIT
I've just tried again with another screenshot in matlab:
Convert Image to YCbCr colorspace
Just have a look at Cb channel
find threshold on Cb image either fixed or by i.e. Otsu's method which finds an appropriate thresholdl in a bipartite histogram
perform opening or other filters to eliminate small noises
The original image I made:
After applying a threshold on the Cb image:
After applying an opening (5) on the image
I just picked a threshold manually... You might get better results by having a look which threshold would work better... But as you see this should also work on the different colors of water from rivers and ocean.
You are looking for a segmentation algorithm, that assigns each pixel to one of two classes (land, sea). One of the simplest approaches is to use thresholding.
define a threshold t
if pixel value > t -> assign pixel to land
else assign pixel to sea (usually you will have a bitmap, where you keep track of the pixel class)
Since this approach works best if you can distinguish land and sea masses easily, I would suggest that you compare the hue value of the pixels (i. e. find a threshold between blue and green).