martedì 15 dicembre 2015

Guida all'uso di OSGeo-Live in macchina virtuale per utenti windows

OSGeo-Live e` un progetto basato su Lubuntu, che comprende un DVD, unita` USB o immagine disco virtuale, che permette di provare una grande varietà di software libero senza la necessita` di installarlo. Il progetto e` interamente basato su software libero, che permette di duplicarlo e ridistribuirlo liberamente.

In questa breve guida vediamo come e` possibile  utilizzare l'immagine disco in una virtual machine installata su windows.

Una chiarificazione sulla terminologia. Definiamo "host" il sistema operativo che ospita l'altro Nel nostro caso l'host è windows. Definiamo invece "guest" il sistema operativo che viene ospitato. In questo caso il guest è ubuntu (64 bit).


Ottenere l'immagine disco di OSGeo-live

L'immagine disco della OSGeo-Live si trova a questo URL, scegliere l'ultimo link - download virtual machine. 




Secondo la velocità della vostra connessione, il download potrebbe durare alcune ore. Alla fine, decomprimere il file usando l'utility 7zip.


Ottenere e installare la virtual machine

Installeremo la Virtual Box di Oracle, che e` disponibile a questo URL. L'ultima versione è:
  • VirtualBox 5.0.10 for Windows hosts o ultima versione disponibile, e
  • VirtualBox 5.0.10 Oracle VM VirtualBox Extension Pack > All supported platforms
Quest'ultimo pacchetto permette di estendere le funzionalita` della macchina virtuale, ad esempio ingrandire lo schermo, condividere una cartella, ecc.




Attenzione: l'ultima versione della macchina virtuale potrebbe avere qualche problema di compatibilità con Windows 10. In questo caso, scaricate la versione 4.2 (e il pacchetto Extension Pack relativo alla stessa versione)

Per installare, fare doppio click e seguire le istruzioni dell'installer, prima per la virtual box e poi l'estensione. Lasciare le impostazioni di default.


Creazione della macchina virtuale

Avviare VirtualBox. Cliccare su "Nuova" per creare una nuova macchina virtuale.



Dare un nome alla macchina virtuale che stiamo creando, ad es. OSGeo-Live. Scegliamo tipo: Linux, versione: Ubuntu (64 bit).

Clicchiamo "Avanti". Siamo chiamati a decidere quanta memoria vogliamo destinare alla macchina virtuale, deve essere almeno 1024, di più se il vostro computer ha più di 4 GB di RAM. Questa scelta dipende dalle caratteristiche del nostro computer. Un buon compromesso è assegnare non più della metà della memoria disponibile.

Nella prossima finestra ci viene chiesto se abbiamo già un'immagine disco o vogliamo crearne una. Noi l'abbiamo (OSGeo-Live) dunque scegliamo la terza opzione, "Usa un file virtuale di disco fisso esistente". Cliccando sulla cartellina gialla, andiamo a selezionare l'immagine disco nel nostro computer.





Una volta selezionato il file, clicchiamo "Crea".





 Abbiamo creato la macchina virtuale, ma non abbiamo finito. Clicchiamo su "Impostazioni".





 Andiamo su "Generale" > "Avanzate". Impostiamo "bidirezionale" in entrambe le caselle. Questo ci permette di copiare e incollare e trascinare oggetti tra la macchina guest e la macchina host e viceversa.




Nella sezione "Schermo", andiamo ad impostare la memoria video assegnata alla macchina virtuale a 64 MB.



Ora dobbiamo creare un canale di comunicazione fra guest e host, in cui si possano condividere i dati in maniera bidirezionale. Senza tale cartella, tutti i dati creati nella macchina guest, rimarrebbero all'interno del file immagine della macchina virtuale e non potrebbero uscire da questo ambiente "isolato". 
Per fare questo, sulla macchina host (Windows) creiamo una cartella ad hoc, per esempio la chiamo "Cartella_Condivisa". 
Dalle impostazioni della macchina virtuale mi sposto sul tab "Cartelle condivise", e clicco sull'icona col + verde, che aggiunge una nuova cartella condivisa.


Da "Percorso della cartella" andiamo a cercare la Cartella_condivisa appena creata nell'host. 




Spuntiamo "Montaggio automatico".




Ora avviamo la macchina virtuale cliccando sul bottone avvia.




Risoluzione di possibili problemi

Se a questo punto si verifica un errore come:
VT-x is disabled in the BIOS for both all CPU modes (VERR_VMX_MSR_ALL_VMX_DISABLED).
bisogna accedere al bios, per molti computer all'accensione premere F2, quindi andare in Configuration --> Intel Virtual Technology: [Enabled].


Avvio

Se tutto è andato a buon fine, dovremmo avere la seguente schermata. Andiamo nel menu "Dispositivi" e clicchiamo l'ultima opzione "Installa guest addition".



Montare la cartella condivisa 

Nel guest, creiamo una cartella condivisa, e montiamo la cartella condivisa dell'host. Apriamo un terminale e scriviamo:

mkdir /home/user/cartella_condivisa 
sudo mount -t vboxsf Cartella_condivisa \
/home/user/cartella_condivisa

La password per user è user.  





giovedì 10 dicembre 2015

Docker quickstart

Docker is a powerful virtualization environment that permits to deploy your applications seamlessly respect to the "container", e.g. it is agnostic to the operating system, version, libraries installed and so on.

Here is a quickstart. Not all the steps are necessary, e.g. using the Docker Hub, and by the way, docker offers much more options for different user's  needs. For different use cases, refer to the documentation on Docker web site directly.

1 Create your profile on Docker Hub

