wiki:ossimjni_build

Version 1 (modified by dburken, 13 years ago) ( diff )

--

Building ossimjni module:

This is an example from linux. Adjust for windows as required.

Get the code:

$ svn co http://svn.osgeo.org/ossim/trunk/ossimjni ossimjni

Build the c++ side

$ cd /work/osgeo/build
$ xemacs ossim-osgeo-cmake-config.sh
Add line:
-DOSSIM_BUILD_ADDITIONAL_DIRECTORIES="${build_dir}/ossimjni" \

Note if you have multiple addition projects to build separate by a semi-colon;

$ rm CMakeCache.txt
$ ./ossim-osgeo-cmake-config.sh
...
**************** begin ossimjni project cmake setup ****************
**************** end ossimjni project cmake setup ****************
...

Generate the swig bindings and compile the java with ant

$ cd /work/osgeo/ossimjni/java/
$ cp local.properties.template local.properties
$ xemacs local.properties
$ ant
Buildfile: build.xml
     [echo] module.name = ossimjni
     [echo] use ant -projecthelp to see targets.
     [echo] jdk.home        = /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64
     [echo] os.name         = Linux
     [echo] ossim.home      = /work/osgeo/ossim
     [echo] ossimjni.home   = /work/osgeo/ossimjni
     [echo] basedir         = /home/work/osgeo/ossimjni/java

check-reqired-properties:

initialize-environment:

generate-wrappers:
     [echo] module.name = ossimjni
     [echo] use ant -projecthelp to see targets.
     [echo] jdk.home        = /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64
     [echo] os.name         = Linux
     [echo] ossim.home      = /work/osgeo/ossim
     [echo] ossimjni.home   = /work/osgeo/ossimjni
     [echo] basedir         = /home/work/osgeo/ossimjni/java

generate-wrapper:
    [mkdir] Created dir: /home/work/osgeo/ossimjni/java/build/generated_src
     [echo] ossimjni
     [echo] /home/work/osgeo/ossimjni/java/swig/ossimjni.i

compile-cpp-wrappers:
    [mkdir] Created dir: /home/work/osgeo/ossimjni/java/build/lib
    [mkdir] Created dir: /home/work/osgeo/ossimjni/java/build/obj
       [cc] 1 total files to be compiled.
       [cc] Starting link

compile-java-wrappers:
    [mkdir] Created dir: /home/work/osgeo/ossimjni/java/build/classes
    [javac] Compiling 8 source files to /home/work/osgeo/ossimjni/java/build/classes

compile-java:
    [javac] Compiling 7 source files to /home/work/osgeo/ossimjni/java/build/classes

create-jar:
      [jar] Building jar: /home/work/osgeo/ossimjni/java/build/lib/ossimjni.jar

build:

BUILD SUCCESSFUL

Test

$ java -Djava.library.path=/work/osgeo/ossimjni/java/build/lib -cp /work/osgeo/ossimjni/java/build/lib/ossimjni.jar org.ossim.jni.apps.OssimInfo /data1/tif/point-tif-ovr.tif
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.decimal_degrees_per_pixel_lat:  0.000224652629478557
image0.decimal_degrees_per_pixel_lon:  0.00030418128582111
image0.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125)
image0.entry:  0
image0.gsd:  (24.9824476685318,24.9824453696149)
image0.image_handler:  ossimTiffTileSource
image0.image_size:  (1000,1000)
image0.ll_lat:  42.3815978380446
image0.ll_lon:  -90.7879645973049
image0.lr_lat:  42.3912153358375
image0.lr_lon:  -90.4851680233695
image0.lr_x:  999
image0.lr_y:  999
image0.meters_per_pixel_x:  24.9824476685318
image0.meters_per_pixel_y:  24.9824453696149
image0.number_decimation_levels:  8
image0.number_input_bands:  3
image0.number_lines:  1000
image0.number_output_bands:  3
image0.number_samples:  1000
image0.overview_handler:  ossimTiffTileSource
image0.projection.central_meridian:  -87
image0.projection.datum:  WGE
image0.projection.elevation_lookup_flag:  0
image0.projection.ellipse_code:  WE
image0.projection.ellipse_epsg_code:  7030
image0.projection.ellipse_name:  WGS 84
image0.projection.false_easting_northing:  (500000,0)
image0.projection.false_easting_northing_units:  meters
image0.projection.gcs_code:  4326
image0.projection.hemisphere:  N
image0.projection.major_axis:  6378137
image0.projection.minor_axis:  6356752.3142
image0.projection.origin_latitude:  0
image0.projection.pcs_code:  32616
image0.projection.pixel_scale_units:  meters
image0.projection.pixel_scale_xy:  (25,25)
image0.projection.srs_name:  EPSG:32616
image0.projection.tie_point_units:  meters
image0.projection.tie_point_xy:  (188150,4724075)
image0.projection.type:  ossimUtmProjection
image0.projection.zone:  16
image0.radiometry:  8-bit
image0.target_rrds:  0
image0.tie_point_lat:  42.6060258148936
image0.tie_point_lon:  -90.8015523744828
image0.type:  ossimImageGeometry
image0.ul_lat:  42.6060258148936
image0.ul_lon:  -90.8015523744828
image0.ul_x:  0
image0.ul_y:  0
image0.ur_lat:  42.6157187475369
image0.ur_lon:  -90.4976752699475
number_entries:  1
Note: See TracWiki for help on using the wiki.