How to detect water on google maps - google-maps

Is it possible to determine if a gps point is in water or near(not including elevation) . From what I have seen it doesn't seem possible. I had an idea of somehow getting the gps fence of water bodies and checking if the point lays in the fence. Sounds good but I can't find gps coordinate fences. If any one have any other ideas or a place to get those fences it would be great.

You can get the GPS fence for water from OpenStreetMap.
Then you do a point in polygon operation, optionally you put all polygons in
a spatial search structure, like a quad tree, for a fast polygon search nearby the lat,lon point.
You can start here. and later read more how to identify water in OpenStreetMap
A solution that works on small areas of waters, worldwide, would use much storage space If you concentrate on some countries this should work.

I found that the article is a very interesting approach.
Using google static maps to draw just some pixels around your coordinates, and then check whether its blue or not blue.
You can set a custom unique colour for "water" as a parameter to the google static map, which makes it easy for you to determine if it matches water or not

Related

Calculate length of road in a Polygon

I have this interesting challenge in my work, i have shape files of road networks, and another shape-File containing area boundaries, is there any tool that i can use to get length of roads that lies inside each polygon?
I have access to both QGIS and ArcGIS.
This is probably better asked on gis stackoverflow.
That said, this is a multi-stage problem. I'd suggest something like:
Clip the roads layer by the polygon layer, keeping the polygon id for each road.
Measure the length of the now-clipped roads.
Sum up the road lengths, grouping by the polygon_id
Join the now-measured,-summed-and-clipped roads layer back to the polygon layer.
This will give you what you want.
If you don't know how to use QGIS/ArcGIS, try googling for tutorials (or get work to splurge on training). There are plenty that cover the above functions.

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.

Mapping GPS coordinates to an image

I have attempted to map some GPS coordinates (longitude / latitude pairs) onto an image of the region of the world that they correspond to. The math was not complicated simply offsetting and then transforming the numbers with a multiplier. However this worked fine for points in Australia, but not for points in New Zealand.
The result is that the points seem to drift south near the middle of the image then slowly correct before the bottom.
Is there some extra math which needs to be taken into consideration for plotting points on a map?
Note:
during my diagnostic excercise I placed my map over google maps and noticed that my version of Australia was different to google maps, but New Zealand was the same as google maps. But the plotting for Australia works but for New Zealand does not.
Longitude/Lattitude is spherical coordinatesystem and will only work if you have a globe to show your map on. In your case you have a flat map and need to project the coordinates onto a flat surface. The maps that Google uses is created with an Mercator-like projection.
What kind of projection you want to use depends on how big area your map consist of. Most countries have their own projection that fit best for their purposes.
Those transformations are quite tricky to work out by hand if your not a mathematician but there are good libraries for transformations like Dotspatial and GDal.

google maps nongeographical space

I’m wondering if one of you can point me to a Google Maps API V3 code example which solves the following problem:
I have a data set with two-dimensional point data which is NOT georeferenced; i.e., the data do NOT refer to locations on the surface of the earth. In my case the data are for documents located in an artificial/synthetic, two-dimensional ‘information’ space.
For the moment I am successful in displaying and interacting with these points in the Google Maps API, mapping all points as long/lat coordinates centered on the long/lat coordinate 0:0; i.e., somewhere in the Atlantic Ocean off of the West coast of Africa :-)
Although I can get away with this for experimental purposes (the ocean around 0:0 is pretty much empty, so it does not interfere with my visualization), I’d like to adopt a new, abstract coordinate space; essentially replacing Google’s ROAD/TERRAIN/etc. maptype with my own (empty) one.
From what I have googled, this can indeed be done and I have seen some impressive DNA/genomics work in which this has in fact been done. But rather than hacking those complex apps, I’d like to see a very simple, base code example where someone plots some arbitrary points in an arbitrary space using the Google API.
Can one of you point me to such an example?
All,
I appears that the answer was in front of me all along (it usually is... sigh).
It seems that developers.google.com gives a nice example at
https://developers.google.com/maps/documentation/javascript/maptypes#CustomMapTypes.
The code for the example itself is at https://developers.google.com/maps/documentation/javascript/examples/maptype-base
Seems like this is basic enough for me to start working from.

How to get the width of a road through Google Maps API

I need to find the width of roads in Google Maps.
Google Earth can't be used as it doesn't support Linux.
Streetviews cannot be used, since it is not available in the area I live.
This link: http://osdir.com/ml/google-maps-js-api-v3/2011-05/msg00666.html suggests the method of finding the distance between the two ends of the road by knowing the coordinates of both sides.
Therefore the first question is as in title.
BTW, I have managed to display the "route" between the two coordinates already on the maps.
The type of the map can be set to "satellite" view through the API.
Does that affect the distance and coordinates that'll be fetched?
All this stuff about getting points across the street from each other is further complicated by the fact that sometimes the geocode returned will be a ROOFTOP geocode--likely meaning the centroid of a building--and other times, it is RANGE_INTERPOLATED which suggests that it will be not very precise. See http://code.google.com/apis/maps/documentation/javascript/reference.html#GeocoderLocationType. In either case, it won't be the edge of the road.
It may be sobering to look just how far from the road Google Maps may put the marker for an address: http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=4+Clinton+Drive,+Englishtown,+NJ&aq=&sll=40.299985,-74.290066&sspn=0.009426,0.015213&gl=us&ie=UTF8&hq=&hnear=4+Clinton+Dr,+Englishtown,+New+Jersey+07726&t=h&z=16
In short, unless your use case can tolerate a pretty wide error bar, I think it's safe to say that this just isn't going to work, at least not without considerable resources at your disposal.
Google Earth web plug-in is not available for Linux, but if you don't need it to be a web page, then you can try working with Google Earth app, perhaps. It works on Linux.
If your use case is for a reasonably narrow geographical area, there may be data available elsewhere. But getting this from Google Maps API v3 is unlikely to be a very good option.
(As always when I give a "I don't think this is feasible" answer, I'd be happy for someone to come along and prove me wrong.)
I'd look at the coordinates of individual houses. If house numbers are arranged such that n+1 is on another side than n, the distance between the two might tell you something about the width. But I don't think there's an API for that...
Here's the NON API solution i thought of,
In my country , roads named with different code names like "A3" , "B354", "C6".
"A" is for main roads. Most of the time width of the road is consistent as per road code. Therefore we can use road code to get the width of the road. I don't know if this works for your country.