[GRASS-user] 360 degree view from a given point

Just browsing through the web I found the following new product
http://www.viewranger.com/vrproductinfo.php, which is a mobile phone map (nothing new here), but it also offers
‘Unique 3D Panoramic Viewpoint Maps show you what you see!’, which is basically an annotated 360degree view of the surroundings of a given point, where the current location is transmitted from a GPS to the phone.
(I have no affiliation with this product whatsoever, and I have never tried it: I would wonder how they would know which direction a user is facing at a given moment, the GPS will not give it - for most parts of England it is also easy to implement: just return a flat horizon :wink: I did think however, it is quite an inspired application)

I have a webmap (www.yunnanexplorer.com/map), that I would like to enhance with the option of clicking a point and then getting a full 360 degree view from this point and surface elevation, a bit like 360 degree cameras to display with the map.

I have seen the recent GRASS integration with a python CGI script, so that would be a starting point to generate the image from a client webbrowser.
I have played a bit with NVIZ in the past, but my question to the grass experts is: what would be the best way to do this in GRASS?

Ludwig

Hi,

how to force nviz to work in batchprocess even without Xserver to be started?

another answare could be: porting the old d.3d to 6.x

jachym

On Sun, Jul 02, 2006 at 01:43:30PM +0100, Ludwig Max Brinckmann wrote:

Just browsing through the web I found the following new product
http://www.viewranger.com/vrproductinfo.php, which is a mobile phone map
(nothing new here), but it also offers
'Unique 3D Panoramic Viewpoint Maps show you what you see!', which is
basically an annotated 360degree view of the surroundings of a given
point, where the current location is transmitted from a GPS to the phone.
(I have no affiliation with this product whatsoever, and I have never tried
it: I would wonder how they would know which direction a user is facing at a
given moment, the GPS will not give it - for most parts of England it is
also easy to implement: just return a flat horizon :wink: I did think however,
it is quite an inspired application)

I have a webmap (www.yunnanexplorer.com/map), that I would like to enhance
with the option of clicking a point and then getting a full 360 degree view
from this point and surface elevation, a bit like 360 degree cameras to
display with the map.

I have seen the recent GRASS integration with a python CGI script, so that
would be a starting point to generate the image from a client webbrowser.
I have played a bit with NVIZ in the past, but my question to the grass
experts is: what would be the best way to do this in GRASS?

Ludwig

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

--
Jachym Cepicky
e-mail: jachym.cepicky@centrum.cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/jachym_cepicky-gpg_public_key.asc
-----------------------------------------
OFFICE:
GDF-Hannover
Mengendamm 16d
30177 Hannover
Germany
e-mail: cepicky@gdf-hannover.de
URL: http://gdf-hannover.de
Tel.: +49 511-39088507

Just had a quick look through the old manual pages, so I guess it might do the trick.
Does anybody have an idea how much porting effort is involved? What is the reason it is not maintained?

On 7/2/06, Jachym Cepicky <jachym.cepicky@centrum.cz> wrote:

Hi,

how to force nviz to work in batchprocess even without Xserver to be started?

another answare could be: porting the old d.3d to 6.x

jachym

On Sun, Jul 02, 2006 at 01:43:30PM +0100, Ludwig Max Brinckmann wrote:

Just browsing through the web I found the following new product
http://www.viewranger.com/vrproductinfo.php, which is a mobile phone map
(nothing new here), but it also offers
‘Unique 3D Panoramic Viewpoint Maps show you what you see!’, which is
basically an annotated 360degree view of the surroundings of a given
point, where the current location is transmitted from a GPS to the phone.
(I have no affiliation with this product whatsoever, and I have never tried
it: I would wonder how they would know which direction a user is facing at a
given moment, the GPS will not give it - for most parts of England it is
also easy to implement: just return a flat horizon :wink: I did think however,
it is quite an inspired application)

I have a webmap (www.yunnanexplorer.com/map), that I would like to enhance
with the option of clicking a point and then getting a full 360 degree view
from this point and surface elevation, a bit like 360 degree cameras to
display with the map.

I have seen the recent GRASS integration with a python CGI script, so that
would be a starting point to generate the image from a client webbrowser.
I have played a bit with NVIZ in the past, but my question to the grass
experts is: what would be the best way to do this in GRASS?

Ludwig


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


Jachym Cepicky
e-mail: jachym.cepicky@centrum.cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/jachym_cepicky-gpg_public_key.asc

