HiRISE

HiRISE.HiWish
Class Cloning

java.lang.Object
  extended by HiRISE.HiWish.SuggestionStorage
      extended by HiRISE.HiWish.Cloning

public class Cloning
extends SuggestionStorage

Set of utility methods for cloning, converting to stereo, and other related tasks.


Nested Class Summary
static class Cloning.Pairable
           
 
Field Summary
 
Fields inherited from class HiRISE.HiWish.SuggestionStorage
conn, logger
 
Constructor Summary
Cloning(Connection conn)
           
 
Method Summary
static Map<String,String> castify(Suggestion form)
          Converts suggestion input into key-value pairs that can be used to create a new Cast (TGO/CaSSIS) suggestion
 Cloning.Pairable checkPairable(int id)
           
 Cloning.Pairable checkPairable(String observationId)
          Determines if an observation is suitable to be paired with a new suggestion to form a stereo relation.
 Suggestion cloneObservation(String id)
          Clone an observation, including its parent suggestion, as a new suggestion.
 void loadCoordinates(Suggestion suggestion, ResultSet rs)
           
 Suggestion pairObservation(String observationId)
           
 Suggestion pairSuggestion(int id)
           
static String polygonToROI(com.vividsolutions.jts.geom.Polygon poly)
          Serializes a Polygon object as a comma-separated list of coordinates
 
Methods inherited from class HiRISE.HiWish.SuggestionStorage
load, roiToPolygonText, save
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cloning

public Cloning(Connection conn)
Method Detail

castify

public static Map<String,String> castify(Suggestion form)
Converts suggestion input into key-value pairs that can be used to create a new Cast (TGO/CaSSIS) suggestion


checkPairable

public Cloning.Pairable checkPairable(String observationId)
                               throws SQLException
Determines if an observation is suitable to be paired with a new suggestion to form a stereo relation.

Parameters:
observationId - the candidate observation ID for pairing
Returns:
AVAILABLE if the observation can be paired
Throws:
SQLException - Problem with query

checkPairable

public Cloning.Pairable checkPairable(int id)
                               throws SQLException
Throws:
SQLException

cloneObservation

public Suggestion cloneObservation(String id)
                            throws SQLException
Clone an observation, including its parent suggestion, as a new suggestion.

Parameters:
id - The observation ID
Returns:
suggestion instance or null
Throws:
SQLException - Data could not be loaded

pairSuggestion

public Suggestion pairSuggestion(int id)
                          throws SQLException
Throws:
SQLException

loadCoordinates

public void loadCoordinates(Suggestion suggestion,
                            ResultSet rs)

pairObservation

public Suggestion pairObservation(String observationId)
                           throws SQLException
Throws:
SQLException

polygonToROI

public static String polygonToROI(com.vividsolutions.jts.geom.Polygon poly)
Serializes a Polygon object as a comma-separated list of coordinates

Parameters:
poly - geometry
Returns:
CSV coordinates

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona