4.28.2005

Forest Canopy and GPS

Here is a little summary about some of the problems with using GPS in forested areas.

White Paper on GPS in Forest Areas

Telemetry of Forest Elephants, Moonwalking Birds, and a Laser Yardstick

This comes from a show I was watching on PBS called Deep Forest. There were some very cool uses of GPS, remote sensing and 3D modelling....this is one...oh yeah, and interactive mapping.

Forest Elephnants

Manakin Birds...can you say MoonWalk!...check out the video links!!!

Manakin Birds

Here's another
Manakin Birds 2

Here's the ultimate handheld solution for collecting 3D information in forests
Laser Yardstick

LIDAR and Forest Canopy Structure

4.25.2005

Processing the LIDAR

I just finished processing the City of Sacramento LIDAR data to generate a 2' DEM. It took 12 straight days of processing (24/7). I am currently working on a QA/QC of the DEM mosaic.

Thanks to the UC Berkley guys for providing me batch routines for some of the initial processing.

I used several software packages to generate the DEM partly because of the amount of data I had to process and the fact that I did not have any developed batch routines that would work within ESRI.

PERL - for processing ascii text points to new overlapping tiles
Surfer - to Grid the point data using a Kriging algorithm
Python - to batch import Surfer text to ESRI text format and ESRI Grid format
ESRI - to generate the DEM mosic and QA/QC

The LIDAR data came from a flight done by Merrick in 2004. The data were in over 1300 text files containing the XYZ location of each laser point. Since the files were not overlapping, I used the PERL script to re-bin the ascii text points to new files (1370 files to 70 files). I next used Surfer and a Surfer Script to create the overlapping Surfer Grids. I then used a Surfer script to generate ASCII text formatted files. From here I ran a command line script to convert the Sufer text to ESRI text. I then ran a Python script I created to batch process the Ascii text files to ESRI Grid image files. The "glob" code helped me do this. Finally, I created a DEM mosaic using the Mosaic to New File function within ArcGIS.

Check the links for more info on what LIDAR is.
NC

4.18.2005

Dad, Where does a pole come from?

Not the North Pole or magnetic pole, but a measure of distance. A pole is a British measurement of distance that was often used to measure land. I recently came across this interesting measure when I was reading Lewis and Clark's journals. They described the Great Falls of Montana to be a length of so many poles from one fall to the next. So upon searching the glorious internet, I came across what a pole is.

A pole is is 1/4 of 22 yards (66 feet) which comes out to be 16.5 feet. This was related to the amount of land a person could work over the course of a day. "It was reckond to be 2 perches by 2 perches (33 x 33 feet). Related to this was the ability for oxen to work an area of land in a day. 40 dayworks in an acre--the area that could be worked by a team of oxen in a day. A daywrok being 4 square perches.

4.13.2005

Earth Day Coming Up!!

Earth Day, April 23....Do what you can do for your local environment. Check the Earth Day Link for more general information.

Also, TV TurnOff Week (April 25-May 1) is coming up...Do it for the Kids! (see link)

Earth Day is Everyday!

4.12.2005

Glob Code

The code I got to work is as follows. I then used elements in the list to run my ASCII to GRID algorithm. This code only runs under the PythonWin GUI. I have yet to get it functioning within ArcGIS 9x. You may need to do some minor modification since you will be cutting/pasting the code into PythonWin. You will also need to change path names.
NC

#Author: Naticus Cartographica
#Created: April 12, 2005
#Batch ESRI ASCII format to ESRI GRID format Conversion
#Python 2.1 for use with ArcGIS 9.x

#Import standard/necessary library modules
import win32com.client, sys, os, glob, string

#Create the Geoprocessor object
GP = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1")

#Set the input/output workspace
GP.workspace = "C:/Naticus/python_test"
#GP.workspace = sys.argv[1]
print "The name of the workspace is " + GP.workspace
GP.addmessage ("The name of the workspace is: " + GP.workspace )
#Check for this toolbox (not absolutly needed)
#GP.Toolbox = "Conversion"

#Set the output workspace
#outWorkspace = sys.argv[2]
outpWorkspace = "C:/Naticus/python_test"

#create the file list with the .txt file extension
#this is a temporary file, but could be made to an output file
#Python has a structure called a "glob" that allows the parsing
#of file/string names

filelist = glob.glob('*.txt')

#loop through the list of files and process each one
#indenting is important, since Python uses this format for processing
for filename in filelist:
if GP.exists(filename):
print "Input file: " + GP.workspace + "/" + filename + " does exist"
GP.addmessage ("Input file: " + GP.workspace + "/" + filename + " does exist" )

#create output file by removing the .txt extension and adding grd to
#the end of the file (this is not an extension, just a trailer)
#the format of the output file is a ESRI GRID format
outgrid = filename[:-4] + "grd"
print "Output file: " + outWorkspace + "/" + outgrid



elif GP.exists(outgrid):
print outgrid + " already exists"

# Process: ASCIIToRaster_conversion

GP.ASCIIToRaster_conversion(filename, outgrid, "FLOAT")

print "Finished converting ASCII file: " + filename + " to: " + outgrid + " GRID file."


except:
GP.AddMessage(GP.GetMessages(2))
print GP.GetMessages(2)




4.11.2005

The Glob

I spent part of the day researching how to create and use a listfile within a Python script so that I can run a batch process to convert ASCII XYZ data to ESRI Raster GRIDs. They key is the use of a 'glob'. The glob allows for a user to create a list of specific filies containing a particular extension (or other criteria). In my case it was just creating a list of files that ended with ".txt". Then you can use this to create input and output variables for other functions such as the ASCIItoRaster function in ArcGIS.

In AML (Arc Macro Language) functions already existed (along with examples) of how to do and use this for Arc Workstation. Now that times have changed new processes are needed and are sometimes not so obvious....at least for the semi-need-to-figure-it-out-when-I-have-to programmer. Yes I could just do my processing in AML, but that is 'old school' + who knows when AML will no longer be supported.

Global Challenges

The Earth has many environmental challenges....clean water, clean air, enough food, population pressures, conservation of wetlands, energy use.

We can each play our part in finding sustainable solutions to these problems...and they don't have to impede our lifestyles...many of them are simple changes. Here are a few:

-Turn off the lights when you are not home
-Use public transportation (Where I live, it costs less for me to travel by public transportation than to drive a car, let alone the cost of parking).
-Water your lawn in early morning or late evening
-Start a compost pile and use it on your own vegetable garden or lawn
-Turn down your water heater
-Plan trips to multiple stores
-Buy bulk

Check out the links on the right for other sources on Global Challenges

NC

4.05.2005

Remote Adnventures Added

I have put a couple of links to some remote adventures that I am aware of. I have done work in both of these areas and at some point will actually be able to do these.

Check back for more.
NC

Talking to MySQL 4.1 through PHP 5

Well,
I finally got my PHP code to talk to MySQL 4.1. I ended up installing the latest version of PHP 5.0.4 which came out last week. There are some difference between older verions of MySQL beingable to read the "password" parameter when connecting to a MySQL database. I thought I was going to have to use a trick that I found to run an old_password() routine, but I didn't. I did notice that PHP 5 changes some syntax in creating and using variables from previous versions...such as using $_REQUEST, $_GET, $_POST instead of just setting regular variables such as $name. Also, the use of single quotes seems to be used more often than double quotes for variables.

So I am now able to connect to MySQL database, put data in and post data back all through a web interface. More to come on my quest for a database driven website. Check out tutorial informatinon from SitePoint and Build Your Own Database Driven Website Using PHP & MySQL by Kevin Yank.