more types
This commit is contained in:
parent
8562758358
commit
a4af49388d
@ -8,6 +8,7 @@ import mappingConfigIRVE_simple from './mappings/converters/mappingConfigIRVE_si
|
||||
import mapping_engine from './mappings/engine'
|
||||
import MappingConfigType, {BoundingBoxCoordinatesType, FeatureCollection} from "./mappings/mapping-config.type";
|
||||
import utils from './mappings/utils'
|
||||
|
||||
const minimist = require('minimist')
|
||||
|
||||
const debugLog = utils.debugLog;
|
||||
@ -58,19 +59,19 @@ if (enable_filter_on_department) {
|
||||
} else if (filterOnBoundingBox) {
|
||||
filteredName = '_filtered_bbox_' + boundingBoxCoordinates.xMin + '-' + boundingBoxCoordinates.xMax + '_' + boundingBoxCoordinates.yMin + '-' + boundingBoxCoordinates.yMax
|
||||
}
|
||||
let pointCounterMax :number = 1000000
|
||||
let pointCounterMax: number = 1000000
|
||||
|
||||
let limitConversionToFirstPoint :boolean = false
|
||||
let limitConversionToFirstPoint: boolean = false
|
||||
// limitConversionToFirstPoint = true
|
||||
|
||||
if (limitConversionToFirstPoint) {
|
||||
pointCounterMax = 1
|
||||
}
|
||||
let defaultPropertiesOfPoint :any= {
|
||||
let defaultPropertiesOfPoint: any = {
|
||||
'amenity': 'charging_station'
|
||||
}
|
||||
|
||||
let converted_geo_json :any = {
|
||||
let converted_geo_json: any = {
|
||||
type: 'FeatureCollection',
|
||||
features: []
|
||||
}
|
||||
@ -99,7 +100,7 @@ function convertDataForIRVE(sourceFilePath: string, mapping: MappingConfigType,
|
||||
debugLog('data found, features:', data_transformed.features.length)
|
||||
|
||||
// find interesting list of points to use
|
||||
let list_of_points : any = data_transformed.features
|
||||
let list_of_points: any = data_transformed.features
|
||||
// for each point from the data source, convert with the mapping
|
||||
|
||||
console.log('listOfPoints.length', list_of_points.length)
|
||||
@ -114,8 +115,7 @@ function convertDataForIRVE(sourceFilePath: string, mapping: MappingConfigType,
|
||||
||
|
||||
filterZipCodeAdresse.test(feature_point.properties.adresse_station)
|
||||
)
|
||||
}
|
||||
else if (filterOnBoundingBox) {
|
||||
} else if (filterOnBoundingBox) {
|
||||
debugLog('filtre sur les coordonnées activé')
|
||||
|
||||
let x = feature_point.properties.coordonneesXY[0]
|
||||
@ -184,7 +184,7 @@ function mapElementFromConfSimple(featurePoint: any, mappingConfig: MappingConfi
|
||||
|
||||
debugLog('keys', mappingKeys, featurePointPropertiesKeys)
|
||||
|
||||
let newProperties :any = defaultPropertiesOfPoint
|
||||
let newProperties: any = defaultPropertiesOfPoint
|
||||
|
||||
// reinit properties of current point
|
||||
let basePoint = Object.create(featurePoint)
|
||||
@ -196,7 +196,7 @@ function mapElementFromConfSimple(featurePoint: any, mappingConfig: MappingConfi
|
||||
featurePointPropertiesKeys.forEach((pointKeyName: string) => {
|
||||
|
||||
if (mappingKeys.indexOf(pointKeyName) !== -1) {
|
||||
debugLog('found element', pointKeyName, '=>', mappingConfig[pointKeyName], 'value : ', featurePoint.properties[pointKeyName])
|
||||
// debugLog('found element', pointKeyName, '=>', mappingConfig[pointKeyName], 'value : ', featurePoint.properties[pointKeyName])
|
||||
let convertedValue: any = ''
|
||||
if (utils.isBooleanKey(pointKeyName)) {
|
||||
|
||||
|
@ -1,49 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<coverage generated="1691225815979" clover="3.2.0">
|
||||
<project timestamp="1691225815979" name="All files">
|
||||
<metrics statements="305" coveredstatements="157" conditionals="12" coveredconditionals="7" methods="13" coveredmethods="6" elements="330" coveredelements="170" complexity="0" loc="305" ncloc="305" packages="2" files="3" classes="3"/>
|
||||
<package name="data_other.testing">
|
||||
<metrics statements="34" coveredstatements="34" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
|
||||
<file name="mappings_to_test.ts" path="/home/poule/encrypted/stockage-syncable/www/development/html/scripts/mapping_geojson_to_osm_tags/data_other/testing/mappings_to_test.ts">
|
||||
<metrics statements="34" coveredstatements="34" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
|
||||
<line num="1" count="1" type="stmt"/>
|
||||
<line num="2" count="1" type="stmt"/>
|
||||
<line num="3" count="1" type="stmt"/>
|
||||
<line num="4" count="1" type="stmt"/>
|
||||
<line num="5" count="1" type="stmt"/>
|
||||
<line num="6" count="1" type="stmt"/>
|
||||
<line num="7" count="1" type="stmt"/>
|
||||
<line num="8" count="1" type="stmt"/>
|
||||
<line num="9" count="1" type="stmt"/>
|
||||
<line num="10" count="1" type="stmt"/>
|
||||
<line num="11" count="1" type="stmt"/>
|
||||
<line num="12" count="1" type="stmt"/>
|
||||
<line num="13" count="1" type="stmt"/>
|
||||
<line num="14" count="1" type="stmt"/>
|
||||
<line num="15" count="1" type="stmt"/>
|
||||
<line num="16" count="1" type="stmt"/>
|
||||
<line num="17" count="1" type="stmt"/>
|
||||
<line num="18" count="1" type="stmt"/>
|
||||
<line num="19" count="1" type="stmt"/>
|
||||
<line num="20" count="1" type="stmt"/>
|
||||
<line num="21" count="1" type="stmt"/>
|
||||
<line num="22" count="1" type="stmt"/>
|
||||
<line num="23" count="1" type="stmt"/>
|
||||
<line num="24" count="1" type="stmt"/>
|
||||
<line num="25" count="1" type="stmt"/>
|
||||
<line num="26" count="1" type="stmt"/>
|
||||
<line num="27" count="1" type="stmt"/>
|
||||
<line num="28" count="1" type="stmt"/>
|
||||
<line num="29" count="1" type="stmt"/>
|
||||
<line num="30" count="1" type="stmt"/>
|
||||
<line num="31" count="1" type="stmt"/>
|
||||
<line num="32" count="1" type="stmt"/>
|
||||
<line num="33" count="1" type="stmt"/>
|
||||
<line num="34" count="1" type="stmt"/>
|
||||
</file>
|
||||
</package>
|
||||
<package name="mappings">
|
||||
<metrics statements="271" coveredstatements="123" conditionals="12" coveredconditionals="7" methods="13" coveredmethods="6"/>
|
||||
<coverage generated="1691225984915" clover="3.2.0">
|
||||
<project timestamp="1691225984915" name="All files">
|
||||
<metrics statements="203" coveredstatements="76" conditionals="6" coveredconditionals="4" methods="9" coveredmethods="4" elements="218" coveredelements="84" complexity="0" loc="203" ncloc="203" packages="1" files="1" classes="1"/>
|
||||
<file name="engine.ts" path="/home/poule/encrypted/stockage-syncable/www/development/html/scripts/mapping_geojson_to_osm_tags/mappings/engine.ts">
|
||||
<metrics statements="203" coveredstatements="76" conditionals="6" coveredconditionals="4" methods="9" coveredmethods="4"/>
|
||||
<line num="1" count="1" type="stmt"/>
|
||||
@ -250,77 +208,5 @@
|
||||
<line num="202" count="1" type="stmt"/>
|
||||
<line num="203" count="1" type="stmt"/>
|
||||
</file>
|
||||
<file name="utils.js" path="/home/poule/encrypted/stockage-syncable/www/development/html/scripts/mapping_geojson_to_osm_tags/mappings/utils.js">
|
||||
<metrics statements="68" coveredstatements="47" conditionals="6" coveredconditionals="3" methods="4" coveredmethods="2"/>
|
||||
<line num="1" count="1" type="stmt"/>
|
||||
<line num="2" count="1" type="cond" truecount="1" falsecount="1"/>
|
||||
<line num="3" count="3" type="cond" truecount="0" falsecount="1"/>
|
||||
<line num="4" count="0" type="stmt"/>
|
||||
<line num="5" count="0" type="stmt"/>
|
||||
<line num="6" count="0" type="stmt"/>
|
||||
<line num="7" count="0" type="stmt"/>
|
||||
<line num="8" count="0" type="stmt"/>
|
||||
<line num="9" count="3" type="stmt"/>
|
||||
<line num="10" count="3" type="stmt"/>
|
||||
<line num="11" count="1" type="stmt"/>
|
||||
<line num="12" count="1" type="stmt"/>
|
||||
<line num="13" count="1" type="stmt"/>
|
||||
<line num="14" count="1" type="stmt"/>
|
||||
<line num="15" count="1" type="stmt"/>
|
||||
<line num="16" count="1" type="stmt"/>
|
||||
<line num="17" count="1" type="stmt"/>
|
||||
<line num="18" count="1" type="stmt"/>
|
||||
<line num="19" count="1" type="stmt"/>
|
||||
<line num="20" count="3" type="cond" truecount="1" falsecount="0"/>
|
||||
<line num="21" count="3" type="stmt"/>
|
||||
<line num="22" count="3" type="cond" truecount="1" falsecount="0"/>
|
||||
<line num="23" count="8" type="stmt"/>
|
||||
<line num="24" count="8" type="stmt"/>
|
||||
<line num="25" count="3" type="cond" truecount="0" falsecount="1"/>
|
||||
<line num="26" count="0" type="stmt"/>
|
||||
<line num="27" count="0" type="stmt"/>
|
||||
<line num="28" count="3" type="stmt"/>
|
||||
<line num="29" count="3" type="stmt"/>
|
||||
<line num="30" count="1" type="stmt"/>
|
||||
<line num="31" count="1" type="stmt"/>
|
||||
<line num="32" count="1" type="stmt"/>
|
||||
<line num="33" count="1" type="stmt"/>
|
||||
<line num="34" count="1" type="stmt"/>
|
||||
<line num="35" count="1" type="stmt"/>
|
||||
<line num="36" count="1" type="stmt"/>
|
||||
<line num="37" count="1" type="stmt"/>
|
||||
<line num="38" count="1" type="stmt"/>
|
||||
<line num="39" count="1" type="stmt"/>
|
||||
<line num="40" count="1" type="stmt"/>
|
||||
<line num="41" count="1" type="stmt"/>
|
||||
<line num="42" count="1" type="stmt"/>
|
||||
<line num="43" count="1" type="stmt"/>
|
||||
<line num="44" count="1" type="stmt"/>
|
||||
<line num="45" count="0" type="stmt"/>
|
||||
<line num="46" count="0" type="stmt"/>
|
||||
<line num="47" count="0" type="stmt"/>
|
||||
<line num="48" count="1" type="stmt"/>
|
||||
<line num="49" count="1" type="stmt"/>
|
||||
<line num="50" count="1" type="stmt"/>
|
||||
<line num="51" count="1" type="stmt"/>
|
||||
<line num="52" count="1" type="stmt"/>
|
||||
<line num="53" count="0" type="stmt"/>
|
||||
<line num="54" count="0" type="stmt"/>
|
||||
<line num="55" count="0" type="stmt"/>
|
||||
<line num="56" count="0" type="stmt"/>
|
||||
<line num="57" count="0" type="stmt"/>
|
||||
<line num="58" count="0" type="stmt"/>
|
||||
<line num="59" count="0" type="stmt"/>
|
||||
<line num="60" count="0" type="stmt"/>
|
||||
<line num="61" count="0" type="stmt"/>
|
||||
<line num="62" count="0" type="stmt"/>
|
||||
<line num="63" count="0" type="stmt"/>
|
||||
<line num="64" count="1" type="stmt"/>
|
||||
<line num="65" count="1" type="stmt"/>
|
||||
<line num="66" count="1" type="stmt"/>
|
||||
<line num="67" count="1" type="stmt"/>
|
||||
<line num="68" count="1" type="stmt"/>
|
||||
</file>
|
||||
</package>
|
||||
</project>
|
||||
</coverage>
|
||||
|
File diff suppressed because one or more lines are too long
691
mapping_geojson_to_osm_tags/coverage/lcov-report/engine.ts.html
Normal file
691
mapping_geojson_to_osm_tags/coverage/lcov-report/engine.ts.html
Normal file
@ -0,0 +1,691 @@
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>Code coverage report for engine.ts</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="prettify.css" />
|
||||
<link rel="stylesheet" href="base.css" />
|
||||
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1><a href="index.html">All files</a> engine.ts</h1>
|
||||
<div class='clearfix'>
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">37.43% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>76/203</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">66.66% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>4/6</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">44.44% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>4/9</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">37.43% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>76/203</span>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
<template id="filterTemplate">
|
||||
<div class="quiet">
|
||||
Filter:
|
||||
<input oninput="onInput()" type="search" id="fileSearch">
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class='status-line low'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a>
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a>
|
||||
<a name='L13'></a><a href='#L13'>13</a>
|
||||
<a name='L14'></a><a href='#L14'>14</a>
|
||||
<a name='L15'></a><a href='#L15'>15</a>
|
||||
<a name='L16'></a><a href='#L16'>16</a>
|
||||
<a name='L17'></a><a href='#L17'>17</a>
|
||||
<a name='L18'></a><a href='#L18'>18</a>
|
||||
<a name='L19'></a><a href='#L19'>19</a>
|
||||
<a name='L20'></a><a href='#L20'>20</a>
|
||||
<a name='L21'></a><a href='#L21'>21</a>
|
||||
<a name='L22'></a><a href='#L22'>22</a>
|
||||
<a name='L23'></a><a href='#L23'>23</a>
|
||||
<a name='L24'></a><a href='#L24'>24</a>
|
||||
<a name='L25'></a><a href='#L25'>25</a>
|
||||
<a name='L26'></a><a href='#L26'>26</a>
|
||||
<a name='L27'></a><a href='#L27'>27</a>
|
||||
<a name='L28'></a><a href='#L28'>28</a>
|
||||
<a name='L29'></a><a href='#L29'>29</a>
|
||||
<a name='L30'></a><a href='#L30'>30</a>
|
||||
<a name='L31'></a><a href='#L31'>31</a>
|
||||
<a name='L32'></a><a href='#L32'>32</a>
|
||||
<a name='L33'></a><a href='#L33'>33</a>
|
||||
<a name='L34'></a><a href='#L34'>34</a>
|
||||
<a name='L35'></a><a href='#L35'>35</a>
|
||||
<a name='L36'></a><a href='#L36'>36</a>
|
||||
<a name='L37'></a><a href='#L37'>37</a>
|
||||
<a name='L38'></a><a href='#L38'>38</a>
|
||||
<a name='L39'></a><a href='#L39'>39</a>
|
||||
<a name='L40'></a><a href='#L40'>40</a>
|
||||
<a name='L41'></a><a href='#L41'>41</a>
|
||||
<a name='L42'></a><a href='#L42'>42</a>
|
||||
<a name='L43'></a><a href='#L43'>43</a>
|
||||
<a name='L44'></a><a href='#L44'>44</a>
|
||||
<a name='L45'></a><a href='#L45'>45</a>
|
||||
<a name='L46'></a><a href='#L46'>46</a>
|
||||
<a name='L47'></a><a href='#L47'>47</a>
|
||||
<a name='L48'></a><a href='#L48'>48</a>
|
||||
<a name='L49'></a><a href='#L49'>49</a>
|
||||
<a name='L50'></a><a href='#L50'>50</a>
|
||||
<a name='L51'></a><a href='#L51'>51</a>
|
||||
<a name='L52'></a><a href='#L52'>52</a>
|
||||
<a name='L53'></a><a href='#L53'>53</a>
|
||||
<a name='L54'></a><a href='#L54'>54</a>
|
||||
<a name='L55'></a><a href='#L55'>55</a>
|
||||
<a name='L56'></a><a href='#L56'>56</a>
|
||||
<a name='L57'></a><a href='#L57'>57</a>
|
||||
<a name='L58'></a><a href='#L58'>58</a>
|
||||
<a name='L59'></a><a href='#L59'>59</a>
|
||||
<a name='L60'></a><a href='#L60'>60</a>
|
||||
<a name='L61'></a><a href='#L61'>61</a>
|
||||
<a name='L62'></a><a href='#L62'>62</a>
|
||||
<a name='L63'></a><a href='#L63'>63</a>
|
||||
<a name='L64'></a><a href='#L64'>64</a>
|
||||
<a name='L65'></a><a href='#L65'>65</a>
|
||||
<a name='L66'></a><a href='#L66'>66</a>
|
||||
<a name='L67'></a><a href='#L67'>67</a>
|
||||
<a name='L68'></a><a href='#L68'>68</a>
|
||||
<a name='L69'></a><a href='#L69'>69</a>
|
||||
<a name='L70'></a><a href='#L70'>70</a>
|
||||
<a name='L71'></a><a href='#L71'>71</a>
|
||||
<a name='L72'></a><a href='#L72'>72</a>
|
||||
<a name='L73'></a><a href='#L73'>73</a>
|
||||
<a name='L74'></a><a href='#L74'>74</a>
|
||||
<a name='L75'></a><a href='#L75'>75</a>
|
||||
<a name='L76'></a><a href='#L76'>76</a>
|
||||
<a name='L77'></a><a href='#L77'>77</a>
|
||||
<a name='L78'></a><a href='#L78'>78</a>
|
||||
<a name='L79'></a><a href='#L79'>79</a>
|
||||
<a name='L80'></a><a href='#L80'>80</a>
|
||||
<a name='L81'></a><a href='#L81'>81</a>
|
||||
<a name='L82'></a><a href='#L82'>82</a>
|
||||
<a name='L83'></a><a href='#L83'>83</a>
|
||||
<a name='L84'></a><a href='#L84'>84</a>
|
||||
<a name='L85'></a><a href='#L85'>85</a>
|
||||
<a name='L86'></a><a href='#L86'>86</a>
|
||||
<a name='L87'></a><a href='#L87'>87</a>
|
||||
<a name='L88'></a><a href='#L88'>88</a>
|
||||
<a name='L89'></a><a href='#L89'>89</a>
|
||||
<a name='L90'></a><a href='#L90'>90</a>
|
||||
<a name='L91'></a><a href='#L91'>91</a>
|
||||
<a name='L92'></a><a href='#L92'>92</a>
|
||||
<a name='L93'></a><a href='#L93'>93</a>
|
||||
<a name='L94'></a><a href='#L94'>94</a>
|
||||
<a name='L95'></a><a href='#L95'>95</a>
|
||||
<a name='L96'></a><a href='#L96'>96</a>
|
||||
<a name='L97'></a><a href='#L97'>97</a>
|
||||
<a name='L98'></a><a href='#L98'>98</a>
|
||||
<a name='L99'></a><a href='#L99'>99</a>
|
||||
<a name='L100'></a><a href='#L100'>100</a>
|
||||
<a name='L101'></a><a href='#L101'>101</a>
|
||||
<a name='L102'></a><a href='#L102'>102</a>
|
||||
<a name='L103'></a><a href='#L103'>103</a>
|
||||
<a name='L104'></a><a href='#L104'>104</a>
|
||||
<a name='L105'></a><a href='#L105'>105</a>
|
||||
<a name='L106'></a><a href='#L106'>106</a>
|
||||
<a name='L107'></a><a href='#L107'>107</a>
|
||||
<a name='L108'></a><a href='#L108'>108</a>
|
||||
<a name='L109'></a><a href='#L109'>109</a>
|
||||
<a name='L110'></a><a href='#L110'>110</a>
|
||||
<a name='L111'></a><a href='#L111'>111</a>
|
||||
<a name='L112'></a><a href='#L112'>112</a>
|
||||
<a name='L113'></a><a href='#L113'>113</a>
|
||||
<a name='L114'></a><a href='#L114'>114</a>
|
||||
<a name='L115'></a><a href='#L115'>115</a>
|
||||
<a name='L116'></a><a href='#L116'>116</a>
|
||||
<a name='L117'></a><a href='#L117'>117</a>
|
||||
<a name='L118'></a><a href='#L118'>118</a>
|
||||
<a name='L119'></a><a href='#L119'>119</a>
|
||||
<a name='L120'></a><a href='#L120'>120</a>
|
||||
<a name='L121'></a><a href='#L121'>121</a>
|
||||
<a name='L122'></a><a href='#L122'>122</a>
|
||||
<a name='L123'></a><a href='#L123'>123</a>
|
||||
<a name='L124'></a><a href='#L124'>124</a>
|
||||
<a name='L125'></a><a href='#L125'>125</a>
|
||||
<a name='L126'></a><a href='#L126'>126</a>
|
||||
<a name='L127'></a><a href='#L127'>127</a>
|
||||
<a name='L128'></a><a href='#L128'>128</a>
|
||||
<a name='L129'></a><a href='#L129'>129</a>
|
||||
<a name='L130'></a><a href='#L130'>130</a>
|
||||
<a name='L131'></a><a href='#L131'>131</a>
|
||||
<a name='L132'></a><a href='#L132'>132</a>
|
||||
<a name='L133'></a><a href='#L133'>133</a>
|
||||
<a name='L134'></a><a href='#L134'>134</a>
|
||||
<a name='L135'></a><a href='#L135'>135</a>
|
||||
<a name='L136'></a><a href='#L136'>136</a>
|
||||
<a name='L137'></a><a href='#L137'>137</a>
|
||||
<a name='L138'></a><a href='#L138'>138</a>
|
||||
<a name='L139'></a><a href='#L139'>139</a>
|
||||
<a name='L140'></a><a href='#L140'>140</a>
|
||||
<a name='L141'></a><a href='#L141'>141</a>
|
||||
<a name='L142'></a><a href='#L142'>142</a>
|
||||
<a name='L143'></a><a href='#L143'>143</a>
|
||||
<a name='L144'></a><a href='#L144'>144</a>
|
||||
<a name='L145'></a><a href='#L145'>145</a>
|
||||
<a name='L146'></a><a href='#L146'>146</a>
|
||||
<a name='L147'></a><a href='#L147'>147</a>
|
||||
<a name='L148'></a><a href='#L148'>148</a>
|
||||
<a name='L149'></a><a href='#L149'>149</a>
|
||||
<a name='L150'></a><a href='#L150'>150</a>
|
||||
<a name='L151'></a><a href='#L151'>151</a>
|
||||
<a name='L152'></a><a href='#L152'>152</a>
|
||||
<a name='L153'></a><a href='#L153'>153</a>
|
||||
<a name='L154'></a><a href='#L154'>154</a>
|
||||
<a name='L155'></a><a href='#L155'>155</a>
|
||||
<a name='L156'></a><a href='#L156'>156</a>
|
||||
<a name='L157'></a><a href='#L157'>157</a>
|
||||
<a name='L158'></a><a href='#L158'>158</a>
|
||||
<a name='L159'></a><a href='#L159'>159</a>
|
||||
<a name='L160'></a><a href='#L160'>160</a>
|
||||
<a name='L161'></a><a href='#L161'>161</a>
|
||||
<a name='L162'></a><a href='#L162'>162</a>
|
||||
<a name='L163'></a><a href='#L163'>163</a>
|
||||
<a name='L164'></a><a href='#L164'>164</a>
|
||||
<a name='L165'></a><a href='#L165'>165</a>
|
||||
<a name='L166'></a><a href='#L166'>166</a>
|
||||
<a name='L167'></a><a href='#L167'>167</a>
|
||||
<a name='L168'></a><a href='#L168'>168</a>
|
||||
<a name='L169'></a><a href='#L169'>169</a>
|
||||
<a name='L170'></a><a href='#L170'>170</a>
|
||||
<a name='L171'></a><a href='#L171'>171</a>
|
||||
<a name='L172'></a><a href='#L172'>172</a>
|
||||
<a name='L173'></a><a href='#L173'>173</a>
|
||||
<a name='L174'></a><a href='#L174'>174</a>
|
||||
<a name='L175'></a><a href='#L175'>175</a>
|
||||
<a name='L176'></a><a href='#L176'>176</a>
|
||||
<a name='L177'></a><a href='#L177'>177</a>
|
||||
<a name='L178'></a><a href='#L178'>178</a>
|
||||
<a name='L179'></a><a href='#L179'>179</a>
|
||||
<a name='L180'></a><a href='#L180'>180</a>
|
||||
<a name='L181'></a><a href='#L181'>181</a>
|
||||
<a name='L182'></a><a href='#L182'>182</a>
|
||||
<a name='L183'></a><a href='#L183'>183</a>
|
||||
<a name='L184'></a><a href='#L184'>184</a>
|
||||
<a name='L185'></a><a href='#L185'>185</a>
|
||||
<a name='L186'></a><a href='#L186'>186</a>
|
||||
<a name='L187'></a><a href='#L187'>187</a>
|
||||
<a name='L188'></a><a href='#L188'>188</a>
|
||||
<a name='L189'></a><a href='#L189'>189</a>
|
||||
<a name='L190'></a><a href='#L190'>190</a>
|
||||
<a name='L191'></a><a href='#L191'>191</a>
|
||||
<a name='L192'></a><a href='#L192'>192</a>
|
||||
<a name='L193'></a><a href='#L193'>193</a>
|
||||
<a name='L194'></a><a href='#L194'>194</a>
|
||||
<a name='L195'></a><a href='#L195'>195</a>
|
||||
<a name='L196'></a><a href='#L196'>196</a>
|
||||
<a name='L197'></a><a href='#L197'>197</a>
|
||||
<a name='L198'></a><a href='#L198'>198</a>
|
||||
<a name='L199'></a><a href='#L199'>199</a>
|
||||
<a name='L200'></a><a href='#L200'>200</a>
|
||||
<a name='L201'></a><a href='#L201'>201</a>
|
||||
<a name='L202'></a><a href='#L202'>202</a>
|
||||
<a name='L203'></a><a href='#L203'>203</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-no"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-yes">1x</span></td><td class="text"><pre class="prettyprint lang-js">import custom_utils from './utils'
|
||||
|
||||
const {debugLog} = custom_utils
|
||||
|
||||
let listOfBooleanKeys = [
|
||||
"prise_type_ef",
|
||||
"prise_type_2",
|
||||
"prise_type_combo_ccs",
|
||||
"prise_type_chademo",
|
||||
"gratuit",
|
||||
"paiement_acte",
|
||||
"paiement_cb",
|
||||
"cable_t2_attache"
|
||||
]
|
||||
|
||||
export default class {
|
||||
mapping_config: any = {}
|
||||
|
||||
constructor(mappingConfig) {
|
||||
this.setConfig(mappingConfig)
|
||||
}
|
||||
|
||||
setConfig(mappingConfig) {
|
||||
this.mapping_config = mappingConfig
|
||||
}
|
||||
|
||||
<span class="fstat-no" title="function not covered" > mapFeaturePoint(featurePointGeoJson) {</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > let geoJSONConvertedPoint: any = {}</span>
|
||||
<span class="cstat-no" title="statement not covered" > geoJSONConvertedPoint.properties = {...this.mapping_config.default_properties_of_point}</span>
|
||||
<span class="cstat-no" title="statement not covered" > geoJSONConvertedPoint.type = featurePointGeoJson.type</span>
|
||||
<span class="cstat-no" title="statement not covered" > geoJSONConvertedPoint.geometry = featurePointGeoJson.geometry</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > let props = featurePointGeoJson.properties</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > props.forEach((key, value) => {</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > })</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > return geoJSONConvertedPoint</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
|
||||
/**
|
||||
* TODO convert to mapping config property to transform_truthy
|
||||
* @param pointKeyName
|
||||
* @returns {boolean}
|
||||
*/
|
||||
<span class="fstat-no" title="function not covered" > isBooleanKey(pointKeyName): boolean {</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > return listOfBooleanKeys.indexOf(pointKeyName) !== -1</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
|
||||
truthyValues = ['true', 'True', 'TRUE', '1', 1]
|
||||
falsyValues = ['false', 'False', 'FALSE', '0', 0]
|
||||
|
||||
/**
|
||||
* reduce number of features
|
||||
* @param offsetCount
|
||||
* @param listOfFeatures
|
||||
*/
|
||||
<span class="fstat-no" title="function not covered" > filterFeaturesByOffset(offsetCount: number, listOfFeatures): Array<any> {</span>
|
||||
<span class="cstat-no" title="statement not covered" > let filteredList = listOfFeatures</span>
|
||||
<span class="cstat-no" title="statement not covered" > // TODO</span>
|
||||
<span class="cstat-no" title="statement not covered" > return filteredList</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
|
||||
// filterFeaturesByPropertyRegex(bboxConfig, listOfFeatures) {
|
||||
// console.log('bboxConfig', bboxConfig)
|
||||
// let filteredList = listOfFeatures
|
||||
// // TODO
|
||||
// return filteredList
|
||||
// }
|
||||
|
||||
<span class="fstat-no" title="function not covered" > filterFeaturesByPropertyRegex(propertyName, criteriaRegex, listOfFeatures) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > let filteredList = listOfFeatures.filter(feature => {</span>
|
||||
<span class="cstat-no" title="statement not covered" > return criteriaRegex.test(feature?.properties[propertyName])</span>
|
||||
<span class="cstat-no" title="statement not covered" > })</span>
|
||||
<span class="cstat-no" title="statement not covered" > return filteredList</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
|
||||
/**
|
||||
* retuns the converted element from mapping config if present, null otherwise
|
||||
*/
|
||||
mapElementFromConf(featurePoint: any) {
|
||||
if (!this.mapping_config) <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
||||
<span class="cstat-no" title="statement not covered" > throw new Error('no config was loaded in the mapping engine. use setConfig(my_mapping_config) on this instance of mapping engine before using this.')</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
|
||||
console.log('mapping_config tags', this.mapping_config.tags)
|
||||
debugLog('config_name', this.mapping_config.config_name)
|
||||
let mappingKeys = Object.keys(this.mapping_config.tags)
|
||||
// let mappingKeys = (this.mapping_config.tags)
|
||||
let featurePointPropertiesKeys = Object.keys(featurePoint.properties)
|
||||
|
||||
debugLog('============= keys mappingKeys:', this.mapping_config.tags.length, mappingKeys.length)
|
||||
debugLog('============= keys featurePointPropertiesKeys :', featurePoint.properties.length, featurePointPropertiesKeys.length)
|
||||
|
||||
let newProperties = Object.create(this.mapping_config.default_properties_of_point)
|
||||
|
||||
<span class="branch-0 cbranch-no" title="branch not covered" > return;</span>
|
||||
<span class="cstat-no" title="statement not covered" > // reinit properties of current point</span>
|
||||
<span class="cstat-no" title="statement not covered" > let basePoint = Object.create(featurePoint)</span>
|
||||
<span class="cstat-no" title="statement not covered" > basePoint.type = featurePoint.type</span>
|
||||
<span class="cstat-no" title="statement not covered" > basePoint.geometry = featurePoint.geometry</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > // apply new properties if found in mapping config</span>
|
||||
<span class="cstat-no" title="statement not covered" > featurePointPropertiesKeys.forEach(pointKeyName => {</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > this.convertProperty(pointKeyName, mappingKeys, featurePoint, newProperties)</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > })</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > basePoint.properties = newProperties</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > debugLog('basePoint', basePoint)</span>
|
||||
<span class="cstat-no" title="statement not covered" > return basePoint</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
|
||||
<span class="fstat-no" title="function not covered" > convertProperty(pointKeyName, mappingKeys, featurePoint, newProperties) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > console.log('pointKeyName', pointKeyName)</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (!mappingKeys.indexOf(pointKeyName) !== -1) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > // debugLog('found element', pointKeyName, '=>', this.mapping_config[pointKeyName], 'value : ', featurePoint.properties[pointKeyName])</span>
|
||||
<span class="cstat-no" title="statement not covered" > let convertedValue = ''</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > let valueConvertedFromMapping = featurePoint.properties[pointKeyName]</span>
|
||||
<span class="cstat-no" title="statement not covered" > let typeofValue = typeof valueConvertedFromMapping</span>
|
||||
<span class="cstat-no" title="statement not covered" > let isStringValue = typeofValue === 'string'</span>
|
||||
<span class="cstat-no" title="statement not covered" > debugLog('- pointKeyName', pointKeyName)</span>
|
||||
<span class="cstat-no" title="statement not covered" > debugLog('- valueConvertedFromMapping', valueConvertedFromMapping)</span>
|
||||
<span class="cstat-no" title="statement not covered" > // debugLog('typeof featurePoint.properties[pointKeyName] === \'string\'', typeofValue)</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > let isConfigMappingObject = typeofValue === 'string'</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > if (isStringValue) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > debugLog('-- string value')</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (this.isBooleanKey(pointKeyName)) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > let lowerValue = (valueConvertedFromMapping + '').toLowerCase()</span>
|
||||
<span class="cstat-no" title="statement not covered" > debugLog('isBooleanKey: lowerValue', lowerValue)</span>
|
||||
<span class="cstat-no" title="statement not covered" > convertedValue = this.truthyValues.indexOf(lowerValue) ? 'yes' : 'no'</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > } else {</span>
|
||||
<span class="cstat-no" title="statement not covered" > convertedValue = valueConvertedFromMapping</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
<span class="cstat-no" title="statement not covered" > debugLog('-- convertedValue', convertedValue)</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (convertedValue) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > newProperties[this.mapping_config[pointKeyName]] = convertedValue</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
<span class="cstat-no" title="statement not covered" > } else if (isConfigMappingObject) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > let newKey = ''</span>
|
||||
<span class="cstat-no" title="statement not covered" > let configObject = valueConvertedFromMapping</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > if (configObject.key_converted) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > newKey = configObject.key_converted</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > /**</span>
|
||||
<span class="cstat-no" title="statement not covered" > * gestion des valeurs conditionnelles</span>
|
||||
<span class="cstat-no" title="statement not covered" > * nous pouvons renseigner une string ou un objet décrivant les transformations à réaliser</span>
|
||||
<span class="cstat-no" title="statement not covered" > */</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (configObject.conditional_values) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > let keysConditionnalValues = Object.keys(configObject.conditional_values)</span>
|
||||
<span class="cstat-no" title="statement not covered" > let isFoundValue = keysConditionnalValues.indexOf(valueConvertedFromMapping)</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (isFoundValue !== -1) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > let conditionnalConfig :any = keysConditionnalValues[isFoundValue]</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > if (conditionnalConfig.tags_to_add) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > // on peut définir un ensemble de tags à rajouter</span>
|
||||
<span class="cstat-no" title="statement not covered" > newProperties.push(...conditionnalConfig.tags_to_add)</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (conditionnalConfig.truthy_value) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > // convertir la valeur, si elle est truthy, la transformer en ce que donne la propriété truthy_value</span>
|
||||
<span class="cstat-no" title="statement not covered" > // exemple: le jeu de données dit que la colonne cable_t2_attache vaut "True", mais on veut le convertir en "1".</span>
|
||||
<span class="cstat-no" title="statement not covered" > // on met donc truthy_value: '1'</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (this.truthyValues.indexOf(valueConvertedFromMapping) !== -1) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > convertedValue = conditionnalConfig.truthy_value</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (conditionnalConfig.falsy_value) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (this.falsyValues.indexOf(valueConvertedFromMapping) !== -1) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > convertedValue = conditionnalConfig.falsy_value</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
<span class="cstat-no" title="statement not covered" > if (conditionnalConfig.transform_function) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > // une transformation de la valeur</span>
|
||||
<span class="cstat-no" title="statement not covered" > // apply transformation to value</span>
|
||||
<span class="cstat-no" title="statement not covered" > convertedValue = conditionnalConfig.transform_function(valueConvertedFromMapping)</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
<span class="cstat-no" title="statement not covered" > // use the value converted</span>
|
||||
<span class="cstat-no" title="statement not covered" > else if (conditionnalConfig.value_converted) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > convertedValue = conditionnalConfig.value_converted</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
<span class="cstat-no" title="statement not covered" ></span>
|
||||
<span class="cstat-no" title="statement not covered" > if (newKey && !configObject.ignore_this_data) {</span>
|
||||
<span class="cstat-no" title="statement not covered" > newProperties[newKey] = convertedValue</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
<span class="cstat-no" title="statement not covered" > }</span>
|
||||
|
||||
}</pre></td></tr></table></pre>
|
||||
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
||||
at 2023-08-05T08:59:44.912Z
|
||||
</div>
|
||||
<script src="prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
prettyPrint();
|
||||
};
|
||||
</script>
|
||||
<script src="sorter.js"></script>
|
||||
<script src="block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -23,30 +23,30 @@
|
||||
<div class='clearfix'>
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">51.47% </span>
|
||||
<span class="strong">37.43% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>157/305</span>
|
||||
<span class='fraction'>76/203</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">58.33% </span>
|
||||
<span class="strong">66.66% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>7/12</span>
|
||||
<span class='fraction'>4/6</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">46.15% </span>
|
||||
<span class="strong">44.44% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>6/13</span>
|
||||
<span class='fraction'>4/9</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">51.47% </span>
|
||||
<span class="strong">37.43% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>157/305</span>
|
||||
<span class='fraction'>76/203</span>
|
||||
</div>
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class='status-line medium'></div>
|
||||
<div class='status-line low'></div>
|
||||
<div class="pad1">
|
||||
<table class="coverage-summary">
|
||||
<thead>
|
||||
@ -79,33 +79,18 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr>
|
||||
<td class="file high" data-value="data_other/testing"><a href="data_other/testing/index.html">data_other/testing</a></td>
|
||||
<td data-value="100" class="pic high">
|
||||
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
||||
<td class="file low" data-value="engine.ts"><a href="engine.ts.html">engine.ts</a></td>
|
||||
<td data-value="37.43" class="pic low">
|
||||
<div class="chart"><div class="cover-fill" style="width: 37%"></div><div class="cover-empty" style="width: 63%"></div></div>
|
||||
</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="34" class="abs high">34/34</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="0" class="abs high">0/0</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="0" class="abs high">0/0</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="34" class="abs high">34/34</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="file low" data-value="mappings"><a href="mappings/index.html">mappings</a></td>
|
||||
<td data-value="45.38" class="pic low">
|
||||
<div class="chart"><div class="cover-fill" style="width: 45%"></div><div class="cover-empty" style="width: 55%"></div></div>
|
||||
</td>
|
||||
<td data-value="45.38" class="pct low">45.38%</td>
|
||||
<td data-value="271" class="abs low">123/271</td>
|
||||
<td data-value="58.33" class="pct medium">58.33%</td>
|
||||
<td data-value="12" class="abs medium">7/12</td>
|
||||
<td data-value="46.15" class="pct low">46.15%</td>
|
||||
<td data-value="13" class="abs low">6/13</td>
|
||||
<td data-value="45.38" class="pct low">45.38%</td>
|
||||
<td data-value="271" class="abs low">123/271</td>
|
||||
<td data-value="37.43" class="pct low">37.43%</td>
|
||||
<td data-value="203" class="abs low">76/203</td>
|
||||
<td data-value="66.66" class="pct medium">66.66%</td>
|
||||
<td data-value="6" class="abs medium">4/6</td>
|
||||
<td data-value="44.44" class="pct low">44.44%</td>
|
||||
<td data-value="9" class="abs low">4/9</td>
|
||||
<td data-value="37.43" class="pct low">37.43%</td>
|
||||
<td data-value="203" class="abs low">76/203</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
@ -116,7 +101,7 @@
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage generated by
|
||||
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
||||
at 2023-08-05T08:56:55.975Z
|
||||
at 2023-08-05T08:59:44.912Z
|
||||
</div>
|
||||
<script src="prettify.js"></script>
|
||||
<script>
|
||||
|
@ -1,47 +1,4 @@
|
||||
TN:
|
||||
SF:data_other/testing/mappings_to_test.ts
|
||||
FNF:0
|
||||
FNH:0
|
||||
DA:1,1
|
||||
DA:2,1
|
||||
DA:3,1
|
||||
DA:4,1
|
||||
DA:5,1
|
||||
DA:6,1
|
||||
DA:7,1
|
||||
DA:8,1
|
||||
DA:9,1
|
||||
DA:10,1
|
||||
DA:11,1
|
||||
DA:12,1
|
||||
DA:13,1
|
||||
DA:14,1
|
||||
DA:15,1
|
||||
DA:16,1
|
||||
DA:17,1
|
||||
DA:18,1
|
||||
DA:19,1
|
||||
DA:20,1
|
||||
DA:21,1
|
||||
DA:22,1
|
||||
DA:23,1
|
||||
DA:24,1
|
||||
DA:25,1
|
||||
DA:26,1
|
||||
DA:27,1
|
||||
DA:28,1
|
||||
DA:29,1
|
||||
DA:30,1
|
||||
DA:31,1
|
||||
DA:32,1
|
||||
DA:33,1
|
||||
DA:34,1
|
||||
LF:34
|
||||
LH:34
|
||||
BRF:0
|
||||
BRH:0
|
||||
end_of_record
|
||||
TN:
|
||||
SF:mappings/engine.ts
|
||||
FN:16,<instance_members_initializer>
|
||||
FN:19,_default
|
||||
@ -277,94 +234,3 @@ BRDA:101,5,0,0
|
||||
BRF:6
|
||||
BRH:4
|
||||
end_of_record
|
||||
TN:
|
||||
SF:mappings/utils.js
|
||||
FN:2,Object.<anonymous>.__spreadArray
|
||||
FN:20,debugLog
|
||||
FN:45,isBooleanKey
|
||||
FN:53,writeFile
|
||||
FNF:4
|
||||
FNH:2
|
||||
FNDA:3,Object.<anonymous>.__spreadArray
|
||||
FNDA:3,debugLog
|
||||
FNDA:0,isBooleanKey
|
||||
FNDA:0,writeFile
|
||||
DA:1,1
|
||||
DA:2,1
|
||||
DA:3,3
|
||||
DA:4,0
|
||||
DA:5,0
|
||||
DA:6,0
|
||||
DA:7,0
|
||||
DA:8,0
|
||||
DA:9,3
|
||||
DA:10,3
|
||||
DA:11,1
|
||||
DA:12,1
|
||||
DA:13,1
|
||||
DA:14,1
|
||||
DA:15,1
|
||||
DA:16,1
|
||||
DA:17,1
|
||||
DA:18,1
|
||||
DA:19,1
|
||||
DA:20,3
|
||||
DA:21,3
|
||||
DA:22,3
|
||||
DA:23,8
|
||||
DA:24,8
|
||||
DA:25,3
|
||||
DA:26,0
|
||||
DA:27,0
|
||||
DA:28,3
|
||||
DA:29,3
|
||||
DA:30,1
|
||||
DA:31,1
|
||||
DA:32,1
|
||||
DA:33,1
|
||||
DA:34,1
|
||||
DA:35,1
|
||||
DA:36,1
|
||||
DA:37,1
|
||||
DA:38,1
|
||||
DA:39,1
|
||||
DA:40,1
|
||||
DA:41,1
|
||||
DA:42,1
|
||||
DA:43,1
|
||||
DA:44,1
|
||||
DA:45,0
|
||||
DA:46,0
|
||||
DA:47,0
|
||||
DA:48,1
|
||||
DA:49,1
|
||||
DA:50,1
|
||||
DA:51,1
|
||||
DA:52,1
|
||||
DA:53,0
|
||||
DA:54,0
|
||||
DA:55,0
|
||||
DA:56,0
|
||||
DA:57,0
|
||||
DA:58,0
|
||||
DA:59,0
|
||||
DA:60,0
|
||||
DA:61,0
|
||||
DA:62,0
|
||||
DA:63,0
|
||||
DA:64,1
|
||||
DA:65,1
|
||||
DA:66,1
|
||||
DA:67,1
|
||||
DA:68,1
|
||||
LF:68
|
||||
LH:47
|
||||
BRDA:2,0,0,0
|
||||
BRDA:2,1,0,3
|
||||
BRDA:3,2,0,0
|
||||
BRDA:20,3,0,3
|
||||
BRDA:22,4,0,8
|
||||
BRDA:25,5,0,0
|
||||
BRF:6
|
||||
BRH:3
|
||||
end_of_record
|
||||
|
@ -120,7 +120,7 @@ export default class {
|
||||
convertProperty(pointKeyName, mappingKeys, featurePoint, newProperties) {
|
||||
console.log('pointKeyName', pointKeyName)
|
||||
if (!mappingKeys.indexOf(pointKeyName) !== -1) {
|
||||
debugLog('found element', pointKeyName, '=>', this.mapping_config[pointKeyName], 'value : ', featurePoint.properties[pointKeyName])
|
||||
// debugLog('found element', pointKeyName, '=>', this.mapping_config[pointKeyName], 'value : ', featurePoint.properties[pointKeyName])
|
||||
let convertedValue = ''
|
||||
|
||||
let valueConvertedFromMapping = featurePoint.properties[pointKeyName]
|
||||
|
Loading…
Reference in New Issue
Block a user