OziAPI-Java

OziAPI-Java is a Java library which provides access to the OziExplorer API from Java. OziExplorer is a GPS mapping application which allows you to work with maps on the computer screen. The maps are created from scanned or digital maps.

For details of OziExplorer see the OziExplorer homepage at http://www.oziexplorer3.com.

The documentation for the OziAPI-Java library can be found here, and the library itself can be downloaded from the project page on SourceForge. Also available is the source code, either as a release bundle or via anonymous SVN access.

For details of the underlying API used by this library, see the OziAPI documentation at http://www.oziexplorer3.com/oziapi/oziapi.html

OziAPI-Java features and benefits

Unlike the underlying OziAPI DLL, OziAPI-Java will accept either lattitude/longitude or grid references as parameters. This makes it very easy to perform coordinate conversions, for example:

BNGGridRef bng = new BNGGridRef("SK 12345 67890");
UTMGridRef utm = new UTMGridRef(bng);
LatLon latLon = new LatLon(bng);

This library also provides full access to all the OziAPI callback functionality - using this part of the OziAPI often causes problems such as random application failures and crashes, a significant proportion of the code in this library is concerned with providing reliable, thread-safe access to the OziAPI callback functionality.

Applications that use OziAPI-Java

The following applications use OziAPI-Java:

OziPhotoTool
OziPhotoTool combines the technology of a GPS receiver and a digital camera to automatically keep a record of where digital photos were taken. See the OziPhotoTool website for more details.

Using the OziAPI-Java library

The OziAPI-Java library can be obtained in either binary or source form from the SourceForge project page. Documentation on how to install and use the OziAPI-Java library can be found in the javadoc documentation.

NetBeans tips

As the OziAPI-Java library consists of both a JAR and DLLs, any NetBeans projects that use OziAPI-Java need to ensure that the DLLs are copied into the appropriate locations and that java.library.path is set appropriately. This can be done by adding a dependency to your project onto the OziAPI-Java project and then adding the following to the NetBeans build files in your project:

build.xml

<!-- Copy the OziAPI DLLs into the dist directory -->
<target name="-pre-jar">
    <copy todir="dist"><
        fileset dir="${project.OziAPI}/dist" includes="*.dll"/>
    </copy>
</target>

nbproject/project.properties

# Make sure that Netbeans can find the DLLs when it runs the application.
run-sys-prop.java.library.path=${basedir}/${dist.dir};${java.library.path}

Copyright and License

Copyright 2012 Alan Burlison <moc.wolkaelb@nala> All rights reserved. Use is subject to license terms.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY ALAN BURLISON "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ALAN BURLISON OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Changelog

Version 0.3, 16 August 2011
Moved to less-restrictive BSD-style license. Old CDDL-covered versions removed. Fix for 1761899. PMD and gcc warnings fixed. Upgraded build infrastructure to NetBeans 7.0.1 and for changes to SourceForge infrastructure.

Version 0.4, 23 August 2011
New classes to read/write OziExplorer data files. Numerous minor bugfixes.

Version 0.5, 29 October 2011
OziAPI.getPixelXY was returning an incorrect type (bug 3428098).

Version 0.6, 22 January 2012
Added OziAPI.writeWaypointFile, to support OziAPI 0.9. File IO class constructors weren't calling the correct clear() methods.

Getting help and reporting bugs

You can report bugs and request assistance using the facilities provided on the SourceForge project page.

Building OziAPI-Java yourself

OziAPI-Java uses JNI (C) code to interact with OziExplorer. The library was built using NetBeans as the IDE and the MinGW C compiler. I have written several blog posts on how this is done, I will be collating this into a developer's guide at some point in the future. Contact me through the project page on Sourceforge if you are desperate to get started :-)

SourceForge.net