OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
#include <ossimViewshedTool.h>
Classes | |
class | Radial |
Public Member Functions | |
ossimViewshedTool () | |
~ossimViewshedTool () | |
virtual void | setUsage (ossimArgumentParser &ap) |
Initializes the aurgument parser with expected parameters and options. More... | |
virtual bool | initialize (ossimArgumentParser &ap) |
Initializes from command line arguments. More... | |
virtual void | initialize (const ossimKeywordlist &kwl) |
Reads processing params from KWL and prepares for execute. More... | |
virtual ossimRefPtr< ossimImageData > | getChip (const ossimIrect &img_rect) |
Computes the viewshed for the area represented by argument AOI. More... | |
virtual bool | execute () |
Writes product to output file. More... | |
virtual void | clear () |
Disconnects and clears the DEM and image layers. More... | |
virtual ossimString | getClassName () const |
void | test () |
For engineering/debug. More... | |
![]() | |
ossimChipProcTool () | |
default constructor More... | |
virtual | ~ossimChipProcTool () |
virtual destructor More... | |
virtual void | abort () |
virtual bool | isChipProcessor () const |
Overrides base class implementation to indicate this class supports getChip() calls. More... | |
virtual ossimListenerManager * | getManager () |
virtual ossimObject * | getObject () |
virtual const ossimObject * | getObject () const |
virtual ossimRefPtr< ossimImageData > | getChip (const ossimGrect &gnd_rect) |
ossimRefPtr< ossimImageData > | getChip (const ossimDrect &map_bounding_rect, const ossimDpt &gsd) |
ossimRefPtr< ossimImageData > | getChip () |
Get chip method that assumes pre-initialized state. More... | |
const ossimFilename & | getProductFilename () const |
![]() | |
ossimTool () | |
virtual | ~ossimTool () |
virtual void | loadJSON (const Json::Value &json_request) |
Reads processing params from JSON object provided. More... | |
virtual void | saveJSON (Json::Value &json) const |
Fetch product as JSON object when applicable Always returns true since using exception on error. More... | |
virtual const std::string & | getResponse () const |
Fetch product as string (typically JSON) when applicable, otherwise passes back empty string. More... | |
virtual void | getKwlTemplate (ossimKeywordlist &kwl) |
Assigns a template keywordlist to string for initializing derived classes. More... | |
void | getAPI (std::string &out) const |
Outputs a JSON representation of the Utility's API. More... | |
std::string | getAPI () const |
void | getBuildDate (std::string &s) const |
Gets build date. More... | |
void | getRevision (std::string &s) const |
Gets revision. More... | |
void | getVersion (std::string &s) const |
Gets version. More... | |
void | setOutputStream (std::ostream *os) |
Redirects any console output to the supplied stream for logging or JNI application. More... | |
bool | helpRequested () const |
Returns true when the initialization detects a "--help" option, so caller can avoid subsequent execute() call. More... | |
![]() | |
ossimObject () | |
virtual | ~ossimObject () |
virtual ossimObject * | dup () const |
virtual ossimString | getShortName () const |
virtual ossimString | getLongName () const |
virtual ossimString | getDescription () const |
virtual RTTItypeid | getType () const |
virtual bool | canCastTo (ossimObject *obj) const |
virtual bool | canCastTo (const RTTItypeid &id) const |
virtual bool | canCastTo (const ossimString &parentClassName) const |
virtual bool | saveState (ossimKeywordlist &kwl, const char *prefix=0) const |
virtual bool | loadState (const ossimKeywordlist &kwl, const char *prefix=0) |
virtual std::ostream & | print (std::ostream &out) const |
Generic print method. More... | |
virtual bool | isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const |
virtual void | accept (ossimVisitor &visitor) |
![]() | |
ossimReferenced () | |
ossimReferenced (const ossimReferenced &) | |
ossimReferenced & | operator= (const ossimReferenced &) |
void | ref () const |
increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
void | unref () const |
decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
void | unref_nodelete () const |
decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
int | referenceCount () const |
![]() | |
JsonInterface () | |
virtual | ~JsonInterface () |
![]() | |
ossimProcessInterface () | |
virtual | ~ossimProcessInterface () |
bool | needsAborting () const |
bool | isAbortRequested () const |
bool | isAborted () const |
bool | isExecuting () const |
ossimProcessStatus | getProcessStatus () const |
virtual void | setProcessStatus (ossimProcessStatus processStatus) |
virtual double | getPercentComplete () const |
virtual void | setPercentComplete (double percentComplete) |
void | enableEvents () |
void | disableEvents () |
void | setCurrentMessage (const ossimString &message) |
virtual std::ostream & | print (std::ostream &out) const |
![]() | |
ossimListenerManager () | |
virtual | ~ossimListenerManager () |
virtual void | fireEvent (ossimEvent &event) |
virtual bool | addListener (ossimListener *listener) |
virtual bool | removeListener (ossimListener *listener) |
virtual bool | findListener (ossimListener *listener) |
Static Public Attributes | |
static const char * | DESCRIPTION |
Used by ossimUtilityFactory. More... | |
Protected Member Functions | |
virtual void | initProcessingChain () |
Derived classes initialize their custom chains here. More... | |
virtual void | initializeProjectionGsd () |
Initializes the projection gsd. More... | |
virtual void | initializeAOI () |
Initializes m_aoiViewRect with the output area of interest as specified in master KWL. More... | |
void | paintReticle () |
void | initRadials () |
bool | writeHorizonProfile () |
void | computeRadius () |
bool | optimizeFOV () |
bool | computeViewshed () |
![]() | |
void | processRemainingArgs (ossimArgumentParser &ap) |
Intended to be called after derived class has picked off its own options from the parser, and arguments remain (such as input and output filenames). More... | |
virtual void | finalizeChain () |
Called after initProcessingChain() to append common items to the processing chain. More... | |
virtual void | loadImageFiles () |
Creates chains for image entries associated with specified keyword. More... | |
virtual void | loadDemFiles () |
Loads all DEM files specified in master KWL into the elev manager's database. More... | |
ossimRefPtr< ossimSingleImageChain > | createInputChain (const ossimFilename &image_file, ossim_uint32 entry_index=0) |
Creates the ossimSingleImageChain from image filename and populates the chain with resampler and product output projection on view-side of resampler's IVT. More... | |
void | createOutputProjection () |
Creates the output or view projection. More... | |
ossimRefPtr< ossimMapProjection > | newIdentityProjection () |
Sets the single image chain for identity operations view to a ossimImageViewAffineTransform. More... | |
ossimRefPtr< ossimMapProjection > | newUtmProjection () |
Convenience method to get a utm projection. More... | |
bool | getProjectionOrigin (ossimGpt &gpt) |
Reads the KWL for origin latitude and central meridian. More... | |
ossimRefPtr< ossimImageFileWriter > | newWriter () |
Creates a new writer. More... | |
void | propagateGeometryToChains () |
Loops through all chains and sets the output projection. More... | |
ossimRefPtr< ossimImageSource > | combineLayers (std::vector< ossimRefPtr< ossimSingleImageChain > > &layers) const |
When multiple input sources are present, this method instantiates a combiner and adds inputs. More... | |
void | computeAdjustedViewFromGrect () |
Initializes m_aoiViewRect given m_aoiGroundRect. More... | |
void | setAoiToInputs () |
Assigns the AOI to be the bounding rect of the union of all inputs. More... | |
void | getBandList (ossim_uint32 image_idx, std::vector< ossim_uint32 > &bandList) const |
Gets the band list if BANDS keyword is set. More... | |
void | setReaderProps (ossimImageHandler *ih) const |
Passes reader properties to single image handler if any. More... | |
ossimChipProcTool (const ossimChipProcTool &obj) | |
Hidden from use copy constructor. More... | |
const ossimChipProcTool & | operator= (const ossimChipProcTool &) |
Hidden from use assignment operator. More... | |
ossimRefPtr< ossimGeoPolygon > | createClipPolygon () const |
void | findCenterGpt (ossimGpt &gpt) |
Tries to determine the AOI center point based on KWL entries, else returns NaNs in gpt. More... | |
ossimRefPtr< ossimImageSource > | mosaicDemSources () |
Some utilities need to work on DEMs as images. More... | |
![]() | |
virtual | ~ossimReferenced () |
![]() | |
ossimListenerManager (const ossimListenerManager &rhs) | |
Friends | |
class | SectorProcessorJob |
class | RadialProcessorJob |
class | RadialProcessor |
Additional Inherited Members | |
![]() | |
enum | ossimProcessStatus { PROCESS_STATUS_UNKNOWN = 0, PROCESS_STATUS_EXECUTING = 1, PROCESS_STATUS_ABORTED = 2, PROCESS_STATUS_ABORT_REQUEST = 3, PROCESS_STATUS_NOT_EXECUTING = 4 } |
Class for computing the viewshed on a DEM given the viewer location and max range of visibility
Definition at line 21 of file ossimViewshedTool.h.
ossimViewshedTool::ossimViewshedTool | ( | ) |
Definition at line 47 of file ossimViewshedTool.cpp.
References m_observerGpt, and ossimGpt::makeNan().
ossimViewshedTool::~ossimViewshedTool | ( | ) |
|
virtual |
Disconnects and clears the DEM and image layers.
Leaves OSSIM initialized.
Reimplemented from ossimChipProcTool.
Definition at line 305 of file ossimViewshedTool.cpp.
References ossimChipProcTool::clear(), m_horizonMap, m_jobMtQueue, m_observerGpt, m_outBuffer, m_visRadius, and ossimGpt::makeNan().
|
protected |
Definition at line 700 of file ossimViewshedTool.cpp.
References ossimGpt::distanceTo(), ossimIrect::hasNans(), ossimGrect::ll(), ossimGrect::lr(), ossimChipProcTool::m_aoiGroundRect, ossimChipProcTool::m_aoiViewRect, m_observerGpt, m_visRadius, ossimGrect::ul(), and ossimGrect::ur().
Referenced by initProcessingChain().
|
protected |
Definition at line 486 of file ossimViewshedTool.cpp.
References ossimImageDataFactory::create(), d_accumT, ossimImageData::fill(), ossimImageChain::getNullPixelValue(), ossim::getNumberOfThreads(), ossimIrect::height(), ossimImageData::initialize(), initRadials(), ossimImageDataFactory::instance(), ossimChipProcTool::m_aoiViewRect, m_halfWindow, m_jobMtQueue, m_memSource, m_numThreads, m_outBuffer, ossimChipProcTool::m_procChain, m_radials, m_threadBySector, ossimProcessInterface::needsAborting(), optimizeFOV(), OSSIM_UINT8, ossimNotify(), ossimNotifyLevel_INFO, paintReticle(), ossimMemoryImageSource::setImage(), ossimImageData::setImageRectangle(), ossim::Thread::sleepInMicroSeconds(), ossimRefPtr< T >::valid(), and ossimIrect::width().
Referenced by execute(), and getChip().
|
virtual |
Writes product to output file.
Returns true if successful.
Reimplemented from ossimChipProcTool.
Definition at line 472 of file ossimViewshedTool.cpp.
References computeViewshed(), ossimString::empty(), ossimChipProcTool::execute(), ossimTool::m_helpRequested, m_horizonFile, ossimNotify(), ossimNotifyLevel_INFO, and writeHorizonProfile().
|
virtual |
Computes the viewshed for the area represented by argument AOI.
Reimplemented from ossimChipProcTool.
Definition at line 449 of file ossimViewshedTool.cpp.
References computeViewshed(), ossimImageChain::getTile(), ossimImageGeometry::localToWorld(), ossimChipProcTool::m_aoiGroundRect, ossimChipProcTool::m_aoiViewRect, ossimChipProcTool::m_geom, ossimChipProcTool::m_procChain, ossimImageGeometry::setImageSize(), ossimIrect::size(), and ossimRefPtr< T >::valid().
|
inlinevirtual |
Reimplemented from ossimTool.
Definition at line 58 of file ossimViewshedTool.h.
|
virtual |
Initializes from command line arguments.
Reimplemented from ossimChipProcTool.
Definition at line 133 of file ossimViewshedTool.cpp.
References ossimKeywordlist::addPair(), ossimChipProcTool::initialize(), ossimTool::m_helpRequested, ossimTool::m_kwl, ossimArgumentParser::read(), and ossimString::toDouble().
|
virtual |
Reads processing params from KWL and prepares for execute.
Returns TRUE if successful.
Reimplemented from ossimChipProcTool.
Definition at line 225 of file ossimViewshedTool.cpp.
References ossimKeywordlist::findKey().
|
protectedvirtual |
Initializes m_aoiViewRect with the output area of interest as specified in master KWL.
Initialization will either come from user defined cut options or the source bounding rect with user options taking precidence.
Reimplemented from ossimChipProcTool.
Definition at line 336 of file ossimViewshedTool.cpp.
References ossimKeywordlist::hasKey(), ossimGrect::hasNans(), ossimGpt::hasNans(), ossimChipProcTool::initializeAOI(), ossimChipProcTool::m_aoiGroundRect, ossimTool::m_kwl, m_observerGpt, m_visRadius, and ossimGrect::midPoint().
|
protectedvirtual |
Initializes the projection gsd.
This loops through all chains to find the minimum gsd.
Reimplemented from ossimChipProcTool.
Definition at line 315 of file ossimViewshedTool.cpp.
References ossimElevManager::getHeightAboveEllipsoid(), ossimElevManager::getMeanSpacingMeters(), ossimImageGeometry::getProjection(), ossimDpt::hasNans(), ossimGpt::hasNans(), ossimChipProcTool::initializeProjectionGsd(), ossimElevManager::instance(), ossimChipProcTool::m_geom, ossimChipProcTool::m_geoScaled, ossimChipProcTool::m_gsd, m_observerGpt, ossimMapProjection::setMetersPerPixel(), ossimMapProjection::setOrigin(), ossimDpt::x, and ossimDpt::y.
|
protectedvirtual |
Derived classes initialize their custom chains here.
Implements ossimChipProcTool.
Definition at line 379 of file ossimViewshedTool.cpp.
References ossimImageChain::add(), ossimIrect::area(), ossimIrect::clipToRect(), ossimChipProcTool::combineLayers(), computeRadius(), ossimConnectableObject::connectMyInputTo(), ossimRefPtr< T >::get(), ossimElevManager::getHeightAboveEllipsoid(), ossimImageGeometry::getProjection(), ossimGpt::hasNans(), ossimIrect::hasNans(), ossimIrect::height(), ossimGpt::hgt, ossimImageDataFactory::instance(), ossimElevManager::instance(), ossimImageGeometry::localToWorld(), ossimChipProcTool::m_aoiGroundRect, ossimChipProcTool::m_aoiViewRect, ossimChipProcTool::m_geom, ossimChipProcTool::m_gsd, m_halfWindow, ossimChipProcTool::m_imgLayers, m_memSource, m_observerGpt, m_observerVpt, m_obsHgtAbvTer, m_outBuffer, ossimChipProcTool::m_procChain, m_visRadius, OSSIM_UINT8, ossimMemoryImageSource::setImage(), ossimMemoryImageSource::setImageGeometry(), ossimImageData::setImageRectangle(), ossimImageGeometry::setImageSize(), ossimIrect::size(), size, ossimRefPtr< T >::valid(), ossimIrect::width(), ossimImageGeometry::worldToLocal(), and ossimDpt::x.
|
protected |
Definition at line 724 of file ossimViewshedTool.cpp.
References ossimViewshedTool::Radial::azimuth, m_halfWindow, m_radials, m_startFov, and m_stopFov.
Referenced by computeViewshed().
|
protected |
Definition at line 577 of file ossimViewshedTool.cpp.
References ossimGpt::azimuthTo(), ossimGpt::lat, ossimGrect::ll(), ossimGpt::lon, ossimGrect::lr(), ossimChipProcTool::m_aoiGroundRect, m_observerGpt, m_startFov, m_stopFov, ossimNotify(), ossimNotifyLevel_INFO, ossimGrect::pointWithin(), ossimGrect::ul(), and ossimGrect::ur().
Referenced by computeViewshed(), and test().
|
protected |
Definition at line 794 of file ossimViewshedTool.cpp.
References ossimIrect::lr(), ossimChipProcTool::m_aoiViewRect, m_displayAsRadar, ossimChipProcTool::m_geom, m_observerGpt, m_observerVpt, m_outBuffer, m_overlayValue, m_reticleSize, ossimIrect::pointWithin(), ossimImageData::setValue(), ossimIrect::ul(), ossimImageGeometry::worldToLocal(), ossimIpt::x, ossimDpt::x, x, ossimIpt::y, ossimDpt::y, and y.
Referenced by computeViewshed().
|
virtual |
Initializes the aurgument parser with expected parameters and options.
It does not output anything. To see the usage, the caller will need to do something like:
ap.getApplicationUsage()->write(<ostream>);
Reimplemented from ossimChipProcTool.
Definition at line 79 of file ossimViewshedTool.cpp.
References ossimApplicationUsage::addCommandLineOption(), DESCRIPTION, ossimArgumentParser::getApplicationName(), ossimArgumentParser::getApplicationUsage(), ossimApplicationUsage::setCommandLineUsage(), ossimApplicationUsage::setDescription(), and ossimChipProcTool::setUsage().
void ossimViewshedTool::test | ( | ) |
For engineering/debug.
Definition at line 1013 of file ossimViewshedTool.cpp.
References ossimChipProcTool::m_aoiGroundRect, m_observerGpt, m_startFov, m_stopFov, and optimizeFOV().
|
protected |
Definition at line 829 of file ossimViewshedTool.cpp.
References ossim::atand(), ossimString::chars(), m_halfWindow, m_horizonFile, m_horizonMap, and m_radials.
Referenced by execute().
|
friend |
Definition at line 25 of file ossimViewshedTool.h.
|
friend |
Definition at line 24 of file ossimViewshedTool.h.
|
friend |
Definition at line 23 of file ossimViewshedTool.h.
|
protected |
Definition at line 112 of file ossimViewshedTool.h.
Referenced by computeViewshed().
|
protected |
Definition at line 113 of file ossimViewshedTool.h.
|
static |
Used by ossimUtilityFactory.
Definition at line 61 of file ossimViewshedTool.h.
Referenced by ossimToolFactory::getCapabilities(), and setUsage().
|
protected |
Definition at line 94 of file ossimViewshedTool.h.
Referenced by RadialProcessor::doRadial(), and paintReticle().
|
protected |
Definition at line 95 of file ossimViewshedTool.h.
Referenced by computeViewshed(), RadialProcessor::doRadial(), initProcessingChain(), initRadials(), and writeHorizonProfile().
|
protected |
Definition at line 99 of file ossimViewshedTool.h.
Referenced by RadialProcessor::doRadial().
|
protected |
Definition at line 108 of file ossimViewshedTool.h.
Referenced by execute(), and writeHorizonProfile().
|
protected |
Definition at line 109 of file ossimViewshedTool.h.
Referenced by clear(), and writeHorizonProfile().
|
protected |
Definition at line 103 of file ossimViewshedTool.h.
Referenced by clear(), and computeViewshed().
|
protected |
Definition at line 97 of file ossimViewshedTool.h.
Referenced by computeViewshed(), and initProcessingChain().
|
protected |
Definition at line 104 of file ossimViewshedTool.h.
Referenced by computeViewshed().
|
protected |
Definition at line 88 of file ossimViewshedTool.h.
Referenced by clear(), computeRadius(), RadialProcessor::doRadial(), initializeAOI(), initializeProjectionGsd(), initProcessingChain(), optimizeFOV(), ossimViewshedTool(), paintReticle(), and test().
|
protected |
Definition at line 89 of file ossimViewshedTool.h.
Referenced by RadialProcessor::doRadial(), initProcessingChain(), and paintReticle().
|
protected |
Definition at line 90 of file ossimViewshedTool.h.
Referenced by RadialProcessor::doRadial(), and initProcessingChain().
|
protected |
Definition at line 93 of file ossimViewshedTool.h.
|
protected |
Definition at line 96 of file ossimViewshedTool.h.
Referenced by clear(), computeViewshed(), RadialProcessor::doRadial(), initProcessingChain(), and paintReticle().
|
protected |
Definition at line 100 of file ossimViewshedTool.h.
Referenced by RadialProcessor::doRadial(), and paintReticle().
|
protected |
Definition at line 92 of file ossimViewshedTool.h.
Referenced by computeViewshed(), RadialProcessor::doRadial(), initRadials(), writeHorizonProfile(), and ~ossimViewshedTool().
|
protected |
Definition at line 101 of file ossimViewshedTool.h.
Referenced by paintReticle().
|
protected |
Definition at line 102 of file ossimViewshedTool.h.
Referenced by RadialProcessor::doRadial().
|
protected |
Definition at line 105 of file ossimViewshedTool.h.
Referenced by initRadials(), optimizeFOV(), and test().
|
protected |
Definition at line 106 of file ossimViewshedTool.h.
Referenced by initRadials(), optimizeFOV(), and test().
|
protected |
Definition at line 107 of file ossimViewshedTool.h.
Referenced by computeViewshed().
|
protected |
Definition at line 98 of file ossimViewshedTool.h.
Referenced by RadialProcessor::doRadial().
|
protected |
Definition at line 91 of file ossimViewshedTool.h.
Referenced by clear(), computeRadius(), initializeAOI(), and initProcessingChain().