How to get date of currently-displayed imagery in the Google Earth API - google-earth

One of the Google Earth API Demos shows how to display historical imagery, hide and show the timeline bar, and set the current date for the display. The demo is available at http://code.google.com/apis/ajax/playground/?exp=earth#time_and_historical_imagery_ui
However, if the current date is set to a time for which there is no imagery, the closest available imagery is used. For example, if the date is set to 2005, but there are only images from 2003 and 2009 then the ones from 2003 will be used.
How can I find out, via the API, what the actual date of the imagery shown is? It doesn't need to be an exact date, but knowing the year is important, and knowing the month would be brilliant.
Is this possible?

You'll note that in the UI of the time slider, there are little tick marks for each available date for which there is historical imagery for the current view.
As you change the camera or lookat, different imagery may become available. As you zoom in, for example, more or less imagery may become available.
To programmatically get a list of the dates associated with these tickmarks, you can call:
ge.getTime().getControl().getAvailableImageDates()
This will return a KmlObjectList of KmlTimeStamps which you can iterate through.

Related

State/Province World Data

Currently I am trying to develop a multi-layered Leaflet map using GeoJSON (for country, states/provinces) and CSV (for city data). I want it to go down all the way to city level and that requires layers of Country, State/Province, and City data. I have all the Country data I need in the format I require (GeoJSON) and I have a decent source for City data in a CSV format.
However, I only have USA, Canada, Brazil, and Australian states/provinces and I have been looking around but haven't been able to find a reliable source such as NaturalEarth (which is where I initially got my states/province data from).
Does anyone have a resource they could point me towards? Even if it is multiple, hopefully I can merge them together in mapshaper/other open source applications. I've been looking for the past month but I am new to geographic visualization so I don't know the good spots to look yet.
Thank you so much for any help
You can try BBBike exports of OpenStreetMap data. Probably you will have to export bit by bit as there is a size limit to what you can export.
I recommend you also OpenStreet map. Osm also uses NaturalEarth for higher layers.
But I would download their database (for test, just download a small country, then you can download continents at a time).
Then I would select the features I'm interested. In your case the boundaries (region, districts, cities/municipalities), and city/hamlets names. Then you should look at the tools they have (and what you need). My simple and stupid way would be just to import such features in a GIS database, and then use it to get data. But you may find shortcuts and use directly the data without importing in a database.
Check OSM wiki, Downloading data and Planet.osm page, and other linked pages about tools. You may need to look the Feature page to known what features you want (just to discard most of the data).
If you want to use the tiles (pre-rendered images), you may need to read the term of services. It may be easier to download all data and render in your server, or to buy a service which offer you tiles. (all in the wiki).

Bing map show wrong location in Hong Kong

I am using Bingmap API to show location of some building. The broblem I faced is when display building in HongKong, the pushpin show wrong location.
After researching, I released that Bing map, and other online mapping services are able to publish maps in compliance with Chinese law because they conform to China’s so called GCJ-02 coordinate system, also referred to as Mars Coordinates.
GCJ-02 is based on the familiar WGS84 coordinate system, except that
it is said to use an encryption algorithm to shift the coordinates by
a few hundred meters from their true locations. As a result, GCJ-02
maps appear entirely self-consistent, but the actual coordinates of
any given location are slightly offset from reality.
But Google map show right position in Hong Kong.So my question is there any way to fix for Bing Map API in this case?
Bing map version :
Google map version :
Its difficult to say what the issue may be. I suspect that the address is rendering with the offset, but the base maps being displayed are not offset. If you are in china the maps will be in Chinese and offset. If using the developer API's set the market/culture to zh-CN.

How does localization affect when day-specific annoucements are seen?

