@@ -206,6 +206,15 @@ private function processITagKeywords($iTagFeature)
206206 }
207207 break ;
208208
209+ case 'physical ' :
210+ $ catalogs [] = array (
211+ 'id ' => 'physical ' ,
212+ 'title ' => 'Physical ' ,
213+ 'description ' => 'Automatic physical classification processed by [iTag](https://github.com/jjrom/itag) '
214+ );
215+ $ catalogs = array_merge ($ catalogs , $ this ->getCatalogsFromPhysical ($ value , 'physical ' ));
216+ break ;
217+
209218 case 'landcover ' :
210219 $ catalogs [] = array (
211220 'id ' => 'landcover ' ,
@@ -314,6 +323,37 @@ private function getCatalogsFromLandCover($properties, $parentId)
314323 return $ catalogs ;
315324 }
316325
326+ /**
327+ * Get physical catalogs
328+ *
329+ * @param array $physicals
330+ * @param string $parentId
331+ */
332+ private function getCatalogsFromPhysical ($ physicals , $ parentId )
333+ {
334+ $ catalogs = array ();
335+
336+ /*
337+ * Main landcover
338+ */
339+ for ($ i = 0 , $ ii =count ($ physicals ); $ i < $ ii ; $ i ++) {
340+ $ exploded = explode (RestoConstants::TAG_SEPARATOR , $ physicals [$ i ]['id ' ]);
341+ $ type = $ exploded [0 ];
342+ $ id = $ parentId . '/ ' . $ type . 's ' ;
343+ if ( !$ this ->alreadyExists ($ catalogs , $ type ) ) {
344+ $ catalogs [] = array (
345+ 'id ' => $ id ,
346+ 'title ' => ucfirst ($ type ) . 's ' ,
347+ 'description ' => 'Automatic ' . $ type . ' classification processed by [iTag](https://github.com/jjrom/itag) ' ,
348+ 'rtype ' => $ type
349+ );
350+ }
351+ $ catalogs [] = $ this ->getCatalogFromGeneric ($ physicals [$ i ], $ id );
352+ }
353+
354+ return $ catalogs ;
355+ }
356+
317357 /**
318358 * Get generic keywords
319359 *
@@ -365,6 +405,7 @@ private function getCatalogFromGeneric($property, $parentId)
365405 $ catalog = array (
366406 'id ' => (isset ($ parentId ) ? $ parentId : '' ) . '/ ' . $ exploded [1 ],
367407 'title ' => $ property ['name ' ] ?? $ exploded [1 ],
408+ 'description ' => 'Catalog of features for ' . ($ property ['name ' ] ?? $ exploded [1 ]),
368409 'rtype ' => $ exploded [0 ],
369410 'hashtag ' => $ property ['id ' ]
370411 );
0 commit comments