-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yen, David (398B-Affiliate)
committed
Oct 17, 2022
1 parent
fde7df7
commit e671af0
Showing
14 changed files
with
1,686 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/gov/nasa/cumulus/metadata/aggregator/IsoSwotXPath.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package gov.nasa.cumulus.metadata.aggregator; | ||
|
||
public final class IsoSwotXPath extends IsoXPath { | ||
public static final String POLYGON = "/gmd:DS_Series/gmd:composedOf/gmd:DS_DataSet/gmd:has/gmi:MI_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_BoundingPolygon/gmd:polygon/gml:Polygon/gml:exterior/gml:LinearRing/gml:posList"; | ||
public static final String CYCLE_PASS_TILE_SCENE = "/gmi:MI_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement/gmd:EX_GeographicDescription[@id=\"SWOTTrack\"]/gmd:geographicIdentifier/gmd:MD_Identifier/gmd:code/gco:CharacterString"; | ||
public static final String CREATION_DATE_TIME = "/gmi:MI_Metadata/gmd:dateStamp/gco:DateTime"; | ||
public static final String BEGINNING_DATE_TIME = "/gmi:MI_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition"; | ||
public static final String ENDING_DATE_TIME = "/gmi:MI_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:endPosition"; | ||
|
||
} |
281 changes: 265 additions & 16 deletions
281
src/main/java/gov/nasa/cumulus/metadata/aggregator/MetadataFilesToEcho.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/main/java/gov/nasa/cumulus/metadata/aggregator/factory/UmmgPojoFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package gov.nasa.cumulus.metadata.aggregator.factory; | ||
|
||
import gov.nasa.cumulus.metadata.umm.generated.AdditionalAttributeType; | ||
import gov.nasa.cumulus.metadata.umm.generated.TrackPassTileType; | ||
import gov.nasa.cumulus.metadata.umm.generated.TrackType; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class UmmgPojoFactory { | ||
private static UmmgPojoFactory _self = null; | ||
|
||
private UmmgPojoFactory(){} | ||
|
||
public static UmmgPojoFactory getInstance() { | ||
if (_self == null){ | ||
_self = new UmmgPojoFactory(); | ||
} | ||
return _self; | ||
} | ||
|
||
/** | ||
* create a single pass -> tiles:[] association | ||
* @param pass | ||
* @param tiles | ||
* @return | ||
*/ | ||
public TrackPassTileType createTrackPassTileType(Integer pass, List<String> tiles) { | ||
TrackPassTileType trackPassTileType = new TrackPassTileType(); | ||
trackPassTileType.setPass(pass); | ||
if(tiles !=null && tiles.size() >0) { | ||
trackPassTileType.setTiles(tiles); | ||
} | ||
return trackPassTileType; | ||
} | ||
|
||
/** | ||
* Create the TrackType POJO which represents the cycle and passes array | ||
* each pass is a combination of Pass and Tiles Array | ||
* @return | ||
*/ | ||
public TrackType createTrackType(Integer cycle, List<TrackPassTileType> trackPassTileTypes) { | ||
TrackType trackType = new TrackType(); | ||
trackType.setCycle(cycle); | ||
trackType.setPasses(trackPassTileTypes); | ||
return trackType; | ||
} | ||
|
||
public List<AdditionalAttributeType> trackTypeToAdditionalAttributeType(TrackType trackType) { | ||
List<TrackPassTileType> trackPassTileTypes = trackType.getPasses(); | ||
ArrayList<AdditionalAttributeType> additionalAttributeTypes = new ArrayList<>(); | ||
trackPassTileTypes.stream().forEach(trackPassTileType -> { | ||
AdditionalAttributeType additionalAttributeType = new AdditionalAttributeType(); | ||
List<String> tilesStrs = trackPassTileType.getTiles(); | ||
additionalAttributeType.setName("TILE"); | ||
additionalAttributeType.setValues(tilesStrs); | ||
additionalAttributeTypes.add(additionalAttributeType); | ||
}); | ||
return additionalAttributeTypes; | ||
} | ||
} |
Oops, something went wrong.