QGis Globe Plugin installer script

Lately, thanks to ma Master Thesis, I’ve been co-working on the Globe Plugin for QGis
here my install script for a threaded version of QGis with the Globe Plugin. By now the Globe has stereo 3D support, keyboard navigation (try all the num key), mouse navigation, a gui to control the globe and datasets can be inported configuring the .earth file. Today I’ll start implementing a dialog to add data without the need of the .earth file.
cheers Marco
UPDATE: the script is now updated to use the new mutex trunk branch and tested on ubuntu natty
UPDATE2: The script now uses the trunk repository of QGIS so it is actually not that usefull anymore since getting globe is just matter of compiling QGIS from source. I’ll leave it here for reference and “historic glory” ๐Ÿ˜‰
UPDATE3: Globe runs on WIN http://www.opengis.ch/2011/08/02/qgis-globe-runs-on-win/
#!/bin/sh
#
set -e
#############################
#######CONFIGURE HERE########
#############################
ROOT_DIR=~/globe
SRC_DIR_NAME=qgis
SRC_DIR=$ROOT_DIR/$SRC_DIR_NAME
BUILD_DIR=$SRC_DIR/build
INSTALL_DIR=~/apps
GRASS_PREFIX=/usr/lib/grass64/lib
#
REPO='git://github.com/qgis/Quantum-GIS.git'
DEV_REPO='git@github.com:YOURREPO/Quantum-GIS.git'
#
#############################
#######END CONFIGURE#########
#############################
#
echo "Downloading src to: " $SRC_DIR
echo "Building src to: " $BUILD_DIR
echo "Installing to: " $INSTALL_DIR
#
CONTINUE=n
echo "OK? [y, n*]:"
read CONTINUE
CONTINUE=$(echo $CONTINUE | tr "[:lower:]" "[:upper:]")
if [ "$CONTINUE" = "Y" ]; then
continue
else
echo "Abort"
exit
fi
#
#add qgis repo needed to satisfy all dependences, we only compile qgis
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable/
sudo apt-get update
sudo apt-get build-dep qgis
sudo apt-get install cmake-curses-gui cmake-qt-gui gdal-bin libgdal1-1.8.0-grass txt2tags python-gdal git osgearth osgearth-dev openscenegraph
#
#get the source
mkdir -p $ROOT_DIR
cd $ROOT_DIR
#
DEV=n
echo "Do you have write acces to the repo (have SSH key to it)? [y, n*]:"
read DEV
DEV=$(echo $DEV | tr "[:lower:]" "[:upper:]")
if [ "$DEV" = "Y" ]; then
echo "cloning $DEV_REPO"
git clone $DEV_REPO $SRC_DIR_NAME
else
echo "cloning $REPO"
git clone $REPO $SRC_DIR_NAME
fi
#
cd $SRC_DIR
git checkout master
#
mkdir -p $INSTALL_DIR
mkdir -p $BUILD_DIR
cd $BUILD_DIR
ccmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DGRASS_PREFIX=$GRASS_PREFIX -DCMAKE_BUILD_TYPE=Release -DWITH_GLOBE=ON ..
#
#detect cpu cores
CORES=$(cat /proc/cpuinfo | grep processor | wc -l)
make -j$CORES install
#
#run qgis
#In some case you might need this 2 lines:
#see https://code.google.com/p/modwsgi/wiki/InstallationIssues for details
#LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libutil.so #use locate libutil to find the path
#export LD_PRELOAD
$INSTALL_DIR/bin/qgis

40 Responses

  1. Rems

    How to install sourcepole-qgis-2b685a2.zip on QGIS 1.6 Ubuntu 10.04 and how to use Marco Bernasocchi script above?
    Thank you in advance.

  2. Rems

    But, how configure the first lines script’s?
    And where past the Marco’s executable globe.sh?
    Do you have a video tutorial, please Marco?

  3. Rems

    I run the scrit with the terminal for:
    Downloading src to: /home/username/globe/qgis
    Building src to: /home/username/globe/qgis/build
    Installing to: /home/username/apps
    OK? [y, n*]:
    I validate, but nothing in QGIS 1.6 extensions.
    How to install plugin Globe in Quantum Gis and Q-Rap?

  4. Rems

    configured? I just registered. sh and I started with the terminal, then y. then a partial installation.

  5. Rems

    I use gedit I copy and paste your script then I record “globe.sh ‘in
    / home / rem lines of script are colored then I check in permissions allow executing the file as a program.
    I run it in terminal I validate y. it runs ok and then partially closes the terminal.
    Sorry I’m not ready and I like the free movement.

  6. Harald

    Hi,
    first of sll: thanks a lot for this script.
    Are there any experiences in installing this for QGIS 1.6 on OS X? I tried this, but the script stopped with the error messages:
    — start —
    sudo: add-apt-repository: command not found
    MacBook-Pro:globe meinmacbookpro$ sudo apt-get update
    Password:
    sudo: apt-get: command not found
    MacBook-Pro:globe meinmacbookpro$
    — end —
    I found that these commands would be available for OS X it I install fink. I did this, everything with fink seems to be okay. But tose error messages still occur… :-((
    Any hint would be very appreciated. Thanks a lot for this.
    Harald
    sudo: add-apt-repository

  7. Harald

    Hi Marco,
    thanks a lot for your information. I will have a look on those links and will try my best…
    Ciao Harald

  8. Fred

    Hi, Marco, I was expecting for Globe, thank you VERY MUCH for your script qgis_globe_install.sh, but I’ve a problem when trying to install globe with your script!!!!!!!!!
    Help, I’m stupid Always the same error with 4 computers 32b, 64b, Natty, Maverick, in local, in root…
    The build stops at 46/47% :
    “Linking CXX shared library libqgis_gui.so [ 46%] Built target qgis_gui
    make: *** [all] Erreur 2”
    Regards

  9. murari

    sir,
    i am using QGIS 1.7.0,in windows environment please guide me how to use this QGis Globe Plugin, i am not so much aware of q gis, as i can see this will be useful for my project for studying far reached villages in NE indian mountains.
    i case you have something directly loadable plugin ple send it on mail
    murari

  10. murari

    sir,
    i have a SRTM DEM file i am finding difficulty to load 3d dem on the globe. please help (urgent)
    thanks

  11. Riccardo

    Cannot install. It seems that osgearth-dev has stopped to the rel 2.0-3natty1 and the next release has been renamed to libosgearth-dev
    Non so come uscirne… ๐Ÿ˜

  12. Riccardo

    osgearth-dev should be installed, by the way… whichever way you install the plugin, and it cannot be installed ๐Ÿ˜ since it does not exist anymore on the repos…

Leave a Reply