Get height of a building from a maps API - google-maps

It's any public maps API (google, microsoft, openstreet...) that returns the height of the roof for certain points?
Imagine: you request some address and the API returns the coordinates, some information and the height of the building, if available.

OpenStreetMap has a height tag and various other building related tags like building:levels from which you could estimate the height. However note that currently most buildings lack those tags as they aren't widely in use so far. Still you could give it a try and request all buildings around a specific point or area using Overpass API / overpass turbo and then look for those tags.

I'm almost certain the answer is "no". To get this information you'd need LIDAR data or something similar, and there is no global dataset of LIDAR data at anything like the resolution necessary to accurately determine the height of an individual building roof.
Many of the web-mapping services use terrain and building elevation models internally to calculate their "3d" view modes, but I don't think this data is ever exposed, and even if it were I think it's only suitable for display purposes rather than for performing any calculations.

Related

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.

central coordinates of regular map tiles

I am trying to retrieve a set of static map tiles from Google Maps using the simple web services API.
For zoom level 0, where there is only one tile, I simply specify the center as (0,0), which is trivial. (And yes, I am aware, that the south-north range is [-85.05113°,85.05113°] only, i. e. I have read about Mercator projection (not only the Wikipedia article).
So for zoom level 1 with 2×2 tiles I know that it'd be naive to think the central coordinates of the tiles would be (±90,±45). I applied one of the functions listed in above article's "Derivation of the Mercator projection" section. In PHP this looks like
function mercor($aLat) {
return rad2deg(asinh(tan(deg2rad($aLat))));
}
which always returns 50.498987 when passing in 45. I tried several of the alternative expressions :-) all with the same result, indeed, and even checked that value with a dedicated calculator.
Anyway, the value is obviously not correct, as you can see here (which was supposed to show the north west quadrant of the Earth's map, but here the equator is shifted to the north) (image source):
By trial and error I found the correct value to be close to 66.65, but I have no idea how to calculate that. I tried several manipulations of the R factor shown in the expressions in that mentioned "Derivation of the Mercator projection" section, and also fiddled with the "Scale factor" described in the same document, but whatever I do, I do not come close to 66.65.
Here you can see that 66.65 is the (close to) correct value, the equator at the bottom edge (image source):
And taking an illustration like, for example (image source):
and a tool like kruler, it also becomes obvious that it should be 66.65.
So, any idea would be greatly appreciated. Thanks in advance...
(Currently I'm trying it from withing HTML documents, because it's relatively simple, but later I'd like to do it from an environment in which I have no way to call JavaScript. so the JavaScript API is not an option.)
I have prepared a website describing the popular tiling system used behind Google Maps, OSM and similar slippy maps. Have a look at:
http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/
With a click on the interactive map you receive bounds calculated in both the Mercator coordinates (in meters) as well as WGS84 lat/lon (in geodetic degrees).
Down on the page you find an open-source python code (which has been in the meanwhile ported to other programming languages by other people). This contains documented description of all the math you may need.
In fact, I have created this resource after working for Google SoC on the GDAL2Tiles/MapTiler project - which has been reimplemented into C/C++ and significantly improved and is now available via http://www.maptiler.com/.
UPDATE:
If you want to use the Google Maps Static API requests you may find useful another online tool which I prepared: http://www.maptiler.org/photoshop-google-maps-overlay-tiles/.
Feel free to review the JavaScript source code.

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.

Easiest way to create a dynamic heatmap of the United States

thanks for all the help the last few days. I'm hoping someone knows this one.
I'm looking to dynamically create a heatmap of data based on user input, then color certain states based on the response. Like a poll for voting, for example. I'd like to do something like this...
http://www.trulia.com/home_prices/
What is going to be the easiest way to do this?
The Google Chart API also offers maps.
Here's a (completely made up) example:
Another very easy solution is OpenHeatMap.com. They support pegging data to a variety of map shapes, including US states.
OpenLayers is a javascript library for displaying tiled maps and related elements (polygon, line, etc) on top of these tiles.
It supports a number of back-ends for map data, including google's data.
Samples are available here