On Docker Hub, you can store your disk images. Simply create a profile, and don't forget your credentials (username, email, password). Also, create a repository following the simple instructions given by the website. Let's assume we want to create a customized image of CentOS. I'm going to name my repository my_repository.

2 Install Docker

The instructions for the installation depend on the host operating system, and can be found here. In my case, my platform is CentOS (do not make confusion: this refers to the host operating system. By chance, also the image I want to build upon is based on CentOS, but can be whatever).
So I'm following the instructions given here.

# update the system
sudo yum update

# add the yum repo
sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF
 
# Install Docker
sudo yum install docker-engine
 
# Start the docker daemon
sudo service docker start
 
# try the installation 
sudo docker run hello-world
 

3 Add my user to the docker group

Docker can be run by root and by docker group. You need to add your user to the docker group.

sudo usermod -aG docker my_username

4 Configure docker daemon to start at boot

sudo chkconfig docker on

5 Search for the image that you want to build upon, and pull it

I need to build upon a CentOS image (in this case I refer to the "guest" operating system).
First, I need to log in (I use the credentials that I used in the docker hub so to be able to push it there).

# log in
docker log in 

# search centos
docker search centos
# pull centos (latest version)
docker pull centos

6 Run Docker

docker run -i -t centos /bin/bash

This way you'll enter the guest machine. You will be logged something like my_username@machine_ID. Take note of this machine_ID, because you will use it when you commit / push.
Now do some changes to your virtual environment, like updating, installing something, etc.

7 Commit and, if you like, push

Eventually, you commit the changes and push to the docker hub.

# commit the changes
docker commit -m "this is a message" -a "the author" machine_ID \
my_username/my_repository 

# push to the docker hub repository (online)
docker push my_username/my_repository

mercoledì 11 novembre 2015

Call for Presentations Geospatial devroom @FOSDEM 2016

FOSDEM is a free and non-commercial event bringing together about 5000 developers in Brussels, Belgium. The goal is to provide open source software developers and communities a place to meet and share thoughts. The participation is free of charge, although donations are welcome. The next edition will take place the last weekend of January 30 - 31 2016. This year for the second time there will be a Geospatial devroom on Sunday 31/1/2016, organised by members of the OSGeo, Locationtech and OpenStreetMap communities.

Geospatial technology is becoming rapidly mainstream. The idea underpinning the geospatial devroom is bringing together developers with different backgrounds to disclose the opportunities offered by cutting-edge open source geospatial technologies. Due to the success of last year's geospatial devroom, a Belgium local chapter of OSGeo, OSGeo.be was founded, and is now taking part of the organisation of the devroom as driving community.

The Geospatial devroom is the place to talk about the state of the art of open, geo-related data, free and open source geospatial software and its ecosystem. This includes standards and tools, e.g. spatial databases, online mapping tools, geospatial services, used for collecting, storing, delivering, analysing, and visualizing geodata. We welcome submissions about: 

  • Web and desktop GIS applications
  • Interoperable geospatial web services and specifications
  • Collection of data using sensors/drones/satellites
  • Open hardware for geospatial applications
  • Geo-analytic algorithms/libraries
  • Geospatial extensions for classical databases (indexes, operations) and dedicated databases
  • Collaborative editing/versioning of geodata
  • Big geodata, scalable GIS applications
  • Volunteered Geograpic information - Crowdsourced data

HOW TO SUBMIT YOUR PROPOSAL FOR A TALK

Are you thrilled to present your work to other open source developers? Would you like to run a discussion? Any other ideas? Please submit your proposal using the Pentabarf event planning tool at:


Make sure to select the 'Geospatial devroom' as  'Track'. Please, specify in the notes if you prefer for your presentation either a short timeslot (lightning talks ~10 minutes) or a long timeslot (20 minutes presentation + discussion). However, note that time slots are indicative and will be assigned according to the needs of the session.

The DEADLINE for submissions is Tuesday **1st December 2015**. Notification of acceptance will be sent to the Authors by Friday 11/12/2015 at the latest.

Should you have any questions, please do not hesitate to get in touch with the organisers of the devroom at fosdem-geospatial@gisky.be! Feel free to forward this CfP to anyone potentially interested.


Johan Van de Wauw
Margherita Di Leo
Astrid Emde
Anne Ghisla
Martin Hammitzsch
Andy Petrella 
Dirk Frigne
Olivier Courtin
Thomas Gratier


lunedì 19 gennaio 2015

How to reproject shapefile to import in GRASS

Here's a simple tutorial to make a CRS transformation of a shapefile before importing, to match the CRS of the location you have in GRASS.

Step 1 - See if you need coordinates conversion


Start GRASS 7, enter your location. In the Layer Manager, go to File -> Import vector data -> Common import formats.
Select Source type - Directory.
Browse the directory where the vector file you want to import is located.
A list of vector layers will load (can be one single vector). Under "Projection" you can see either "Yes" or "No". If you see "Yes", it means that the vector you want to import matches with the location projection, and you can proceed importing it immediately. Otherwise follow the steps listed below.

Step 2 - Export CRS information from GRASS location

 

Very easy. In GRASS, run the command

g.proj -wef > target.prj

This will export a text file called target.prj into your home folder.


Step 3 - Reproject shapefile and import in GRASS


The reprojection can be done using GDAL. The vector_source is the vector file that you want to reproject. The vector_target is the reprojected one. Pay attention to the order you put them in. When you are ready, shoot this command in the terminal:

ogr2ogr -t_srs target.prj -s_srs vector_source.prj  vector_target.shp vector_source.shp

Voila. You're done. You can now import your vector_target.shp file in the GRASS location.