[GRASS5] Re: grass57 and 3D import

Markus Neteler neteler at itc.it
Thu Oct 7 09:14:52 EDT 2004


Helena,

(cc to grass5 for the archive)

On Tue, Oct 05, 2004 at 11:52:30PM -0400, Helena wrote:
> I am trying to get myself started in 57 and test nviz so that it can be 
> submitted, but I need some help (or maybe I should read some manual
> or tutorial).

Are you using the older Paudits version or does it already
contain the recent enhancements of 5.7/ogsf?

> To test the 3d stuff I have created a 3d point file (see below) using 
> bugsites
> in spearfish (elevation is from DEM and few have points below surface)
> and imported it as
> s.in.ascii bugsites3d input=bugsitesz.asci d=3
> this creates a vector point file

I guess that v.in.ascii should be used.
"-z
    create 3D file"
"

[ the coordinates in my example below are also for Spearfish]

echo "593493.1|4914730.2|123.1|studna
591950.2|4923000.5|222.3|kadibudka
589860.5|4922000.0|232.3|hruska
590400.5|4922820.8|143.2|mysi dira
593549.3|4925500.7|442.6|mineralni pramen
600375.7|4925235.6|342.2|mineralni silnice" | v.in.ascii -z zcol=3 catcol=0 \
	out=mypoints3D columns='x double, y double, z double, label varchar(20)'

You may have to use fs= if you have different field separator.

> but v.info indicates that B and T are 0, so it must have ingored d=3 upon 
> import

no, I guess because s.in.ascii is inappropriate.
I have just extended the HTML page of v.in.ascii, adding above
example.

> However, when I modified the ascii file to 3d site format and imported it 
> with
> v.in.sites, it worked. But I still won't get the basic statistics on the 
> file (probably my mistake as I have never used any DBM tools).

So, now we can try:

d.vect mypoints3D
d.vect mypoints3D disp=attr attrcol=label
# -> points with labels

#check DB:
echo "SELECT * from mypoints3D" | db.select
cat|x|y|z|label
1|593493.100000|4914730.200000|123.100000|studna
2|591950.200000|4923000.500000|222.300000|kadibudka
3|589860.500000|4922000.000000|232.300000|hruska
4|590400.500000|4922820.800000|143.200000|mysi dira
5|593549.300000|4925500.700000|442.600000|mineralni pramen
6|600375.700000|4925235.600000|342.200000|mineralni silnice

Works.

> GRASS 5.7.cvs:/data/b_usr4/b_usr4/grassdata/spearfish/helena/site_lists > 
> v.univar bugsitesz3dt col=1
> WARNING: Incompatible types, only number of features, minimum, maximum and
>          range can be calculated
> DBMI-DBF driver error:
> SQL parser error in statement:
> SELECT cat, 1 FROM bugsitesz3dt
> Error in db_open_select_cursor()
> 
> ERROR: Column type not supported

Yes, I guess that you didn't specify the column type when using
v.in.ascii (see my example above how to do that). By default it will
make every type in the DB a string as it cannot guess the column type.

v.univar mypoints3D col=z
WARNING: Incompatible types, only number of features, minimum, maximum and
         range can be calculated
number of features with non NULL attribute: 6
number of missing attributes: 0
number of NULL attributes: 0
minimum: 123.1
maximum: 442.6
range: 319.5

which looks ok. IMHO the warning is confusing, but this could be improved.

> g3.createwind says after it is finished -

There must have been an error (which I fixed right now in 5.3 and 5.7 CVS).

> Now run g3.region to verify the settings.
> but there is no g3.region in 5.7 (should that message just be removed?)

There is (for a few days), please update your 5.7 version.

> When I get more familiar with 5.7 and the current 3d stuff I hope that I 
> will have fewer questions and rather provide some help.

Hope that it works now

 Markus




More information about the grass-dev mailing list