/** * Create JSON feature from new resource xml string * * <product> <title>S1A_IW_OCN__2SDV_20150727T044706_20150727T044731_006992_0097D1_F6DA</title> <resourceSize>6317404</resourceSize> <startTime>2015-07-27T04:47:06.611</startTime> <stopTime>2015-07-27T04:47:31.061</stopTime> <productType>OCN</productType> <missionId>S1A</missionId> <processingLevel>1</processingLevel> <mode>IW</mode> <absoluteOrbitNumber>6992</absoluteOrbitNumber> <orbitDirection>ASCENDING</orbitDirection> <s2takeid>38865</s2takeid> <cloudcover>0.0</cloudcover> <instrument>Multi-Spectral Instrument</instrument> <footprint>POLYGON ((-161.306549 21.163258,-158.915909 21.585093,-158.623169 20.077986,-160.989746 19.652864,-161.306549 21.163258))</footprint> </product> * * @param {DOMDocument} $dom : $dom DOMDocument */ private function parseNew($dom) { /* * Retrieves orbit direction */ $orbitDirection = strtolower($dom->getElementsByTagName('orbitDirection')->item(0)->nodeValue); $polygon = RestoGeometryUtil::WKTPolygonToArray($dom->getElementsByTagName('footprint')->item(0)->nodeValue); /* * Initialize feature */ $feature = array('type' => 'Feature', 'geometry' => array('type' => 'Polygon', 'coordinates' => array($polygon)), 'properties' => array('productIdentifier' => $dom->getElementsByTagName('title')->item(0)->nodeValue, 'title' => $dom->getElementsByTagName('title')->item(0)->nodeValue, 'resourceSize' => $dom->getElementsByTagName('resourceSize')->item(0)->nodeValue, 'authority' => 'ESA', 'startDate' => $dom->getElementsByTagName('startTime')->item(0)->nodeValue, 'completionDate' => $dom->getElementsByTagName('stopTime')->item(0)->nodeValue, 'productType' => $dom->getElementsByTagName('productType')->item(0)->nodeValue, 'processingLevel' => $dom->getElementsByTagName('processingLevel')->item(0)->nodeValue, 'platform' => $dom->getElementsByTagName('missionId')->item(0)->nodeValue, 'sensorMode' => $dom->getElementsByTagName('mode')->item(0)->nodeValue, 'orbitNumber' => $dom->getElementsByTagName('absoluteOrbitNumber')->item(0)->nodeValue, 'orbitDirection' => $orbitDirection, 'instrument' => $dom->getElementsByTagName('instrument')->item(0)->nodeValue, 'quicklook' => $this->getLocation($dom), 's2TakeId' => $dom->getElementsByTagName('s2takeid')->item(0)->nodeValue, 'cloudCover' => $dom->getElementsByTagName('cloudCover')->item(0)->nodeValue)); return $feature; }
/** * Create JSON feature from new resource xml string * * <product> <title>S1A_IW_OCN__2SDV_20150727T044706_20150727T044731_006992_0097D1_F6DA</title> <resourceSize>6317404</resourceSize> <startTime>2015-07-27T04:47:06.611</startTime> <stopTime>2015-07-27T04:47:31.061</stopTime> <productType>OCN</productType> <missionId>S1A</missionId> <processingLevel>2</processingLevel> <mode>IW</mode> <absoluteOrbitNumber>6992</absoluteOrbitNumber> <orbitDirection>ASCENDING</orbitDirection> <swath>IW</swath> <polarisation>VV VH</polarisation> <missiontakeid>38865</missiontakeid> <instrument>Multi-Spectral Instrument</instrument> <footprint>POLYGON ((-161.306549 21.163258,-158.915909 21.585093,-158.623169 20.077986,-160.989746 19.652864,-161.306549 21.163258))</footprint> </product> * * @param {DOMDocument} $dom : $dom DOMDocument */ private function parseNew($dom) { /* * Retreives orbit direction */ $orbitDirection = strtolower($dom->getElementsByTagName('orbitDirection')->item(0)->nodeValue); /* * Performs an inversion of the specified Sentinel-1 quicklooks footprint (inside the ZIP files, i.e SAFE product). * The datahub systematically performs an inversion of the Sentinel-1 quicklooks taking as input the quicklook images (.png) inside * the ZIP files (i.e. as produced by the S1 ground segment). */ $polygon = array($this->reorderSafeFootprintToDhus(RestoGeometryUtil::WKTPolygonToArray($dom->getElementsByTagName('footprint')->item(0)->nodeValue), $orbitDirection)); /* * Initialize feature */ $feature = array('type' => 'Feature', 'geometry' => array('type' => 'Polygon', 'coordinates' => $polygon), 'properties' => array('productIdentifier' => $dom->getElementsByTagName('title')->item(0)->nodeValue, 'title' => $dom->getElementsByTagName('title')->item(0)->nodeValue, 'resourceSize' => $dom->getElementsByTagName('resourceSize')->item(0)->nodeValue, 'authority' => 'ESA', 'startDate' => $dom->getElementsByTagName('startTime')->item(0)->nodeValue, 'completionDate' => $dom->getElementsByTagName('stopTime')->item(0)->nodeValue, 'productType' => $dom->getElementsByTagName('productType')->item(0)->nodeValue, 'processingLevel' => $dom->getElementsByTagName('processingLevel')->item(0)->nodeValue, 'platform' => $dom->getElementsByTagName('missionId')->item(0)->nodeValue, 'sensorMode' => $dom->getElementsByTagName('mode')->item(0)->nodeValue, 'orbitNumber' => $dom->getElementsByTagName('absoluteOrbitNumber')->item(0)->nodeValue, 'orbitDirection' => $orbitDirection, 'swath' => $dom->getElementsByTagName('swath')->item(0)->nodeValue, 'polarisation' => $dom->getElementsByTagName('polarisation')->item(0)->nodeValue, 'missionTakeId' => $dom->getElementsByTagName('missiontakeid')->item(0)->nodeValue, 'instrument' => $dom->getElementsByTagName('instrument')->item(0)->nodeValue, 'quicklook' => $this->getLocation($dom), 'cloudCover' => 0)); return $feature; }