From a0ea1a7782ab0630191a5bc1470a30262d7e01dc Mon Sep 17 00:00:00 2001 From: jay <jlaura@usgs.gov> Date: Wed, 8 Aug 2018 08:55:34 -0700 Subject: [PATCH] Added README.md --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..de115ff --- /dev/null +++ b/README.md @@ -0,0 +1,45 @@ +# SWIG wrappers for the Community Sensor Model + +This repository contains SWIG wrappers for the CSM. The wrappers are currently +only be created for Python, though many other languages can be supported. + +## Building & Installing +- Ensure that the library is installed +- (Optional) Install the USGS CSM_CameraModel libraries to ensure that this + wrapper is able to do something. +- mkdir build +- cd build +- cmake .. +- make +- cd python +- python setup.py install + +## +The CSM is designed so that plugins with a common insterface are dynamically +loaded. This wrapper is designed to continue that philosophy. Therefore, +loading an implementation of the interface is a little different than a +standard python import. + +```python +import csmapi +import ctypes + +# THis dynamically registers this plugin with the CSM API. +lib = ctypes.CDLL('path_to_the_libusgscsm.so') + +# The two methods that are implemented are getList and findPlugin +plugin_list = csmapi.Plugin.getList() + +# Should be 2 assuming the USGS CSM-CameraModel was used +print(len(plugin_list)) +``` + +## Issues +The dynamic cast from the model up the inheretance tree to RasterGM has not +yet been implemented. The test_functional.py (in tests) demonstrates how the +returned object is a pointer to a Model. This needs to be dynamically cast (I +think with a %factory directive) to the RasterGM class that contains the full +suite of methods. + + +``` -- GitLab