From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16717 invoked by alias); 11 Oct 2004 06:26:31 -0000 Mailing-List: contact xconq7-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: xconq7-owner@sources.redhat.com Received: (qmail 16590 invoked from network); 11 Oct 2004 06:26:29 -0000 Received: from unknown (HELO gencom001.gencom.us) (208.45.97.129) by sourceware.org with SMTP; 11 Oct 2004 06:26:29 -0000 Received: from localhost (localhost [127.0.0.1]) by gencom001.gencom.us (Postfix) with ESMTP id 6402769AB for ; Sun, 10 Oct 2004 23:45:08 -0700 (PDT) Received: from gencom001.gencom.us ([127.0.0.1]) by localhost (gencom001.gencom.us [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 32172-07 for ; Sun, 10 Oct 2004 23:45:08 -0700 (PDT) Received: from [192.168.0.100] (home [67.171.201.213]) by gencom001.gencom.us (Postfix) with ESMTP id EEE0163D3 for ; Sun, 10 Oct 2004 23:45:07 -0700 (PDT) From: "D. Cooper Stevenson" Reply-To: cstevens@gencom.us Organization: GenCom To: xconq7 Subject: A Little Help Date: Tue, 12 Oct 2004 02:15:00 -0000 User-Agent: KMail/1.6.2 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200410102134.15234.cstevens@gencom.us> X-Virus-Scanned: by amavisd-new at gencom001 X-SW-Source: 2004/txt/msg01350.txt.bz2 Dear All, I've worked hard on importing ASCII data from GIS. Here's the good news: * Exporting GIS data into ASCII may be automated using just one command * The ASCII file format is simple Here's the bad news: * I haven't written (but do respect) the C language in a long time and it shows; I've had a tough go of it getting the application to work. I think it's time to ask for help. As I mentioned above, the GIS ASCII file format is simple. Here's a description: The first 7 or so lines represent the header of the file. The most relevant numbers for our purposes are the "rows" and "cols" numbers. The last line is the actual elevation (or landcover) data. Here's an example: north: 3980319.16466812 south: 3978824.85093895 east: 443960 west: 442296 rows: 747 cols: 832 10 10 10 9 9 ........... Each number represents a terrain type. Well, that's not exactly true, but it's close. 1-3 say, is beach, 4-6 is plains and so on. So if you want an area of 54 x 42 cells, you would want to sample a "box" of 13 x 20 cells. In other words: 1) Sample the first 13 numbers across by 20 lines down. A "mode" calculation (the number that shows up the most) is best. An average will do I think. Export this number to a terrain file; this is the first cell type. 2) Jump to the next "box," i.e. column 14-27 while still on lines 1-20 and output it to a file. This is the second cell type. 3) Repeat until the file is finished. Here is my code so far: http://www.xconq.org/ascii/parsegis.c Here is the actual GIS file (Huge: 21M): http://www.xconq.org/ascii/seattle.arx If you can offer a little help I'd be greatfull. -Coop