From: "D. Cooper Stevenson" <cstevens@gencom.us>
To: xconq7 <xconq7@sources.redhat.com>
Subject: A Little Help
Date: Tue, 12 Oct 2004 02:15:00 -0000 [thread overview]
Message-ID: <200410102134.15234.cstevens@gencom.us> (raw)
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
next reply other threads:[~2004-10-11 6:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-12 2:15 D. Cooper Stevenson [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200410102134.15234.cstevens@gencom.us \
--to=cstevens@gencom.us \
--cc=xconq7@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).