OFFICE:
GDF-Hannover
Mengendamm 16d
30177 Hannover
Germany
e-mail: cepicky@gdf-hannover.de
URL: http://gdf-hannover.de
Tel.: +49 511-39088507

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEp+GVyKt0uAjU4I8RAsTXAKCNYa1EVw6xIufqwF37wnebOlY3bQCg2huc
90b8S4nywEZCGY5MOQdzsQI=
=pLZu
-----END PGP SIGNATURE-----

Hello Ludwig

On Sun, 2 Jul 2006, Ludwig Max Brinckmann wrote:

Just had a quick look through the old manual pages, so I guess it might do
the trick.
Does anybody have an idea how much porting effort is involved? What is the
reason it is not maintained?

As far I remember the two different versions (cmd and inter - command-line
and interactive) had slightly different functionality but the code was all mixed up together (i.e. not in separate cmd and inter directories as in other pre-GRASS 6 modules) and some was shared and some separate. It would be a lot of work to merge it all cleanly into one definitive set of functionality.
Might not be quite as much work work to get *most* of the functionality ported.

Bob Covill has added support to NVIZ for setting an explicit viewer location and centre of view, and for saving this as a 3d.view file in the GRASS database - I think this works now but I have never tested it. Before this was added, and if you didn't have access to a Silicon Graphics machine to run SG3d on, d.3d was the only choice if you wanted fine control (by typing in co-ordinates and angles etc; not using the mouse) over the 3-D view parameters.

