Wednesday, January 04, 2006

Paleomap Project & Geoprocessing Script

Been super-busy and so have not posted in quite some time. There are a number of things that have been occupying my time, but let's start with the Python script that I have been developing.

The Paleomap Project, developed by Dr. Chris Scotese, is designed to display the evolving Earth as tectonic plates have shifted through time. This project is recognized worldwide as a resource for students and teachers of Earth history. A nice overview can be found here. (Oh, and did you catch the reference to Chris and his work on Very Spatial Episode 21?)

Well, I have been helping him to integrate the Plate Tracker program that Chris wrote in VB6 into ArcMap. Put quite a bit of effort into this, but as always with such efforts, I sure learned a lot. The program allows users to view how different polygons on the Earth's surface would look in a given time period of Earth's history (measured in millions of years).

I will not post the code, but here is the logic of the script:
  • Convert polygon to table of XY coords

  • Launch Plate Tracker (VB6 executable) which shifts the coords according to the time period selected

  • Python once again takes over and converts the shifted coords into a new polygon feature class
I used VBA to direct the activities of the Python script and Plate Tracker. A single VBA button launches a form where users can select from any of the layers currently in the ArcMap project. The VBA then calls the Python script by creating a geoprocessing object within the VBA instead of the more traditional method of invoking a geoprocessing tool from a button on a toolbar with parameters. This is because the VBA code is then forced to wait for the geoprocessing object (in this case my script) to complete before finishing with the next command. The script then calls the Plate Tracker program, waits for this to finish, and then resumes to put the shifted pieces back together again.

Works like a charm. The two biggest hurdles that I had to overcome were (1) handling multipart and donut (inner circles) polygons, and (2) Ensuring that the resulting polygon contained the same attributes as the original file. Solving these hurdles taught me a lot about lists and sublists in Python. Special thanks to all the folks over at ArcView-L for helping me out with the donut polygon problems. This is a great listserv where folks will definitely get back to you.

4 comments:

Southwest Airlines Reservations said...

Thanks for your article. It was interesting and informative.
Here I also want to suggest your reader who usually travels one place to another they must visit Airlines Gethuman that offer best deals to book your seat on Delta Airlines Reservations. So do hurry and avail the best deals and get rid of to check different websites for offers

Southwest Airlines Reservations

Yakshita said...

Thanks for Sharing such an amazing article. Keep working... Your Site is very nice, and it's very helping us.. this post is unique and interesting, thank you for sharing this awesome information

TAPTAP | TAPTAP APK

Ravi Kumar said...

Thanks for your blog. It is well written and easy to understand. I regularly visit your blog for more interesting topics, that is why I am here. I also want to share some information especially for those who are more concerned about their health may visit organic pulses in india. In our online organic store, we made a collection of organic pulses like moong, masoor, Chitra rajma, organic arhar dal or toor dal, and others.

thebeath said...

louis vuitton replica bags neverfull you can try here d9q27h8p29 replica bags new york navigate to this site e4a31e8n56 best replica designer bags replica bags london 9a replica bags helpful resources d2e39i4h51 replica bags vancouver