[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orekit Users] Problem with orekit.data.path



Le 12/06/2012 16:51, eymeric.boyer@isae.fr a écrit :
> Hello,

Hi Eymeric,

> 
> We're working on a project based on Orekit and we are facing some difficulties
> to add the zip file orekit-data to orekit.data.path ? How do you do that ?
> We tried to use the autoconfiguration class but it didn't work.

The autoconfiguration class is intended only as a quick and dirty hack
that is able to launch the tutorials in two simple cases: when the data
are at the user home directory (either unziped or zipped) or when the
data is in the classpath in an IDE like Eclipse. It is not intended to
be used in the general case.


One possible solution for you is to put the orekit-data.zip in some
directory anywhere on your disk (say for example
/home/eymeric/orekit-data.zip in a unix type environment) and to use the
-D flag of the Java virtual machine to specify the orekit.data.path
property. From the command line, this would be something similar to:

  java -jar myapplication.jar
-Dorekit.data.path=/home/eymeric/orekit-data.zip

From an IDE environment like Eclipse, there are ways to specify JVM
flags like the -D flag in the run launchers configuration.

Another possibility, simpler for the user but forcing him to always put
the data in a specific location, would be to not use the
orekit.data.path property but instead to configuration the data
providers manager directly in your application, by inserting this code
snippet in the main:

  File ziFfile = new File("/some/location/orekit-data.zip");
  DataProvidersManager manager = DataProvidersManager.getInstance();
  manager.addProvider(new ZipJarCrawler(zipFile));

You can read some additional information here:
<https://www.orekit.org/forge/projects/orekit/wiki/Configuration>.

best regards,
Luc

> 
> Thank you for your help,
> 
> EBGE
>