Example #1
0
 /**
  * Add feature to collection 
  * 
  * @param RestoCollection $collection
  * @param array $data
  * 
  */
 private function addFeatureToCollection($collection, $data)
 {
     $feature = $collection->addFeature($data);
     /*
      * Store query
      */
     if ($this->context->storeQuery === true) {
         $this->user->storeQuery($this->context->method, 'insert', $collection->name, $feature->identifier, $this->context->query, $this->context->getUrl());
     }
     return RestoLogUtil::success('Feature ' . $feature->identifier . ' inserted within ' . $collection->name, array('featureIdentifier' => $feature->identifier));
 }
Example #2
0
 /**
  * @depends testCreateCollection
  * 
  */
 public function testInsertResource()
 {
     $this->initContext();
     $data = file_get_contents(dirname(__FILE__) . "/../data/Landsat.json");
     $data = json_decode($data, true);
     $collection = new RestoCollection($data['name'], $this->context, $this->admin, array('autoload' => true));
     $data = file_get_contents(dirname(__FILE__) . "/../data/LANDSAT5_TM_XS_20110520_N2A_France-MetropoleD0005H0003.xml");
     $collection->addFeature(array($data));
 }