Friday, June 13, 2008

Why am I always the last to know?

Apparently the term GIS died...How come I'm always the last to know these things...

:)

And when did GIS just become data and mapping?

Tuesday, June 10, 2008

ArcGIS QuickTip #2

This isn't a quicktip. I've posted a short example on how to use ModelBuilder in ArcGIS to build a more robust tool by adding options to manipulate the Environmental Settings.

http://boxshapedworld.googlepages.com/modelbuildertips

Monday, June 9, 2008

Camel's 'R' Us

I am working on creating scripts to create weighted linear combination. Basically duplicating different features in Idrisi so that I can have two models, one in ArcGIS and Idrisi. This is for the "Camel Project." I have a script now that calculates the weights for a pairwise matrix. Once I found a little information on this topic it was fairly easy to create. It is mostly just multiplying the matrix until the differences between the weights calculated from each iteration equals zero. Unfortunately, the python script is dependent on NumPy (Numerical Python), so it isn't as self-contained as I would like. I didn't feel like writing a function to multiply matrices, although I did this in VB.NET. I also am able to calculate the consistency ratio. I would share the script, but I because I am getting paid to do it, it is up to the client.

I also have managed to use Raster Calculator to duplicate the Fuzzy tool in IDRISI. It is a duplicate of the Linear function, and there are two ways to calculate it. One for monotonically increasing, and the other for monotonically decreasing. The formula is for 0 to 255.
Con is a map algebra function that means conditional. Con(test, true, false).

Here is how it works for monotonically decreasing:

INT((Con([RasterToBeScaled] <> 900, 0,( ((900 - [RasterToBeScaled]) * 255) / 900) + 0))) + .5)

Con([RasterToBeScaled] <> 900, 0 if the cell value is greater than 900 give this cell a value of 0. If it is false then calculate the value
( ((900 - [RasterToBeScaled]) * 255) / 900) + 0)))

INT and +.5 rounds the values properly and removes the decimal places.
The range of this example is from 0 to 900, so you need to change those values depending on what your "maximum and minimum" values are going to be. You really divide 900 - [RasterToBeScaled] by the range (max - min raster values). Since my range was 0 to 900 I skipped this and put 900.

If you need this to increase then you have to change some of it around.
INT((Con([RasterToBeScaled] <> 900, 255,( (([RasterToBeScaled] - 0) * 255) / 900) + 0))) + .5)

Now, whatever is less than zero is zero and greater than 900 is 255. Everything in between is calculated using the formula:
( (([RasterToBeScaled] - 0) * 255) / 900) + 0))
So now we subtract the cell value by the lowest value in your range and everything else is the same.

This is similar, but not quite what I was looking for.

Hope that helps...

Wednesday, June 4, 2008

Python QuickTip

I'm not much of a Python user. I don't care for the syntax (probably because I don't use it enough). It took me forever to find where I could read the input list from a toolbox in ArcGIS...i.e. a multivalue parameter.

Here is the help file that I found. Look under the Using a multivalue input in a script section.

Another problem I have with Python mostly comes from ArcGIS, which is the only time I ever use Python. Well, most of programming revolves around Spatial Software in some way. Everytime I try and do something with the geoprocessing scripts, I seem to run into a bug. I wrote a script once that exported coverages from all the featureclasses in a workspace. This script stopped to function from the toolbox with service pack 3 (9.2). I think this is working again with service pack 4. Also, apparently the reset method on a lot of the cursors do not work, so forget about reusing a cursor. Seems like every time I need to write a little geoprocessing script I need to try and figure out a workaround because I find another problem. Granted though, I've had some success too.

On a completely different note:

I was also updating my Antivirus and saw that one way to help them was add a link to their site. I use the ClamWin open source antivirus program. I've probably used it for maybe a year, and have been happy with it. It isn't the beast of a software that Norton is. I can only vouch for it on a personal computer, so I don't know how it would work at an "enterprise" level. I haven't had any viruses, but then again, I didn't have any before I installed it either...knock on cyber wood.

Tuesday, June 3, 2008

New Media

I've noticed this topic in a few blogs recently, sparked by a presentation given at Where 2.0 this year by Dr. Lisa Parks. I did not attend this conference or see the presentation, so all my information is second hand. I think this is an interesting topic, repositioning GIS as not a tool but as media, or a form of communication. Her topic revolved much more around Satellites and the lack of public knowledge or information about satellites (metadata). Here is a transcript and notes on the presentation. There has been varied reactions, some quite critical. Personally, I think the criticisms are coming from the pragmatic or post-positivist stance so commonly found in the GIS as tool perspective. I don't want to put words in her mouth, but my interpretation of her presentation is that the GIS (Geospatial, neogeography, etc...) community needs to recognize that satellites are not impersonal objective eyes in the world. They serve a purpose, their lens' are not focused arbitrarily on the world, but pointed at places, for profit in most cases. I think this is a perfectly ok stance to take. I think that it is good to leave aside the notion that GIS is an objective tool and recognize it as a communication devise that serves a purpose. Not only that, but that the information stored in a database is inherently unobjective as well. We have the notion that raw data is objective, but regardless that data is stored in a format that was "invented" and the structure of the data "invented." Right off the bat, there is a western bias to the structure of the data, because it revolves around western thinking. The primitive geometric structures of a GIS are western biased and evolved from the western cartographic tradition. I'm not criticizing the formats, just recognizing the problem.

Obviously, communication can be twisted (see How to Lie with Maps). I think it is even easier to lie with satellite imagery. If a satellite image is shown in a presentation and you are told it is of a certain location at a certain time, you just have to accept or not accept that as the truth.

The link above was mostly critical of her critique of the Darfur project. Again, following my explanation, then the point is that the unbiased imagery begins to serve a biased purpose (or second biased purpose if you count the original acquisition), that of stopping the Darfur crisis. I'm not arguing against or criticizing the Darfur project, but recognizing that there is a goal behind showing the geographic information...

Anyway, when it comes to working in GIS, I use it as a tool, and I'm very much a pragmatic post-positivist (if I may mix epistemologies). I wouldn't be surprised if we start to see more conversations like this popping up, especially with more and more geographic information becoming readily available, and programs like Google Earth gaining in popularity...

PDF and ESRI

This has been blogged by several people already (Spatially Adjusted and Fantom Planet to name a few). It sounds like it will be pretty cool in theory. A spatial pdf direct from ArcGIS 9.3. Maybe now I'll stop getting those stupid GeoPDF spam mails.

Sunday, June 1, 2008

Programming Tutorials Update

I've managed to do 7 lessons so far, and am working on the 8th. I used to be pretty good at taking ideas and writing it in plain English, but I realized that the more you learn about a topic the harder it becomes not to use the custom terminology. I'm trying to do my best to keep the lessons in plain English. We'll see how that goes.

I hope to do a lesson every couple of days. Starting with lesson 8, there will probably be a total of 2 or 3 lessons that build a little project.

Hope you enjoy.