Posts

Iframe busy inidcating spinning bar.

I got one solution on delving the internet <!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.atta...

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>

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 result 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 +...

Getting MODIS Image Automatically From FTP in Python

# This is a Python script that automatically downloads historical # MODIS data from the LP DAAC FTP site # This version should work for all of the tiled datasets # It is currently hard-coded to downloaded specific MODIS tiles for # the northern Great Plains & upper midwest # Initailly historical date for Data transfer must be set on "lpdacc.txt". import os, ftplib,sys,string # Login information for accessing the LP DAAC FTP site Hostname = "e4ftl01u.ecs.nasa.gov" Username = "anonymous" Password = "@anonymous" # Get user inputs # Base directory for the MODIS data # Basedir = input("Enter the LP DAAC directory containing the dataset you want to download:") Basedir="MOLT/MOD11A2.005" print "The LP DAAC directory containing the dataset you want to download" +str(Basedir) # Local directory for data storage #Hdfdir = input("Enter the local directory where you w...

Simple GUI Demo in Python

from Tkinter import* mainForm=Tk() lblWelcome = Label(mainForm, text="Welcome to SSEBB Model") lblWelcome.pack() lblDisplay=Listbox(mainForm) txtMyval=Entry(mainForm) txtMyval.focus_set() txtMyval.pack() btnQuit=Button(mainForm,text="Close",command=quit) btnQuit.pack(side="left",padx=10,pady=10) def ShowVal(): lblDisplay.insert(0,txtMyval.get()) btnStart=Button(mainForm,text="Show in list",command=ShowVal) btnStart.pack() lblDisplay.pack(padx=20,pady=10) mainForm.mainloop()

Parallel geoprocessing in ArcGIS Desktop.

You will need to edit the Python script supplied to support concurrent geoprocessing of multiple processes. To make these edits you will need an understanding of how to script geoprocessing using Python. Be aware this is just an example of an approach to parallelization of geoprocessing, there may be no benefit in the approach in your particular environment or task. # Author: ESRI # Date: August 2009 # Purpose: This script demonstrates a methodology for parallel geoprocessing in ArcGIS Desktop. # The input is split into parts which are processed by separate subprocesses, # their outputs are appended into the final result. In this specific case, the # geoprocessing undertaken is address geocoding, but any feasible geoprocessing # can be done by simple modification of this script. # Look for the comment line "Begin code block for GP process of interest" try: import arcgisscripting, os, subprocess, sys, time, traceback gp ...