ES:Osmosis/Instalación

From OpenStreetMap Wiki
Jump to navigation Jump to search

La instalación de Osmosis es bastante sencilla. Osmosis es una herramienta para la línea de comandos, que requiere de Java instalado en su sistema. Esta página da instrucciones para la instalación de Osmosis en diferentes sistemas operativos, así como información general en #environment variables and config files

Instalando Osmosis pre-compilado

Linux

wget http://bretth.dev.openstreetmap.org/osmosis-build/osmosis-latest.tgz
mkdir osmosis
mv osmosis-latest.tgz osmosis
cd osmosis
tar xvfz osmosis-latest.tgz
rm osmosis-latest.tgz
chmod a+x bin/osmosis
bin/osmosis

Windows

Ver Osmosis/Quick_Install_(Windows)

Compilando desde la fuente

Requerimientos

Para compilar Osmosis desde la fuente es necesario tener como mínimo la versión 1.6 de Java Development Kit (ver Osmosis#Notes para obtener más detalles al respecto), Junit, ant, y ant-optional.


Pasos

cd ~/src
git clone git://github.com/openstreetmap/osmosis.git
cd osmosis
./gradlew assemble

Osmosis ya no se compila con 'ant'. Por favor ve el archivo readme: https://github.com/openstreetmap/osmosis/blob/master/README para su uso con gradlew.

El paquete compilado puede ejecutarse entonces:

package/bin/osmosis

Para instrucciones actualizadas detalladas, ver el archivo readme: https://github.com/openstreetmap/osmosis/blob/master/README

Debian

Stable, Testing, SID

Osmosis se incluye en debian desde el release de Squeeze, actualmente en la versión 0.34. Si usas debian stable, testing o sid, puedes instalar Osmosis tan simple como:

apt-get install osmosis

Backports no oficiales

Rodolphe Quiédeville mantiene un backport no oficial de osmosis para Debian stable al que se puede acceder en http://rodolphe.quiedeville.org/debian/ Añade la siguiente línea a tu archivo sources.list para usarlo:

deb http://rodolphe.quiedeville.org/debian/ squeeze-backports main

OS X

OS X 10.5 o anterior

Ejecutar osmosis en Mac OS X 10.5 requiere utilizar el entorno Java 1.6 (en lugar del 1.5 que viene por defecto), para lo cual hay que modificar la variable de shell JAVACMD antes de ejecutar osmosis. Este comando funciona para sistema MacBook 2007 Pro Dual Core 2.44MHz y posteriores.

export JAVACMD="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java -Xmx128m"

Alternative: Installation instructions for OS X 10.5 are same as above, except with the caveat that Java 1.6 is currently only supported on 64-bit Intel machines. You could try SoyLatte instead.

Homebrew

Package manager homebrew has a 'recipe' for osmosis. To install the latest stable version, do

brew install osmosis

Variables de entorno y archivos de configuración

Puede funcionar bien sin cambiar los defaults, pero puedes configurar las opciones de JVM y otros defaults de osmosis al configurar las variables de ambiente usadas por el script de bin/osmosis (tacked on to the java command which is invoked there)

JAVACMD - The java command to launch osmosis.
JAVACMD_OPTIONS - The options to append to the java command, typically used to modify JVM settings such as max memory.
OSMOSIS_OPTIONS - The options to apply to all osmosis invocations, typically used to add plugins or make quiet operation the default.

To set an environment variable in the scope of your current terminal, just do a command such as:

export JAVACMD_OPTIONS=-Xmx2G

(This example will bump up the amount of available memory for Java up to 2GB. See Osmosis/Tuning for details)

But if you want to save this so that it happens every time you run osmosis, put the command in a config file. The start-up script looks for a config file at a couple of different possible locations:

/etc/osmosis - (no file extension) This applies to all users on a *nix system.
~/.osmosis - (no file extension) This applies to just your user on a *nix system.
%ALLUSERSPROFILE%\osmosis.bat - This applies to all users on a windows system.
%USERPROFILE%\osmosis.bat - This applies to just your user on a windows system.

For example if you want to set the memory and the temporary file use you may enter this line into the config file:

export JAVACMD_OPTIONS="-Xmx2G -Djava.io.tmpdir=/mnt/database/tmp/"