[GRASS-user] NVIZ and 3D polygon

Dear All,
I am doing 3D modeling of a complex urban area (buildings and
topography) for my research.
First, I try to look if Grass (via NVIZ) could handle 3D polygon.
When I try to import my dxf model (modelled in SketchUp Pro) with
v.in.dxf, everything is OK.
But apparently, in NVIZ it came with error message :

invalid command name ".middle.panelarea.panels.vect.mid.row2.label2"
invalid command name ".middle.panelarea.panels.vect.mid.row2.label2"
    while executing
"$row2.label2 select"
    (procedure "mkvectPanel" line 91)
    invoked from within
"$cmd $W"
    (procedure "set_new_curr" line 16)
    invoked from within
"set_new_curr $type [string range $temp 5 end]"
    (procedure "add_map" line 11)
    invoked from within
"add_map vect"
    invoked from within
".middle.panelarea.panels.vect.top.new invoke"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list $w invoke]"
    (procedure "tk::ButtonUp" line 22)
    invoked from within
"tk::ButtonUp .middle.panelarea.panels.vect.top.new"
    (command bound to event)

I had tried with different dxf version, lowering 3D resolution,
different dxf exporter (sketchup, blender) but no result.
Is it something with OpenGL setting? I am using Grass 6.3 in Leopard.
Or something else I miss?

Thank you for your kind help

--
Regards,
Aswin Indraprastha
Graduate Student on Design Computing
Urban Design Science Lab
Faculty of System Engineering
Shibaura Institute of Technology
307 Fukasaku Minuma-ku Saitama-City, 337-8570 JAPAN
Tel:+81-48-687-5838 Fax:+81-48-687-5199
http://aswinindraprastha.wordpress.com

aswin indraprastha wrote:

Dear All,
I am doing 3D modeling of a complex urban area (buildings and
topography) for my research.
First, I try to look if Grass (via NVIZ) could handle 3D polygon.
When I try to import my dxf model (modelled in SketchUp Pro) with
v.in.dxf, everything is OK.
But apparently, in NVIZ it came with error message :

invalid command name ".middle.panelarea.panels.vect.mid.row2.label2"
invalid command name ".middle.panelarea.panels.vect.mid.row2.label2"
    while executing
"$row2.label2 select"

Hi Aswin,

did you start NVIZ from the command line or from the menu?

after checking the region bounds/resolution with 'g.region -p' make a raster
surface to put it on.

  r.mapcalc zero=0

from the command line start NVIZ with

  nviz -q

then load the raster surface and the 3D vector manually.
You may want to set the raster to be transparent.

does that help?

Hamish

      ____________________________________________________________________________________
Get easy, one-click access to your favorites.
Make Yahoo! your homepage.
http://www.yahoo.com/r/hs

Hello everybody,

I am working with airborne laser scanner data and I need to import more than
2000 raster-datasets into my GRASSDatabase. I started to import the data with
r.in.gdal (it works perfect) but if I do everything myself, I will still be
importing the data still in a week or so.

