[PLUG] Xconq GIS Help Wanted

Steve Bonds 1s7k8uhcd001 at sneakemail.com
Wed Oct 20 12:51:02 UTC 2004


On Tue, 19 Oct 2004 22:59:31 -0700, AthlonRob wrote:

> My first question for you is... what made you chose C?
> 
> IMHO, C is really going a few steps too low when what you're really
> doing is advanced text manipulation.  It seems to me a scripting
> language such as Python (or perl) might be better suited to this task
> (and less prone to sloppy code causing problems).

I agree with Rob on this one.  Converting/resampling the GIS data
using perl should be pretty easy.  Here is a model for most of my
"translation" perl scripts:

+ figure out what the input looks like, put it in a comment
+ figure out what the output should look like, put it in a comment
+ read the whole input file into a complex hash of hashes data
structure suitable for the input data
 o In the Old Days this was a big no-no because of the memory
required, nowadays memory is fairly plentiful so even those monster
20MB GIS files probably won't overload your PC
 o If there's a perl module to parse the data input, use it
+ pull out the data you want from this monster hash and manipulate it
as needed into a new data structure suitable for your output data
 o Sometimes I'll omit this second data structure and just print it,
if the output is line-oriented
+ iterate over the output structure to send the info to the right
place (screen, CSV file, HTML, XML, database, etc.)
 o If a perl module is available for the API I need, use it!

For your project, this should be maybe 1 or 2 days' work for someone
marginally familiar with perl, or maybe a week for a total newbie.

The hard part is getting good data structures figured out.

  -- Steve




More information about the PLUG mailing list