FWIW SG3d was quite amazing and years ahead of its time; still has some features that (as far as I'm aware) aren't in NVIZ such as projecting a global Lat-long location onto a sphere.

Paul

I had a quick play with this and with a bit of fiddling with the nviz controls I at least managed to get a view of something that could be my 360 degree view.
Than I saved this as a 3d.view file, which looks like this:

4.01

PGM_ID: Nvision-ALPHA!
north: 22.200000
south: 22.100000
east: 105.100000
west: 105.000000
rows: 120
cols: 120
TO_EASTING: 105.041183
TO_NORTHING: 22.117983
TO_HEIGHT: 66.926193
FROM_EASTING: 105.220001
FROM_NORTHING: 21.980000
FROM_HEIGHT: 2024.140015
Z_EXAG: 0.000010
TWIST: 0.000000
FIELD_VIEW: 359.000000
MESH_FREQ: 1
POLY_RES: 1
DOAVG: 0
DISPLAY_TYPE: 2
DOZERO: 1
COLORGRID: 0
SHADING: 1
FRINGE: 0
BG_COL: black
GRID_COL: white
OTHER_COL: red
SURFACEONLY: 0
LIGHTS_ON: 1
LIGHTPOS: 0.296000 -0.344000 0.580000 0.000000
LIGHTCOL: 0.320000 0.592000 0.616000
LIGHTAMBIENT: 0.000000
SHINE: 32.000000

My idea was to take this file as a template and insert my on-the-fly parameters and run nivz like this

nviz elevation=DEM state=statefile

to get the image I want. But as the first thing is that Grass does not like the file it has saved, and throws out lots of error messages, like this

Diagnostic: invalid command name “Nviz_# 4.01_load” – Load procedure for panel # 4.01 may not be defined
Diagnostic: invalid command name “Nviz_PGM_ID: Nvision-ALPHA!_load” – Load procedure for panel PGM_ID: Nvision-ALPHA! may not be defined
Diagnostic: invalid command name “Nviz_north: 22.200000_load” – Load procedure for panel north: 22.200000 may not be defined
Diagnostic: invalid command name “Nviz_south: 22.100000_load” – Load procedure for panel south: 22.100000 may not be defined
Diagnostic: invalid command name “Nviz_east: 105.100000_load” – Load procedure for panel east: 105.100000 may not be defined
Diagnostic: invalid command name “Nviz_west: 105.000000_load” – Load procedure for panel west: 105.000000 may not be defined
Diagnostic: invalid command name “Nviz_rows: 120_load” – Load procedure for panel rows: 120 may not be defined
… (more one for every line)

So NVIZ does not really understand its own file format, yet loading the file from the GUI does not throw out all these error messages, but does not exactly recreate my view either.

Plus: is there a way to make nviz save the view from as an image from the command line? The tiff file I can output via the GUI would be good enough with some post-processing with one of the many image programs…

I have just tested this on XP, with Grass version grass-6.1.cvs-i686-pc-cygwin-13_02_2006, so if anybody thinks this is a version or platform issue, give me a shout.

Ludwig

On 7/2/06, Paul Kelly <paul-grass@stjohnspoint.co.uk > wrote:

Hello Ludwig

On Sun, 2 Jul 2006, Ludwig Max Brinckmann wrote:

Just had a quick look through the old manual pages, so I guess it might do
the trick.
Does anybody have an idea how much porting effort is involved? What is the
reason it is not maintained?

As far I remember the two different versions (cmd and inter - command-line
and interactive) had slightly different functionality but the code was all
mixed up together (i.e. not in separate cmd and inter directories as in other
pre-GRASS 6 modules) and some was shared and some separate. It would be a
lot of work to merge it all cleanly into one definitive set of functionality.
Might not be quite as much work work to get most of the functionality ported.

Bob Covill has added support to NVIZ for setting an explicit viewer
location and centre of view, and for saving this as a 3d.view file in the
GRASS database - I think this works now but I have never tested it.
Before this was added, and if you didn’t have access to a Silicon Graphics
machine to run SG3d on, d.3d was the only choice if you wanted fine
control (by typing in co-ordinates and angles etc; not using the mouse)
over the 3-D view parameters.

FWIW SG3d was quite amazing and years ahead of its time; still has some
features that (as far as I’m aware) aren’t in NVIZ such as projecting a
global Lat-long location onto a sphere.

Paul

Jachym Cepicky wrote:

how to force nviz to work in batchprocess even without Xserver to be
started?

I don't guarantee that it will work without an X server, but NVIZ will
work in batch mode. e.g. d.nviz outputs a NVIZ script, you start it with
"nviz script=...".

d.3d

just start up GRASS 5.4 and try it out before you decide to undertake
the work to port it to GRASS 6. I think it is a much simpler solution
than NVIZ.

Hamish

Ludwig Max Brinckmann wrote:

I had a quick play with this and with a bit of fiddling with the nviz
controls I at least managed to get a view of something that could be
my 360 degree view.
Than I saved this as a 3d.view file, which looks like this:

# 4.01
PGM_ID: Nvision-ALPHA!
north: 22.200000
south: 22.100000

..

My idea was to take this file as a template and insert my on-the-fly
parameters and run nivz like this

nviz elevation=DEM state=statefile

State is not the same as 3D.view!

State remembers shading, line widths, etc.
see File->Load/Save State which is different than File->Load/Save 3D view.

Plus: is there a way to make nviz save the view from as an image from
the command line? The tiff file I can output via the GUI would be good
enough with some post-processing with one of the many image
programs...

I imagine you can do this using "nviz script=", but beyond that I can't
be much more help. See d.nviz code and the nvis Scripting menu for
hints.

Hamish

Jachym Cepicky wrote:

how to force nviz to work in batchprocess even without Xserver to be started?

For a start, you would need an OpenGL implementation which doesn't
require an X server, i.e. Mesa with the OSMesa library.

Apart from that, you might be better off just using the OGSF library
directly. Most of NVIZ is the UI; the OGSF library does all of the
actual rendering.

--
Glynn Clements <glynn@gclements.plus.com>

Hamish wrote:

> how to force nviz to work in batchprocess even without Xserver to be
> started?

I don't guarantee that it will work without an X server, but NVIZ will
work in batch mode. e.g. d.nviz outputs a NVIZ script, you start it with
"nviz script=...".

It won't work without an X server; however, it should work with Xvfb.

--
Glynn Clements <glynn@gclements.plus.com>

Apart from that, you might be better off just using the OGSF library
directly. Most of NVIZ is the UI; the OGSF library does all of the
actual rendering.

I found only http://mpa.itc.it/markus/grass61progman/ogsflib.html. Is there any more documentation or examples on how to use this library (I guess the NVIZ code)?

Ludwig

Ludwig Max Brinckmann wrote:

> Apart from that, you might be better off just using the OGSF library
> directly. Most of NVIZ is the UI; the OGSF library does all of the
> actual rendering.

I found only http://mpa.itc.it/markus/grass61progman/ogsflib.html. Is there
any more documentation or examples on how to use this library (I guess the
NVIZ code)?

I'm not aware of any other documentation, or of any examples except
for NVIZ.

--
Glynn Clements <glynn@gclements.plus.com>