Facebook publishes announcements/reminders for day-specific events like birthdays. Does localization affect when these are seen?
For example, if my birthday is February 1st, would a friend in another time zone see the announcement starting at Feb 1 their local time, in my time zone, or at some other time zone (e.g. Greenwich mean)?
Any option seems to have drawbacks:
If announcements are based on local time, a friend who lives in India may see the announcement the morning of February 1st for him, but I'd get it in the evening of a previous day. Or if they lived in Japan they might not see it until the evening of Feb 1st, when it's already Feb 2nd for me.
If announcements are based on my local time then the friend may be confused about when my birthday actually is, as the announcement will show up for them for at least part of a different day.
For a birthday announcements these aren't very serious concerns; it's just an simple example to clarify the question
I think the question pretty much describes the dilemma, which has no good universal selection. In the birthday example, the problem is in the vague definition of “birthday”; it is a social convention more than anything else.
If you consider something more objective, like a “one-day offer” by a company, then it becomes even more obvious that the crucial issue is how things are defined. In global consideration, a company should define when the offer is valid (e.g., on a particular day in a particular timezone) and announce it accordingly.
The programming challenge is then to implement this properly. Mostly, it is a matter of making time references relative to a specific timezone, or the user’s timezone. These typically require different approaches: server-side vs. client-side. (The server timezone might not coincide with the intended timezone, but they should have a defined relationship.)

Suggestions for a web-based streaming charting tool

Afternoon all,
I'm looking for a way of presenting near realtime data using line charts within my web application. Specifically, my requirements are as follows:
It should support zooming (with the mouse wheel too!), scrolling, selecting different time ranges, etc.
It should support presenting data at multiple resolutions within a single chart. The default view would be the past 24 hours (using data at one minute resolution), but if the user zoomed out or browsed back further in time then lower resolution data would be used. On the daily view, we'll have 1440 points per line (there'll be at least two). If we lower this to hourly averages when zoomed out further, we're looking at 720 points per month per line. We can lower the resolution further after that too.
Ideally, if the user zoomed into a historical date the graph would poll a server to see if high resolution data was available for that period, and if so, fetch it and update the graph area.
Streaming data support. Namely, the graph would fetch deltas every X minutes and append them to the graph.
We're open to using Flash, Java, Silverlight or pure Javascript for the presentation layer, although Flash would probably be the strongest preference.
I've spent a fair bit of time looking around for something that would fit the bill here and have (surprisingly) not found much. Here's some brief notes from my research:
a) Google Finance charts are pretty much exactly what I want to achieve, but it seems that their public version of these charts (the Annotated Timeline Chart) is comparatively very limited. It does not allow for streaming data, and if you want to redraw graph data (e.g. when changing the selected date range) you get a nasty flicker as the chart area reloads with the new data.
b) Timepedia Chronoscope charts sound promising at first glance, with support for incremental data loading. However, there seems to be no documentation or examples of this (all examples use a static dataset from .js files)
c) We've seen charts such as Open Flash Chart and others like this, but they don't have the "wow factor" that Google Finance charts do.
Any suggestions welcome!
I would suggest Highcharts - very neat SVG and javascript-based charts. There's also an example called Live Random Data which updates a spline ever second - this would be useful for your streaming requirements. The zooming and scrolling is available: Master Detail Chart, but everything depends on how much data you'll be pointing out.
In my experiments earlier this year, I managed to have around 20 graphs with over 40 plots each running smoothly in Firefox, but more than that could give out tiny delays, so in that sense yeah, you'll be better off with Flash, although I doubt that anybody would be able to read 20 splines at a time ;)
Hope that helped. Cheers!

How can one display local time and date to my drupal website visitors depending upon their geographic location?

I need to display the FIFA world Cup 2010 schedule on my Drupal website. But what I want is that each visitor should be able to see the time for the upcoming matching as per his/her own geographic location . How can this be done ?Any suggestions would be welcomed. Thanks for reading this through.
You need to be able to sniff the user's location. The most common way of doing that is by using an IP-to-location service or library. There are freely available IP-to-location libraries which provide country-level resolution, or you can pay to get data that is accurate down to city level.
There is a contrib module which allows you to incorporate the MaxMind GeoIP more easily. http://drupal.org/project/geoip
I think what you need is a tool like GeoIP, i don't know Drupal so this is just a hint... just a thought!
You can put a time zone spinner with the World Cup schedule on your website, and let your users convert the match times to their local time if they select their local time zone from the spinner.
What about JS getTime()? Wouldn't that work in browser and pull from the user's settings on locale?