@@ -9,6 +9,8 @@ let _initialized = false;
99// côté pipeline), pour pré-remplir le champ σ à la bonne valeur selon le provider.
1010let _resolutionM = 0.5 ;
1111const sigmaDefautM = ( ) => Math . round ( 15 * _resolutionM * 100 ) / 100 ;
12+ // Formate une résolution (m/px) pour affichage : virgule décimale en FR.
13+ const fmtRes = ( r ) => ( _lang === 'fr' ? String ( r ) . replace ( '.' , ',' ) : String ( r ) ) + ' m' ;
1214
1315// ── i18n ───────────────────────────────────────────────────────────────────────
1416// Pattern web standard : dico inline par locale + attribut data-i18n sur les
@@ -566,9 +568,12 @@ function buildProviders(providers, activeCode) {
566568 applyProviderCountry ( 'fr' ) ;
567569 return ;
568570 }
569- sel . innerHTML = providers . map ( p =>
570- `<option value="${ p . code } " data-country="${ p . country } " data-apikey-requise="${ p . apikey_requise ?1 :0 } " data-res="${ p . resolution_m ?? 0.5 } ">${ p . name } </option>`
571- ) . join ( '' ) ;
571+ sel . innerHTML = providers . map ( p => {
572+ // Résolution déjà dans le nom officiel (ex. "DEM 5m", "50 cm") ? Ne pas la dupliquer.
573+ const hasRes = / \d [ \d . , ] * \s ? ( m | c m ) \b / i. test ( p . name ) ;
574+ const label = hasRes ? p . name : `${ p . name } (${ fmtRes ( p . resolution_m ?? 0.5 ) } )` ;
575+ return `<option value="${ p . code } " data-country="${ p . country } " data-apikey-requise="${ p . apikey_requise ?1 :0 } " data-res="${ p . resolution_m ?? 0.5 } ">${ label } </option>` ;
576+ } ) . join ( '' ) ;
572577 sel . value = activeCode ;
573578 const opt = sel . options [ sel . selectedIndex ] ;
574579 const country = ( opt && opt . dataset . country ) || 'fr' ;
@@ -1346,9 +1351,11 @@ function loadConfig(cfg) {
13461351// Chaque instance = {type, params}. Plusieurs instances du même type avec des
13471352// params différents coexistent (les params sont encodés dans le nom de fichier
13481353// côté pipeline). Émission CLI : --shading TYPE:k=v,... (répétable).
1349- // Ordre = utilité archéo décroissante (cf. _SHADING_TYPES côté pipeline) :
1350- // composite VAT, SVF, paire openness, LRM/RRIM, hillshades, slope en dernier.
1354+ // Ordre = utilité pratique (cf. _SHADING_TYPES côté pipeline) : LRM en tête
1355+ // (rapide + lisible pour un néophyte, donc défaut), puis VAT (détecteur complet),
1356+ // SVF, paire openness, RRIM, hillshades, slope en dernier.
13511357const OMB_DEFS = {
1358+ lrm : { label :'LRM' , fields :{ sigma :{ lbl :'omb.sigma' , tip :'tip.ombsigma' , def :'' , min :1 , max :100 , step :0.5 , opt :true } } } ,
13521359 vat : { label :'VAT (composite)' , fields :{ dist :{ lbl :'distance (m)' , def :20 , min :10 , max :200 , step :5 } ,
13531360 gamma :{ lbl :'omb.gamma' , def :2.0 , min :0.3 , max :3.0 , step :0.1 } } } ,
13541361 svf : { label :'SVF' , fields :{ conv :{ lbl :'type' , def :'flux' , opts :[ 'flux' , 'rvt' ] } ,
@@ -1359,7 +1366,6 @@ const OMB_DEFS = {
13591366 gamma :{ lbl :'omb.gamma' , def :2.0 , min :0.3 , max :3.0 , step :0.1 } } } ,
13601367 oneg : { label :'O− openness' , fields :{ dist :{ lbl :'distance (m)' , def :20 , min :10 , max :200 , step :5 } ,
13611368 gamma :{ lbl :'omb.gamma.mirror' , def :2.0 , min :0.3 , max :3.0 , step :0.1 } } } ,
1362- lrm : { label :'LRM' , fields :{ sigma :{ lbl :'omb.sigma' , tip :'tip.ombsigma' , def :'' , min :1 , max :100 , step :0.5 , opt :true } } } ,
13631369 rrim : { label :'RRIM' , fields :{ sigma :{ lbl :'omb.sigma' , tip :'tip.ombsigma' , def :'' , min :1 , max :100 , step :0.5 , opt :true } } } ,
13641370 multi : { label :'multi' , fields :{ elevation :{ lbl :'☀ élévation (°)' , def :25 , min :5 , max :60 , step :1 } } } ,
13651371 '315' : { label :'315°' , fields :{ elevation :{ lbl :'☀ élévation (°)' , def :25 , min :5 , max :60 , step :1 } } } ,
@@ -1368,7 +1374,7 @@ const OMB_DEFS = {
13681374 '225' : { label :'225°' , fields :{ elevation :{ lbl :'☀ élévation (°)' , def :25 , min :5 , max :60 , step :1 } } } ,
13691375 slope : { label :'slope' , fields :{ } } ,
13701376} ;
1371- let ombInstances = [ { type :'vat ' , params :{ dist : 20 , gamma : 2.0 } } ] ; // défaut = VAT (meilleure visu archéo )
1377+ let ombInstances = [ { type :'lrm ' , params :{ sigma : sigmaDefautM ( ) } } ] ; // défaut = LRM (rapide + lisible )
13721378
13731379function ombLabel ( inst ) {
13741380 const d = OMB_DEFS [ inst . type ] ; if ( ! d ) return inst . type ;
0 commit comments