public inbox for xconq7@sourceware.org
 help / color / mirror / Atom feed
* A Little Help
@ 2004-10-12  2:15 D. Cooper Stevenson
  2004-10-12  2:36 ` Eric McDonald
  0 siblings, 1 reply; 8+ messages in thread
From: D. Cooper Stevenson @ 2004-10-12  2:15 UTC (permalink / raw)
  To: xconq7

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-10-18 23:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-12  2:15 A Little Help D. Cooper Stevenson
2004-10-12  2:36 ` Eric McDonald
2004-10-13  2:38   ` Eric McDonald
2004-10-16  5:08   ` D. Cooper Stevenson
2004-10-16 18:22     ` Website Update Request Elijah Meeks
2004-10-17 14:45       ` Eric McDonald
2004-10-18 23:47         ` D. Cooper Stevenson
2004-10-23 19:39           ` Elijah Meeks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).