open earth map with irregular station measurement overlays - google-maps

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.

Related

Determine type of terrain at location

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.

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.

How do I obtain the coordinates along GMaps directions?

I want to create an online map for a hiking trail, and I have been using my smartphone to collect coordinates from it.
I have many questions regarding what's good practice when it comes to making such tracks, but for starters: it would look much neater if I could edit the readings so that they are right on top any roads in Google Maps. How can I achieve this?
EDIT: I want to find the coordinates that will make a track along a road look exactly as if I'm using snapping/directions even when I'm not.
I've tried tools such as QLandkarte GT and Viking, and with the latter I was able to manually remove excess coordinates and move the remaining ones so that they're exactly on top of roads (inside Viking, using OpenStreetMap). However when I load the edited .kml-file in Google Maps, the roads seem to be in slightly different places and the result is hardly better than before editing.
I tried using the hack that exports GMaps directions as .gpx, thinking I could insert Google's own coordinates along the roads. But the exported file only had coordinates at the turning points with straight lines between these.
QLandkarte GT supposedly has a snap-to-road feature (see answer in link), but I haven't found it and I also don't know how to obtain a vector map of the area.
Then there's Google Earth which people seem to use for this, but again I can't find any track editing features (in the free version).
In short:
How do I edit my existing tracks so that they match roads in GMaps...
OR
How can I obtain new tracks representing roads in GMaps...
...so that the resulting track is as smooth as Google's own directions or other professional GPS-data, when displayed in GMaps?
It seems like it's possible to get these coordinates from Google Maps after all, exporting the directions polyline. I'm not sure how, it seems to involve adding the parameter output=dragdir to the link.
Anyway there's a tool called GPS Visualizer that can create a .kml-file with the wanted coordinates.
Edit: Will accept my own answer as long as it's the only one, but I would still like to know more.

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.

Obfuscating Geocode results to protect privacy?

I have an app that finds other users within a 20 mile radius on a google map and associates an icon with each of them. However, I do not want their exact points to be given but rather an approximation. I've wrestled with a few ideas on how to do this:
Only Geocode the Zip Code, make graphic icons for 1-99, use the icon to represent how many results are within the zip code, and use the info window to show hyperlinks to the individual results. The only problem is, I'd like each individual icon to be shown because it just looks a lot better.
Add/Subtract a random number to the lat/lng values stored with each user and add a translucent circle around the icon.
What do you guys suggest?
It depends on the level of privacy you want (the 1st option protects privacy better), but I'd be tempted to go with randomly moving the indicators because it's a more natural representation (people on a map, not groups of people on a map) without too much of a compromise in terms of usefulness.
That depends on how hard you think someone will try to defeat your system.
If you plan to track these positions over time, you give away more information over time than you do in a snapshot. For instance, if you choose a fixed-offset from the center of the circle, it may be possible to find this offset by mapping the path over time to the street map. On the other hand if you continually change the offset, the position may be discoverable by averaging.
Here's one possible scheme based on hysteresis. Leave the visible circle in place until the user exits an invisible bounding circle with a random radius. Then compute a new visible circle with a different random offset, and also set up a new invisible circle with a different random radius. This should generate a visible-circle movement that is almost impossible to reverse engineer, but also avoids lots of jittery movement.