Who can tell me how to write or who has a script for batch processing (importing
the data with the r.in.gdal-command?

I'd be thankful for any help.

Thanks in advance
Chris

--------------------------------
University of Innsbruck
Institute of Geography
Climate and Cryospheric Research
Innrain 52f; A - 6020 Innsbruck
AUSTRIA

KNOLL Christoph, Mag.

Dorfstrasse 106a/3
6240 Radfeld/Tirol
AUSTRIA

Office: +43 (0)512 507 5416
Mobile: +43 (0)650 6013230

Christoph Knoll pisze:

Hello everybody,

I am working with airborne laser scanner data and I need to import more than
2000 raster-datasets into my GRASSDatabase. I started to import the data with
r.in.gdal (it works perfect) but if I do everything myself, I will still be
importing the data still in a week or so.

Who can tell me how to write or who has a script for batch processing (importing
the data with the r.in.gdal-command?

I'd be thankful for any help.

Thanks in advance
Chris

--------------------------------
University of Innsbruck
Institute of Geography
Climate and Cryospheric Research
Innrain 52f; A - 6020 Innsbruck
AUSTRIA

KNOLL Christoph, Mag.

Dorfstrasse 106a/3
6240 Radfeld/Tirol
AUSTRIA

Office: +43 (0)512 507 5416
Mobile: +43 (0)650 6013230

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser
  

something like this:
divide rasters into some directories (2000 may be to much for it) and:
------
#!bin/bash
list_of_raster= ls

for i in $list_of_raster
do
eval `r.in.gdal input=~/your_dir/$i output=so_$i `
done
------
r.in gdal may require some addational parameters

end script may not work propertly, (i not tested it I use very similar to import multiple files)

Jarek

On Tuesday 13 November 2007 08:52:28 Jarosław Jasiewicz wrote:

Christoph Knoll pisze:
> Hello everybody,
>
> I am working with airborne laser scanner data and I need to import more
> than 2000 raster-datasets into my GRASSDatabase. I started to import the
> data with r.in.gdal (it works perfect) but if I do everything myself, I
> will still be importing the data still in a week or so.
>
> Who can tell me how to write or who has a script for batch processing
> (importing the data with the r.in.gdal-command?
>
> I'd be thankful for any help.
>
> Thanks in advance
> Chris
>
>
> --------------------------------
> University of Innsbruck
> Institute of Geography
> Climate and Cryospheric Research
> Innrain 52f; A - 6020 Innsbruck
> AUSTRIA
>
> KNOLL Christoph, Mag.
>
> Dorfstrasse 106a/3
> 6240 Radfeld/Tirol
> AUSTRIA
>
> Office: +43 (0)512 507 5416
> Mobile: +43 (0)650 6013230
>
> _______________________________________________
> grassuser mailing list
> grassuser@grass.itc.it
> http://grass.itc.it/mailman/listinfo/grassuser

something like this:
divide rasters into some directories (2000 may be to much for it) and:
------
#!bin/bash
list_of_raster= ls

for i in $list_of_raster
do
eval `r.in.gdal input=~/your_dir/$i output=so_$i `
done
------
r.in gdal may require some addational parameters

end script may not work propertly, (i not tested it I use very similar
to import multiple files)

Jarek

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

I use a similar script to import shapefiles via v.in.ogr

#!/bin/bash
cd /maps/luxembourg/vector/act/
for i in *_RIVIERE.shp; do
fn=cn_`basename "$i" .shp`; # remove the .shp from filename
v.in.ogr -o dsn=/maps/luxembourg/vector/act/"$i" output="$fn"
# do echo $i "$suffix$i";
done;
cd

Frank

did you start NVIZ from the command line or from the menu?
after checking the region bounds/resolution with 'g.region -p' make a raster
surface to put it on.
  r.mapcalc zero=0
from the command line start NVIZ with
  nviz -q
then load the raster surface and the 3D vector manually.
You may want to set the raster to be transparent.

+++++++++
Thank for your help,
But it is not working, instead the NVIZ is 'halted'. I wonder is it
because I use Leopard?
Because other vector command like v.digit -n map=newmap bgcmd="d.rast
map=rastermap" for vector tracing also could not start.
I try in IMac using Tiger, the v.digit is working fine.
Any enlightenment? I gladly appreciate.....

Christoph Knoll wrote:

Hello everybody,

I am working with airborne laser scanner data and I need to import more than
2000 raster-datasets into my GRASSDatabase. I started to import the data with
r.in.gdal (it works perfect) but if I do everything myself, I will still be
importing the data still in a week or so.

Who can tell me how to write or who has a script for batch processing (importing
the data with the r.in.gdal-command?

Christoph,

A one-liner:

for i in *.tif; do r.in.gdal in="$i" out=`basename "$i"
.tif`; done

Adjust the wildcard to match your input raster's extension
and supply more options for r.in.gdal if needed, according
to manual.

Maciek

I've forgotten something that is very necessary! The raster-data are ESRI-Grids
and no tifs,...!!!

cheers
Chris

Hello everybody,

I am working with airborne laser scanner data and I need to import more than
2000 raster-datasets into my GRASSDatabase. I started to import the data with
r.in.gdal (it works perfect) but if I do everything myself, I will still be
importing the data still in a week or so.

Who can tell me how to write or who has a script for batch processing
(importing the data with the r.in.gdal-command?

Christoph,

Zitat von Maciej Sieczka <tutey@o2.pl>:

Christoph Knoll wrote:

A one-liner:

for i in *.tif; do r.in.gdal in="$i" out=`basename "$i"
.tif`; done

Adjust the wildcard to match your input raster's extension
and supply more options for r.in.gdal if needed, according
to manual.

Maciek

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

--------------------------------
University of Innsbruck
Institute of Geography
Climate and Cryospheric Research
Innrain 52f; A - 6020 Innsbruck
AUSTRIA

KNOLL Christoph, Mag.

Dorfstrasse 106a/3
6240 Radfeld/Tirol
AUSTRIA

Office: +43 (0)512 507 5416
Mobile: +43 (0)650 6013230

Did you build from source or are you using one of the binaries?

I have verified that my binaries run on Leopard, except that I didn't check NVIZ. There may be compatibility issues with OpenGL on the new X11 - Apple did some cool and weird stuff with Leopard's X11.

When I built on Leopard, I got NVIZ to run, though there were some initial redraw glitches so there may yet be OpenGL issues on Leopard.

It may be as simple as the X11 display setting. One of the cool new X11 things is that you don't need to start X11 yourself - it starts when needed. In fact, you shouldn't start X11 yourself, and you should not have it in your Dock, or you will get multiple copies in your Dock.

For displays to work, you must NOT set the $DISPLAY variable in your shell. Make sure you remove it from any shell startup scripts (ie .bash_profile and .bashrc). It may also be in ~/.MacOSX/environment.plist from other software installs.

When I get things running smoothly on Leopard, I'll find a place to add this info in the GRASS wiki, as well as the OSX readme for the binary install.

On Nov 13, 2007, at 3:47 AM, aswin indraprastha wrote:

did you start NVIZ from the command line or from the menu?
after checking the region bounds/resolution with 'g.region -p' make a raster
surface to put it on.
r.mapcalc zero=0
from the command line start NVIZ with
nviz -q
then load the raster surface and the 3D vector manually.
You may want to set the raster to be transparent.

+++++++++
Thank for your help,
But it is not working, instead the NVIZ is 'halted'. I wonder is it
because I use Leopard?
Because other vector command like v.digit -n map=newmap bgcmd="d.rast
map=rastermap" for vector tracing also could not start.
I try in IMac using Tiger, the v.digit is working fine.
Any enlightenment? I gladly appreciate.....

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Those people who most want to rule people are, ipso-facto, those least suited to do it."

- A rule of the universe, from the HitchHiker's Guide to the Galaxy

Christoph Knoll wrote:

I've forgotten something that is very necessary! The raster-data are ESRI-Grids
and no tifs,...!!!

It shouldn't change much - adjust the wildcard to match you
raster's extension. r.in.gdal should handle ESRI ASCII and
binary grids (refer to the list of formats supported by GDAL
on GDAL's website for details).

Maciek

You need to look in config.log for the reason this failed. OSX (all versions) uses ncurses, but curses is symlinked to that also, so one of them at least should be found. Works for me.

Since you are building from source, I expect you will have a linking problem during compilation with libGL.

Also, which Mac processor - PPC or Intel?

On Nov 13, 2007, at 9:08 PM, aswin indraprastha wrote:

On Nov 13, 2007 11:53 PM, William Kyngesburye <woklist@kyngchaos.com> wrote:

Did you build from source or are you using one of the binaries?

+++++++++++
Dear Sir,

I am now trying to reinstall 6.3.0RC1 from source. Thank you for your
well documentation on this.
And this is snippet of ./configure :

checking for curses.h... yes
checking curses.h WINDOW structure component... _maxy
checking for initscr in -lncurses... no
checking for initscr in -lcurses... no
configure: error: *** Unable to locate curses library.

It is strange since I try in different mac using Tiger, the
configuration run well.
Is the curses library must be pre-installed on Leopard? If it is not
found, do I have to change the path on .bashrc or something?
I am sorry for this newbie question, I am barely know Unix environment.
Thank you for your kind attention,

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"I ache, therefore I am. Or in my case - I am, therefore I ache."

- Marvin

On Nov 13, 2007, at 10:41 PM, aswin indraprastha wrote:

On Nov 14, 2007 1:24 PM, aswin indraprastha <aswinindra@gmail.com> wrote:

Since you are building from source, I expect you will have a linking
problem during compilation with libGL.
Also, which Mac processor - PPC or Intel?

++++++++++++++++
Dear Sir,

If you don't mind, here is the error report from config.log :

1)
error: Not a directory - unable to create 'conftest.dSYM/Contents'
bundle directory.
#include "confdefs.h"
2)
configure:3882:20: error: termio.h: No such file or directory
#include <termio.h>
3)
configure:3882:20: error: values.h: No such file or directory
#include <values.h>
4)
configure:3882:17: error: f2c.h: No such file or directory
#include <f2c.h>
5)
configure:3882:17: error: g2c.h: No such file or directory
#include <g2c.h>

It seem that /configuration did not find the library location. I had
installed all of the framework prior configuring Grass. Also I tried
to configure with all libraries (as you mentioned in the MacOS
package).
Is it something with the .bashrc? or setting up the PATH?

Many thank for your help

Those include test errors have nothing to do with ncurses, and are normal on OSX. Try searching for "curses" in the log to find the error for that.

PS. Please also CC the GRASS user list so that others can benefit from this, and maybe others have more insight to the problem.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Time is an illusion - lunchtime doubly so."

- Ford Prefect

Dear Sir,

Since I had trouble configuring grass 6.3.0RC1 in curses library,
This is the log regards to curses :

configure:5401: checking whether to use Curses
configure:5420: checking for curses.h
configure:5428: gcc -E conftest.c >/dev/null 2>conftest.out
configure:5459: checking curses.h WINDOW structure component
configure:5471: gcc -c -g -O2 conftest.c 1>&5
configure: In function 'main':
configure:5467: error: 'WINDOW' has no member named 'maxy'
configure: failed program was:
#line 5462 "configure"
#include "confdefs.h"
#include <curses.h>
int main() {
WINDOW w; w.maxy = 0;
; return 0; }
configure:5489: gcc -c -g -O2 conftest.c 1>&5
configure:5505: checking for initscr in -lncurses
configure:5522: gcc -o conftest.dSYM -g -O2 conftest.c -lncurses 1>&5
error: Not a directory - unable to create 'conftest.dSYM/Contents'
bundle directory.
configure: failed program was:
#line 5511 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply. */
char initscr();
int main() {
initscr()
; return 0; }
configure:5541: checking for initscr in -lcurses
configure:5558: gcc -o conftest.dSYM -g -O2 conftest.c -lcurses 1>&5
error: Not a directory - unable to create 'conftest.dSYM/Contents'
bundle directory.
configure: failed program was:
#line 5547 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply. */
char initscr();
int main() {
initscr()
; return 0; }

I appreciate and many thank for your help

On Nov 13, 2007, at 11:29 PM, aswin indraprastha wrote:

Dear Sir,

Since I had trouble configuring grass 6.3.0RC1 in curses library,
This is the log regards to curses :

configure:5401: checking whether to use Curses
configure:5420: checking for curses.h
configure:5428: gcc -E conftest.c >/dev/null 2>conftest.out
configure:5459: checking curses.h WINDOW structure component
configure:5471: gcc -c -g -O2 conftest.c 1>&5
configure: In function 'main':
configure:5467: error: 'WINDOW' has no member named 'maxy'
configure: failed program was:
#line 5462 "configure"
#include "confdefs.h"
#include <curses.h>
int main() {
WINDOW w; w.maxy = 0;
; return 0; }

This appears to be normal for OSX - happens for me also. Probably harmless.

configure:5489: gcc -c -g -O2 conftest.c 1>&5
configure:5505: checking for initscr in -lncurses
configure:5522: gcc -o conftest.dSYM -g -O2 conftest.c -lncurses 1>&5
error: Not a directory - unable to create 'conftest.dSYM/Contents'
bundle directory.
configure: failed program was:
#line 5511 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply. */
char initscr();
int main() {
initscr()
; return 0; }

Something is very wrong here. "conftest.dSYM" is wrong (it should be "conftest.c" like all the other tests), and I'm afraid that I have no idea where that is coming from. If you are re-configuring after the previous unsuccessful build, try "make distclean" and then running configure - there may be junk left over from before.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

Theory of the Universe

There is a theory which states that if ever anyone discovers exactly what the universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarrely inexplicable. There is another theory which states that this has already happened.

-Hitchhiker's Guide to the Galaxy 2nd season intro

Something is very wrong here. "conftest.dSYM" is wrong (it should be
"conftest.c" like all the other tests), and I'm afraid that I have no
idea where that is coming from. If you are re-configuring after the
previous unsuccessful build, try "make distclean" and then running
configure - there may be junk left over from before.

======================
Actually, the previous was built on .pkg (6.3.0), everything except
NVIZ and v.digit command seems OK.
for v.digit -n map=new bgcmd="d.rast map=raster"
I got the message :

New empty map created.
The process has forked and you cannot use this CoreFoundation
functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__()
to debug.
The process has forked and you cannot use this CoreFoundation
functionality safely. You MUST exec().
PNG: GRASS_TRUECOLOR status: TRUE
PNG: collecting to file:
/Users/aswin/grassdata/42649.0.ppm,
GRASS_WIDTH=345, GRASS_HEIGHT=482
100%

So mouse functionality is not working, so I cannot do the vector trace
over raster image.
This is way I want to reconfigure GrassGIS from scratch (and had curse
error). I already clean all grass-related files (I think)
But still, curse library not found.
Is it normal to have couple command that is not working well but the
others work? Although I install it from binary?

Thank you and very grateful for your attention

I just tried the version I have available for download (I had a couple newer builds on my Mac, so my tests may not have been correct). NVIZ and v.digit both run fine on Leopard.

Given the weird configure error you had, and this other weird "forking" error, there is very likely something wrong in your system configuration. I wonder, do you have Fink or MacPorts installed? Sometimes utilities installed in their "worlds" will get used instead of system versions, and their behaviour could be different than expected.

On Nov 14, 2007, at 1:02 AM, aswin indraprastha wrote:

Something is very wrong here. "conftest.dSYM" is wrong (it should be
"conftest.c" like all the other tests), and I'm afraid that I have no
idea where that is coming from. If you are re-configuring after the
previous unsuccessful build, try "make distclean" and then running
configure - there may be junk left over from before.

======================
Actually, the previous was built on .pkg (6.3.0), everything except
NVIZ and v.digit command seems OK.
for v.digit -n map=new bgcmd="d.rast map=raster"
I got the message :

New empty map created.
The process has forked and you cannot use this CoreFoundation
functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__()
to debug.
The process has forked and you cannot use this CoreFoundation
functionality safely. You MUST exec().
PNG: GRASS_TRUECOLOR status: TRUE
PNG: collecting to file:
/Users/aswin/grassdata/42649.0.ppm,
GRASS_WIDTH=345, GRASS_HEIGHT=482
100%

So mouse functionality is not working, so I cannot do the vector trace
over raster image.
This is way I want to reconfigure GrassGIS from scratch (and had curse
error). I already clean all grass-related files (I think)
But still, curse library not found.
Is it normal to have couple command that is not working well but the
others work? Although I install it from binary?

Thank you and very grateful for your attention

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

Theory of the Universe

There is a theory which states that if ever anyone discovers exactly what the universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarrely inexplicable. There is another theory which states that this has already happened.

-Hitchhiker's Guide to the Galaxy 2nd season intro

It also works for me with no problems using William's frameworks and grass binary from cvs on OS X 10.5.

John Tull

On Nov 14, 2007, at 8:50 AM, William Kyngesburye wrote:

I just tried the version I have available for download (I had a couple newer builds on my Mac, so my tests may not have been correct). NVIZ and v.digit both run fine on Leopard.

Given the weird configure error you had, and this other weird "forking" error, there is very likely something wrong in your system configuration. I wonder, do you have Fink or MacPorts installed? Sometimes utilities installed in their "worlds" will get used instead of system versions, and their behaviour could be different than expected.

On Nov 14, 2007, at 1:02 AM, aswin indraprastha wrote:

Something is very wrong here. "conftest.dSYM" is wrong (it should be
"conftest.c" like all the other tests), and I'm afraid that I have no
idea where that is coming from. If you are re-configuring after the
previous unsuccessful build, try "make distclean" and then running
configure - there may be junk left over from before.

======================
Actually, the previous was built on .pkg (6.3.0), everything except
NVIZ and v.digit command seems OK.
for v.digit -n map=new bgcmd="d.rast map=raster"
I got the message :

New empty map created.
The process has forked and you cannot use this CoreFoundation
functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__()
to debug.
The process has forked and you cannot use this CoreFoundation
functionality safely. You MUST exec().
PNG: GRASS_TRUECOLOR status: TRUE
PNG: collecting to file:
/Users/aswin/grassdata/42649.0.ppm,
GRASS_WIDTH=345, GRASS_HEIGHT=482
100%

So mouse functionality is not working, so I cannot do the vector trace
over raster image.
This is way I want to reconfigure GrassGIS from scratch (and had curse
error). I already clean all grass-related files (I think)
But still, curse library not found.
Is it normal to have couple command that is not working well but the
others work? Although I install it from binary?

Thank you and very grateful for your attention

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

Theory of the Universe

There is a theory which states that if ever anyone discovers exactly what the universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarrely inexplicable. There is another theory which states that this has already happened.

-Hitchhiker's Guide to the Galaxy 2nd season intro

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser