NOAA releases the "before" and "after" shots for the damage caused by last week's F5 tornado in McFarland Boulevard in Tuscaloosa. Those images are captured from 5,000 ft high using special remote sensing equipment.
Tuesday, May 3, 2011
Saturday, April 30, 2011
Mapping the Disease Trends
West Nile Virus (WNV) is the most widespread arbovirus (viruses that are transmitted by arthropods) in theworld. . During the period of 1996 -1999, the WNV became prevalent insouthern Romania, the Volga delta in southern Russia, and the northeastern United States. The spread of WNV covered the United States from coast to coast in four years, and by then it had 7 infected about one million Americans, killing about eight hundred.
Here I mapped the spatial trends of WNV virus in the United States of America.
Check website - http://globalmonitoring.sdstate.edu/eastweb/maps/wnv1999_2011/
Here I mapped the spatial trends of WNV virus in the United States of America.
Check website - http://globalmonitoring.sdstate.edu/eastweb/maps/wnv1999_2011/
Thursday, April 21, 2011
Add and Remove DOM Elements..
Snippets for adding DOM elements dynamically to the defined DOM element.
Here, "mydiv2" is added dynamically as "mydiv"1's child.
//Dynamically generate Div
var newdiv = document.createElement('div');
var divIdName ='mydiv2';
newdiv.setAttribute('id',divIdName);
newdiv.style.width = "565px";
newdiv.style.height = "480px";
newdiv.style.left = "0px";
newdiv.style.top = "0px";
newdiv.style.position = "absolute";
newdiv.style.border = "1px solid #000";
document.getElementById('mydiv1').appendChild(newdiv);
A good example by Dustin Diaz to remove DOM elements Dynamically.
Here, "mydiv2" is added dynamically as "mydiv"1's child.
//Dynamically generate Div
var newdiv = document.createElement('div');
var divIdName ='mydiv2';
newdiv.setAttribute('id',divIdName);
newdiv.style.width = "565px";
newdiv.style.height = "480px";
newdiv.style.left = "0px";
newdiv.style.top = "0px";
newdiv.style.position = "absolute";
newdiv.style.border = "1px solid #000";
document.getElementById('mydiv1').appendChild(newdiv);
A good example by Dustin Diaz to remove DOM elements Dynamically.
removeElement JavaScript Function
function removeElement(divNum) {
var d = document.getElementById('myDiv');
var olddiv = document.getElementById(divNum);
d.removeChild(olddiv);
}
Sunday, April 3, 2011
Detect Browser Type Using Javascript and Pass it into PHP variable
<html>The php portion shows the example of "Passing Javascript variable into the PHP variable"
<head>
<script type="text/javascript" language="javascript">
function DetectBrowser(){
// Browser Detection Javascript
// copyright 1 February 2003, by Stephen Chapman, Felgall Pty Ltd
// You have permission to copy and use this javascript provided that
// the content of the script is not changed in any way.
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("opera") != -1) return 'Opera';
if (agt.indexOf("staroffice") != -1) return 'Star Office';
if (agt.indexOf("webtv") != -1) return 'WebTV';
if (agt.indexOf("beonex") != -1) return 'Beonex';
if (agt.indexOf("chimera") != -1) return 'Chimera';
if (agt.indexOf("netpositive") != -1) return 'NetPositive';
if (agt.indexOf("chrome") != -1) return 'Chrome';
if (agt.indexOf("firefox") != -1) return 'Firefox';
if (agt.indexOf("safari") != -1) return 'Safari';
if (agt.indexOf("skipstone") != -1) return 'SkipStone';
if (agt.indexOf("msie") != -1) return 'Internet Explorer';
if (agt.indexOf("netscape") != -1) return 'Netscape';
if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
if (agt.indexOf('\/') != -1) {
if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
return navigator.userAgent.substr(0,agt.indexOf('\/'));}
else return 'Netscape';} else if (agt.indexOf(' ') != -1)
return navigator.userAgent.substr(0,agt.indexOf(' '));
else return navigator.userAgent;
}
</script>
</head>
<title>
</title>
<body>
<?php
$browser= "<scriptlanguage=javascript>document.write(DetectBrowser());</script>";
echo $browser;
?>
</body>
</html>
Sunday, March 27, 2011
A thought in the lazy day
Being a geographer, I am so thrilled in my life. I got opportunities to feel nature from the bottom of my heart. I am also an engineer. I found geography is more interesting than engineering; however I love math, statistics, and scientific computing. I never afraid from math meantime, implementing math in geography is very fascinating job for me.
It’s a time to integrate technology with nature so don’t get late to be a geographer and experience ecstatic in your entire life.
It’s a time to integrate technology with nature so don’t get late to be a geographer and experience ecstatic in your entire life.
Friday, March 18, 2011
How to get Color Brewer Ramp in ArcMap 10?
There are two ways to achieve this:
Method A steps:
1. Download Color Brewer Color Ramp Style Set from http://arcscripts.esri.com/details.asp?dbid=14403
2. Unzip it.
3. Open the Layer properties and click on ‘Symbology’ tab in ‘ArcMap 10’.
4. Double click on one of the color symbol beneath ‘Symbol’ that gives you a ‘Symbol Selector’ window.
5. Click “Style References..”
6. Click “Add Style to List..” and add ‘ColorBrewer.style’ that is obtained from setp 2.
7. If you made it correctly it should be listed in the ‘Style References’.
8. Select ‘ColorBrewer.style’ and make it default.
9. Close the layer properties once and open it again, you will see newly generated color ramp.
Method B steps:
1. You have to pick each color ramp value manually from http://colorbrewer2.org/ .
2. Open the Layer properties and click on ‘Symbology’ tab in ‘ArcMap 10’.
3. Double click on one of the color symbol beneath ‘Symbol’ that gives you a ‘Symbol Selector’ window.
4. Click on ‘Edit Symbol’.
5. Click on Color box inside ‘Simple Fill’ area.
6. Click on “More Colors” which gives you Color Selector.
7. Choose RGB from Drop down box located in the top right.
8. Then, update values that come from Colorbrewer.
Voila Cheers!!!!!
I would like to recommend ‘Method A, because it is faster than Method B. (Does the same work but time consuming)
The author of color brewer, Cynthiya Brewer also published a book Designing better Maps in ArcGIS.
Tuesday, February 22, 2011
Iframe busy inidcating spinning bar.
I got one solution on delving the internet
Thank you for the original post(http://www.dynamicdrive.com/forums/showthread.php?t=22759).
And I modified this according to my need as below:
<style type="text/css">
#holder, #holder iframe {
position:relative;
width:500px;
height:400px
}
#loading {
<!--height:50px;
width:125px;
padding:1ex;
position:absolute;
top:50%;
left:50%;
margin-top:-25px;
margin-left:-63px; -->
display:none;
<!--border:2px groove gray;
background-color:#cccccc;
color:#333333; -->
}
</style>
<script type="text/javascript">
var loadit=function(){
var f=document.getElementById('iframemap'), l=document.getElementById('loading').style;
l.display='block';
if(f.onload==null){
f.onload=function(){l.display='none'};
if(window.attachEvent)
f.attachEvent('onload', f.onload);
}
return true;
}
</script>
And what you need is spinning.gif image.
<div id="holder">
<iframe name="iframemap" id="iframemap" width="550" height="450"></iframe>
<div id="loading"> <img src="images/busy.gif"></div>
</div>
Cheers !!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> <html> <head> <title>Iframe Loading Notice - Demo</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> #holder, #holder iframe { position:relative; width:500px; height:400px } #loading { height:50px; width:125px; padding:1ex; position:absolute; top:50%; left:50%; margin-top:-25px; margin-left:-63px; display:none; border:2px groove gray; background-color:#cccccc; color:#333333; } </style> <script type="text/javascript"> var loadit=function(){ var f=document.getElementById('myframe'), l=document.getElementById('loading').style; l.display='block'; if(f.onload==null){ f.onload=function(){l.display='none'}; if(window.attachEvent) f.attachEvent('onload', f.onload); } return true; } </script> </head> <body> <div id="holder"> <iframe id="myframe" name="myframe" src="about:blank" scrolling="auto" frameborder="1"></iframe> <div id="loading">Loading . . .</div> </div> <a href="http://www.google.com/" target="myframe" onclick="return loadit();">Google</a><br> <a href="http://www.dynamicdrive.com/" target="myframe" onclick="return loadit();">Dynamic Drive</a> </body> </html>
Thank you for the original post(http://www.dynamicdrive.com/forums/showthread.php?t=22759).
And I modified this according to my need as below:
<style type="text/css">
#holder, #holder iframe {
position:relative;
width:500px;
height:400px
}
#loading {
<!--height:50px;
width:125px;
padding:1ex;
position:absolute;
top:50%;
left:50%;
margin-top:-25px;
margin-left:-63px; -->
display:none;
<!--border:2px groove gray;
background-color:#cccccc;
color:#333333; -->
}
</style>
<script type="text/javascript">
var loadit=function(){
var f=document.getElementById('iframemap'), l=document.getElementById('loading').style;
l.display='block';
if(f.onload==null){
f.onload=function(){l.display='none'};
if(window.attachEvent)
f.attachEvent('onload', f.onload);
}
return true;
}
</script>
And what you need is spinning.gif image.
<div id="holder">
<iframe name="iframemap" id="iframemap" width="550" height="450"></iframe>
<div id="loading"> <img src="images/busy.gif"></div>
</div>
Cheers !!
Friday, February 18, 2011
Convert PHP array into Javascript array
I got a chance to write a script that converts php array into javascript array.
Here it is..
<?php
$phparray= array(1,2,3,4,5);
?>
<script type="text/javascript" language="javascript">
var mydata = new Array (
<?php
for ($i = 0; ($i < count($phparray)); $i++) {
if ($i > 0) {
echo ",\n";
}
echo " \"";
echo $phparray[$i];
echo "\"";
}
?>
);
</script>
Here it is..
<?php
$phparray= array(1,2,3,4,5);
?>
<script type="text/javascript" language="javascript">
var mydata = new Array (
<?php
for ($i = 0; ($i < count($phparray)); $i++) {
if ($i > 0) {
echo ",\n";
}
echo " \"";
echo $phparray[$i];
echo "\"";
}
?>
);
</script>
Wednesday, November 10, 2010
R Environment and PostgreSQL
# Install PostgreSQL 8.4 - 32 bit and install pgJDBC Driver, OLEDB Driver from Stack Builder..........
# Install R 2.11.1 -32 bit
# Open R interface..
library(rJava)
library(DBI)
library(RJDBC)
library(RpgSQL)
.jinit(classpath=NULL,parameters=getOption("-Xmx4000m"),silent=FALSE,force.init=TRUE)
con <- dbConnect(pgSQL(), user = "username", password = "password", dbname = "db_name",host="hostname")
result<-dbGetQuery(con, 'select blah1, blah2 from "tbl_blh"')
str(result)
result
Cheers !!!
# Install R 2.11.1 -32 bit
# Open R interface..
library(rJava)
library(DBI)
library(RJDBC)
library(RpgSQL)
.jinit(classpath=NULL,parameters=getOption("-Xmx4000m"),silent=FALSE,force.init=TRUE)
con <- dbConnect(pgSQL(), user = "username", password = "password", dbname = "db_name",host="hostname")
result<-dbGetQuery(con, 'select blah1, blah2 from "tbl_blh"')
str(result)
result
Cheers !!!
Automatically Generate KML Files from CSV file
# Import System Modules
import sys, string, os, csv
# Enter the input and output file names here
inputFileName="PROJECT.csv"
outputFileName="PROJ.kml"
inFile=open(inputFileName)
outFile=open(outputFileName,'a')
# Enter the total number of records here
numobs = 12
header =""+"\n"+\
""+"\n"+\
""+"\n"+\
"Spatial Distribution of Students "+"\n"
# Read in the stand attributes file one line at a time
outFile.write(str(header))
for obs in range(numobs):
readline=inFile.readline()
# Select the variables
currow=readline.split(",")
student=currow[0]
year=currow[1]
rslat=currow[2]
rslong=currow[3]
advisor=currow[4]
studyarea=currow[5]
outFile.write(""+"\n"+\
""+student+" "+"\n"+\
""+"Location: "+studyarea +","+"Thesis Year: "+year+","+"Thesis Advisor: "+advisor +" "+"\n"+\
""+"\n"+\
""+rslong+","+rslat+"13"+" "+"\n"+\
" "+"\n"+\
" "+"\n")
#print studentInfo
#outFile.write(str(studentInfo))
footer=" "+"\n"+\
" "
outFile.write(str(footer))
inFile.close()
outFile.close()
import sys, string, os, csv
# Enter the input and output file names here
inputFileName="PROJECT.csv"
outputFileName="PROJ.kml"
inFile=open(inputFileName)
outFile=open(outputFileName,'a')
# Enter the total number of records here
numobs = 12
header =""+"\n"+\
"
"
"
# Read in the stand attributes file one line at a time
outFile.write(str(header))
for obs in range(numobs):
readline=inFile.readline()
# Select the variables
currow=readline.split(",")
student=currow[0]
year=currow[1]
rslat=currow[2]
rslong=currow[3]
advisor=currow[4]
studyarea=currow[5]
outFile.write("
"
"
"
"
"
"
#print studentInfo
#outFile.write(str(studentInfo))
footer="
"
outFile.write(str(footer))
inFile.close()
outFile.close()
Subscribe to:
Posts
(
Atom
)