9/12/2010
Luhn algorithm credit card number checker
Open spreadsheets https://spreadsheets.google.com/ccc?key=0AppCRCbx33I9dDJ2Q3pta1o1QVR6TDRQWXBvaUNvb3c&hl=en
Credits http://en.wikipedia.org/wiki/Luhn_algorithm
8/30/2010
Elevation, ocean names, country code
https://spreadsheets.google.com/ccc?key=0AppCRCbx33I9dGRiSFpxNkhHckxKbWNVVEFZUU1zaFE&hl=en
Copy Source | Copy HTML- function astergdem(lat,lng) {
- /*
Elevation - Aster Global Digital Elevation Model
Parameters : lat,lng; sample are: ca 30m x 30m, between 83N and 65S latitude.
Result : a single number giving the elevation in meters according to aster gdem,
ocean areas have been masked as "no data" and have been assigned a value of -9999
*/
- var url = "http://ws.geonames.org/astergdem?lat="+lat+"&lng="+lng;
- var response = UrlFetchApp.fetch(url);
- var str = response.getContentText();
- return str;
- }
-
- function srtm3(lat,lng) {
- /*
Elevation - SRTM3
Shuttle Radar Topography Mission (SRTM) elevation data.
The dataset covers land areas
between 60 degrees north and 56 degrees south.
This web service is using SRTM3 data with data points located
every 3-arc-second (approximately 90 meters) on a latitude/longitude grid.
Parameters : lat,lng;
sample area: ca 90m x 90m
Result : a single number giving the elevation in meters according to srtm3,
ocean areas have been masked as "no data" and have been assigned a value of -32768
*/
- var url = "http://ws.geonames.org/srtm3?lat="+lat+"&lng="+lng;
- var response = UrlFetchApp.fetch(url);
- var str = response.getContentText();
- return str;
- }
-
- function gtopo30(lat,lng) {
- /*
Elevation - GTOPO30
GTOPO30 is a global digital elevation model (DEM)
with a horizontal grid spacing of 30 arc seconds (approximately 1 kilometer).
Result : a single number giving the elevation in meters according to gtopo30
*/
- var url = "http://ws.geonames.org/gtopo30?lat="+lat+"&lng="+lng;
- var response = UrlFetchApp.fetch(url);
- var str = response.getContentText();
- return str;
- }
Copy Source | Copy HTML- function ocean(lat,lng) {
- /*
returns the ocean or sea for the given latitude/longitude
*/
- var url = "http://ws.geonames.org/oceanJSON?lat="+lat+"&lng="+lng;
- var response = UrlFetchApp.fetch(url);
- var str = eval('(' + response.getContentText() + ')').ocean.name;
- return str;
- }
-
- function countryCode(lat,lng) {
- /*
returns the iso country code of any given latitude/longitude
*/
- var url = "http://ws.geonames.org/countryCode?lat="+lat+"&lng="+lng;
- var response = UrlFetchApp.fetch(url);
- var str = response.getContentText();
- return str;
- }
-
4/24/2010
Scripts in Google spreadsheets
Now we can create scripts for Google Spreadsheets, upload, post, communicate with other users.
- new function;
- value returned by the Web service, including, SOAP, WSDL, and others;
- management of other services, such as website, calendar, mailing;
- automatic filling of tables (direct control of our spreadsheets);
- creation of user interfaces (custom spreadsheets UI).
- function GCD1(lat1, lon1, lat2, lon2) {
- // Return Great Circle Distance between points calculation
- function radians(a) {
- var outNum =Math.PI*a/180;
- return outNum;
- }
-
- var R = 6372.795;
- var d1=Math.sin(radians(lat1))*Math.sin(radians(lat2))+Math.cos(radians(lat1))*Math.cos(radians(lat2))*Math.cos(radians(lon2)-radians(lon1));
- var d2=Math.cos(radians(lat2))*Math.sin(radians(lon2)-radians(lon1));
- var d3=Math.cos(radians(lat1))*Math.sin(radians(lat2))-Math.sin(radians(lat1))*Math.cos(radians(lat2))*Math.cos(radians(lon2)-radians(lon1));
- var len=R*Math.atan2(Math.sqrt(d2*d2+d3*d3),d1);
- return len;
- }
- function getKML(placeName) {
- // Return KML by placename
- if (placeName == "") {
- return "You have to write the name the place"
- }
- var url = "http://maps.google.com/maps/geo?q="+ placeName+"&output=kml";
- var response = UrlFetchApp.fetch(url);
- var str = response.getContentText();
- return str;
- }
- function getLngLat(placeName) {
- // Return LngLatitude by placename
- if (placeName == "") {
- return "You have to write the name the place"
- }
- var url = "http://maps.google.com/maps/geo?q="+ placeName+"&output=json";
- var response = UrlFetchApp.fetch(url);
- var str=eval('(' + response.getContentText() + ')').Placemark[ 0].Point.coordinates;
- return str;
- }
Return Longitude by placename- function getLng(placeName) {
- // Return Longitude by placename
- if (placeName == "") {
- return "You have to write the name the place"
- }
- var url = "http://maps.google.com/maps/geo?q="+ placeName+"&output=json";
- var response = UrlFetchApp.fetch(url);
- var str=eval('(' + response.getContentText() + ')').Placemark[ 0].Point.coordinates[ 0];
- return str;
- }
-
Return Latitude by placename- function getLat(placeName) {
- // Return Latitude by placename
- if (placeName == "") {
- return "You have to write the name the place"
- }
- var url = "http://maps.google.com/maps/geo?q="+ placeName+"&output=json";
- var response = UrlFetchApp.fetch(url);
- var str=eval('(' + response.getContentText() + ')').Placemark[ 0].Point.coordinates[1];
- return str;
- }
-
Reverse geocoding- function getAddress(placeCoord) {
- // Return Address by placeCoord (reverse geocoding) placeCoord=lat,lng
- if (placeCoord == "") {
- return "You have to write the name the place"
- }
- var url = "http://maps.google.com/maps/geo?q="+ placeCoord+"&output=json";
- var response = UrlFetchApp.fetch(url);
- var str=eval('(' + response.getContentText() + ')').Placemark[ 0].address;
- return str;
- }
6/03/2008
5/09/2008
GIS planet: Mapwiki gadget
Mapwiki gadget in spreadsheets
How to insert Gadget in spreadsheets see on http://docs.google.com/support/spreadsheets/bin/answer.py?answer=87589&topic=14186
1. Menu>Insert>Gadget
2. Custom...
3. In URL insert http://xbbmapwiki.googlemashups.com/gadget.xml
4. Set size and position
5. Public spreadsheets
See also http://bbs.keyhole.com/ubb/showflat.php/Cat/0/Number/1165615/an/0/page/0#1165615
3/16/2008
Mail-to-GE; Mail-to-Map service
View Larger Map
View in Google EarthMail to Map/SMS-to-Map/Mail to GE service: new twist in (r)Evolution
The idea of creating a simple “Mail-to-Map” service came when I was tracking White-Tailed Deer in the suburbs of Pennsylvania. The GPS coordinates were send by the collared deer as a SMS/Text Message via GSM/cell-phone networks to a server in Sweden, and then relayed to my e-mail account. I was surprised to find out that there was no way for me to gain access to the server, so the creation of dynamic kml/kmz files straight from the server was out of the question. All what I was left with was a set of e-mails with 8 coordinates in each.
Here is my first attempt for a solution, which reads coordinates in e-mail and relays coordinates in real-time to the Google-Earth/Google Map service. I believe this is the fist successful solution of Mail-to-Map service which is based entirely on free web services. Let me know, if it is not correct.
Important notice: since the displayed coordinates belongs to a live animal (currently a white-tailed Deer nicknamed Thor), by reading this page and looking at the map you are accepting terms of agreement: “do not harm the animal in anyway’. Actually it lives on private grounds or a preserve territory anyway.
So, if you want to see the resulting dynamic map, skip this section and click at the map links or download the kml file.
If you are interested in details, here they are.
1. Set up a blog dedicated exclusively to ‘mail-to-map’ service. There are number of possibilities for doing that. For this project I used http://u-mail-to-map.blogspot.com/ Be sure that the blog is set for only for you to edit.
2. Set up e-mail address within blog setting, so that you can e-mail the data to the blog. Use this e-mail address for the step 3.
3. Set automatic mail forward to the e-mail address set in the step 2. I use g-mail account with associated filters to forward only messages referred to particular collar (individual) number.
4. set up a spread-sheet in google-documents and link the blog to the spreadsheets. I use command “=importxml("http://u-mail-to-map.blogspot.com/","//p[1]/text()")”. The resulting spreadsheet is here: http://spreadsheets.google.com/pub?key=pb-UYBP_92h9qQKwbVy07Zg&gid=0
5. Consult google-spreadsheet documentation how to filter/sort the location, and this posts ( http://bbs.keyhole.com/ubb/showflat.php?Number=725524 ; http://bbs.keyhole.com/ubb/showthreaded.php/Cat/0/Number/550183 ) how to construct kml files from the spreadsheets. Mind, that if the coordinates are ‘blank’, the google-maps/google-earth service will treat such locations as ‘syntax error”. In my spread-sheets I corrected “GPS timeouts” by substituting “blanks” with average locations for entire sms message (8 gps fixes).
6. Now link the kml portion of the spreadsheet (http://spreadsheets.google.com/pub?key=pb-UYBP_92h9qQKwbVy07Zg&gid=4&output=txt&range=Q2) to google maps (example here), and create “Network link” as advised in this post (). The resulting KML file is here. Do not forget to “publish” the spreadsheet, and tick the widnow “Automatically re-publish when changes are made”. The address “pb-UYBP_92h9qQKwbVy07Zg” is unique for your spreadsheet.
7. Now, important notice about refresh rates. In my example the coordinated arrive via email every 40 min, blog is updated almost instantly, spreadsheets are updated/re-published c. every 5 mins, but I have notice that it may be as long as 20 mins on some occasions. So it is prudent to set refresh rate to 20-40 min in the network link, so it will deliver the up-to-date coordinates.
8. For web-pages and imbedded iframe links: it is important to set “No-cache” options, and refresh rates. I used all possible solutions to make the web page browser independent:
meta equiv="CACHE-CONTROL" content="NO-CACHE"
meta equiv="PRAGMA" content="NO-CACHE"
meta equiv="Expires" content="0"
The last tag was instrumental to tame IE.
Refresh rate was set to 900 sec by the command
meta equiv="Refresh" content="900"
Failure to set auto-refresh and no-cache options will result in displaying out-of-date locations.
Important is to center the map on your coordinates. I achieve it my pointing g-maps to get ll from the cell in my spreadsheet: “ll=http://spreadsheets.google.com/pub?key=pb-UYBP_92h9qQKwbVy07Zg&gid=1&output=txt&range=G2”.
The resulting Google-Map is here http://www.potapov-nature.com/forBA/deer/map4.html , and kml file (network link) for Google-Earth is here.
A block diagram of the totally free web based Mail-to-Map service is below.
Potentially such simple Mail-to-Map solution can be used for a variety of applications such as satellite telemetry, fleet monitoring, iphone coordinates display, sms-to-map service, etc.
1/05/2008
Text to Image. Spreadsheets.
Download KML
Double click on cell A2 and change text
See changed image and refresh KML
More info about Text2Image see...
9/12/2007
Nearby stars classes
Spreadsheets Sky calculator http://spreadsheets.google.com/pub?key=phRmoRD2Q-V-MoFCsmmkEEw
Now:
- 189 nearby stars of class G (Sun = G2)
- 9 nearby stars of class A
- 106 nearby stars of class F
- 399 nearby stars of class K
- 465 nearby stars of class M
- 123 nearby stars of class WD
http://bbs.keyhole.com/ubb/showflat.php?Number=998956
Credits: http://www.nstars.nau.edu
View in Google EarthVery good article about Sky spreadscheets tools see in Ogle Earth blog
Content for Google Sky: Nearby stars, Astronomy Picture of the Day
Thanks, Stefan!
9/10/2007
Spreadsheets Sky calculator
View in Google EarthSpreadsheets as html:
http://spreadsheets.google.com/pub?key=phRmoRD2Q-V9lqj_iaH_wPg
For KML generation i use cell-based link to cell a1:
http://spreadsheets.google.com/pub?key=phRmoRD2Q-V9lqj_iaH_wPg&output=txt&gid=0&range=a1
In a1 i make "concatenate(..." for all placemarks in spreadsheets.
6/18/2007
Monthly rain rate. Time animation.
View as slideshow
KML Network link to time animated monthly rain rate, mm/hr
WMS+Spreadsheets.
Time: 2004-05-01 2007-04-01
Step: 1 month
Time of interests: 3 years (np make more)
By animation you can uses cursor width = 30-60 days
Credits:
http://disc2.nascom.nasa.gov/Giovanni/tovas/realtime.3B42RT.2.shtml#description
http://disc.gsfc.nasa.gov/services/wxs_ogc.shtml
Monthly accumulated rain.
KML Network link to time animated monthly accumulated rain, mm
Monthly rain rate spreadsheets
Monthly accumulated rain spreadsheets
6/11/2007
Accumulated rainfall daily (mm). Time animation.
Download KML network link.
View as slide show http://www.flickr.com/photos/valery35/sets/72157600327956879/show/
Accumulated rainfall daily (mm). Time animation.
Network link to time animated Rain rate (mm\hr).
WMS+Spreadsheets.
Product name: TRMM_3B42_V6_DAILY
Time=UTC
Time Shift: 2 months
Step: 1 day
Time of interests: 30 days
By animation you can uses cursor width = 1-2 days.
Spreadsheets: http://spreadsheets.google.com/pub?key=phRmoRD2Q-V_omnszDvvOMQ
Credits:
http://disc2.nascom.nasa.gov/Giovanni/tovas/realtime.3B42RT_daily.2.shtml
http://disc.gsfc.nasa.gov/services/wxs_ogc.shtml
6/09/2007
Rain rate. Time animation.
View as slide show http://www.flickr.com/photos/valery35/sets/72157600327956879/show/
Download KML network link
TRMM_3B42RT_3H
Network link to time animated Rain rate (mm\hr).
WMS+Spreadsheets.
This updated now by refresh of spreadsheets and not need edition.
Shift of time: 12 hours
Step: 3 hours
Time of interests: 3 days (np make more)
List of images updated automatically every 5 min!
By animation you can uses cursor width = 3-6 hours.
Spreadsheets: http://spreadsheets.google.com/pub?key=phRmoRD2Q-V9L8erXf9vCLA
Credits:
http://disc2.nascom.nasa.gov/Giovanni/tovas/realtime.3B42RT.2.shtml#description
http://disc.gsfc.nasa.gov/services/wxs_ogc.shtml
Quote:
Experimental Real-Time TRMM Multi-Satellite Precipitation Analysis (TMPA-RT):
Why Study Tropical Rainfall?
The Tropical Rainfall Measuring Mission (TRMM) is a joint U.S.-Japan satellite mission to monitor tropical and subtropical precipitation and to estimate its associated latent heating. Motivations include:
* The tropics play an important role in the global hydrological cycle, and tropical rainfall is the critical component of this role. Three-fourth of the atmosphere's heat energy derives from the release of latent heat of condensation in the process of precipitation. Two-thirds of the global precipitation occurs in the tropics.
* The variability of tropical rainfall affects the lives and economics of more than half of the world's population.
* The large spatial and temporal variability of rainfall systems poses a major challenge to estimating global rainfall.
TRMM provides systematic, multi-year, visible, infrared, and microwave measurements of rainfall in the tropics as key inputs to weather and climate research. The satellite observations are complemented by ground radar and rain gauge measurements to validate the satellite rain estimation techniques.
4/22/2007
Spreadsheets & Charts in GE. Example.
Testing new features of Google Docs&Spreadsheets gave good results.
I place chart as live image into all elements of GE:
- balloon
- icon
- groundoverlay
- screenoverlay
Download KML file
Forum
See also Paleoglobe. Google spreadsheets.
4/21/2007
4/09/2007
Spreadsheets JSON based GMaps. Iframe
I save script with GMaps as html and putting it in an iframe.
See also test of this master
See also
12/31/2006
Google GeoCalendar :)
You can add New calendar to your Calendars.
Now this calendar have 2 events. You can see events in GMaps by click and select in Where link Map
You can see this calendar as HTML or XML
You can see and use this with Feedburner
You can also insert into your Calendar events only. One or two.
I do not know all ways from this. It's see very interests.
12/25/2006
Calendar event test.
Calendar-GEC-Spreadsheets->Maps
GEC maps event
Test, pls :)
I play with Google Calendar
12/21/2006
KML from Google spreadsheets.
See also
http://bbs.keyhole.com/ubb/showflat.php?Number=726183
11/29/2006
Spreadsheets. New site.
AERONET La Jolla
Spreedsheets at calculator links and time animation. AERONET_La_Jolla. Terra. Time animation. 2006.
Pixel size: 2km, 1km, 500m, 250m.
Editgrid XML+XSL.Images group by month.
Credits:
Modis rapid response system.
Download KML: Network link
Path calculator
Spreedsheets at calculator for generation of points, segments and path. All lengths calculate by Great circle distance formula (km, mi).
Download KML : Network link
Fire maps
Spreedsheets at calculator links and time animation.
Editgrid XML+XSL.Images group by month.
Wildfire :
- small 600x300
- med 2048x1024
- large 4096x2048
- xlarge 8192x4096
Credits:
MODIS Rapid Response System Global Fire Maps
Download KML: Network link
Birds fly
Spreedsheets at calculator generate points, segments and path. Time animation. All lengths calculate by Great circle distance formula (km, mi). Generation KML for user datasets. Intergration to Googlegeo ( GE & GMaps ). Datasets and photos by Eugene Potapov.
Download KML: Network link