<commit_before><?php

require_once('Collection.php');
require_once('Math.php');
require_once('Point.php');
require_once('Segment.php');
require_once('Polygone.php');
require_once('PolygoneCollection.php');

use Utility\PolygoneCollection;
use Utility\Polygone;


$source = '[[[[7.0365525786912,43.507363888441],[7.047286188695,43.50949567464],[7.0553182053134,43.50774379754],[7.0477251055428,43.505026003829],[7.0365525786912,43.507363888441]]],[[[7.0722058140026,43.515694105851],[7.0728837725475,43.516870670067],[7.073663150888,43.514462405307],[7.073035318336,43.514536867],[7.0722058140026,43.515694105851]]],[[[7.0563652816086,43.506081262216],[7.0575638138606,43.506302462781],[7.0588298095905,43.506908593783],[7.0581473594692,43.505851720979],[7.0563652816086,43.506081262216]]],[[[6.963023765887,43.573928591416],[6.9694935223947,43.567922817874],[6.9643415944088,43.566797758909],[6.96638642949,43.560584073882],[6.9794296080893,43.562167905474],[6.9839222624883,43.56666660372],[6.9979879933755,43.565291507353],[7.0050399480189,43.569173668714],[7.0119038852733,43.564820376991],[7.0177136495418,43.564899072551],[7.0267199789173,43.56917737866],[7.0351910022151,43.569000082006],[7.047606977083,43.563790295356],[7.049932625522,43.552161356056],[7.0576047770376,43.550713920607],[7.0411990246668,43.542571318265],[7.0376550810394,43.534970164287],[7.0353051780877,43.538683014611],[7.0324791680354,43.538452360103],[7.0301044715818,43.539527285938],[7.0295843470323,43.541341208319],[7.0320220153873,43.538885862214],[7.03394351178,43.540964180554],[7.0325381873495,43.544343476366],[7.0309674830752,43.540829192319],[7.0323501699606,43.546248670536],[7.0212584016529,43.549925863591],[7.0162453532099,43.547497106539],[7.016460589552,43.551046289549],[7.0123048033846,43.550484614267],[7.0176195959316,43.544957494597],[7.0017053118527,43.548838296735],[6.9789300549598,43.547256002967],[6.9627310947674,43.542013470975],[6.9516824455934,43.534621686174],[6.9577458940982,43.544154386142],[6.9496945637012,43.545626005531],[6.9505593718252,43.550655780269],[6.9553287073317,43.550175876186],[6.9573773153371,43.555554086109],[6.9528605860886,43.560858778659],[6.9559947182833,43.563727611147],[6.9526545125624,43.568487194471],[6.9483949709797,43.567627056651],[6.9447513143558,43.571204993047],[6.9556061070914,43.574651383855],[6.963023765887,43.573928591416]]],[[[7.0316774216443,43.522073309095],[7.0465449887541,43.524351390645],[7.0707599755528,43.517463275557],[7.0673107143564,43.514399213772],[7.042768022142,43.515935270487],[7.0344047068469,43.517302112455],[7.0316774216443,43.522073309095]]]]';

$polygones = new PolygoneCollection();

$polyJson = json_decode($source);
if(is_array($polyJson)) {
	foreach($polyJson as $poly){
		$polygones[] = new Polygone($poly[0]);
	}
}



// $coordUn = [[7.036552578691193,43.507363888441027],[7.047286188695026,43.509495674639822],[7.055318205313394,43.507743797539959],[7.047725105542845,43.505026003828966],[7.036552578691193, 43.507363888441027]];
// $coordDeux = [[7.056365281608564, 43.506081262216313],[7.057563813860637,43.506302462781079],[7.058829809590545,43.50690859378313],[7.058147359469199,43.505851720979443],[7.056365281608564,43.506081262216313]];
// $coordTrois = [[6.963023765886971,43.573928591415665],[6.969493522394728,43.567922817874035],[6.964341594408774,43.56679775890931],[6.966386429490016,43.560584073881806],[6.979429608089318,43.562167905474439],[6.983922262488257,43.566666603719661],[6.997987993375471,43.565291507353017],[7.005039948018866,43.569173668713681],[7.011903885273295,43.564820376991172],[7.01771364954181,43.564899072551114],[7.026719978917336,43.56917737866037],[7.035191002215054,43.569000082005552],[7.047606977082983,43.563790295356142 ], [ 7.04993262552204, 43.552161356055642 ], [ 7.057604777037591, 43.550713920607159 ], [ 7.041199024666773, 43.542571318265281 ], [ 7.037655081039394, 43.534970164286818 ], [ 7.035305178087666, 43.538683014610825 ], [ 7.032479168035354, 43.538452360102703 ], [ 7.030104471581784, 43.539527285938192 ], [ 7.029584347032279, 43.541341208319288 ], [ 7.032022015387266, 43.538885862213853 ], [ 7.033943511779998, 43.540964180553772 ], [ 7.032538187349521, 43.544343476366372 ], [ 7.030967483075237, 43.540829192319457 ], [ 7.032350169960554, 43.546248670535633 ], [ 7.021258401652946, 43.549925863590786 ], [ 7.016245353209916, 43.547497106538806 ], [ 7.016460589551991, 43.551046289549241 ], [ 7.012304803384597, 43.550484614266594 ], [ 7.017619595931562, 43.544957494596865 ], [ 7.001705311852686, 43.548838296734736 ], [ 6.978930054959819, 43.547256002966684 ], [ 6.962731094767405, 43.542013470975434 ], [ 6.951682445593434, 43.534621686173658 ], [ 6.957745894098184, 43.544154386141678 ], [ 6.949694563701206, 43.545626005531282 ], [ 6.950559371825228, 43.550655780268897 ], [ 6.955328707331676, 43.550175876185811 ], [ 6.957377315337109, 43.555554086108835 ], [ 6.952860586088557, 43.560858778659124 ], [ 6.955994718283321, 43.563727611146881 ], [ 6.952654512562379, 43.568487194470869 ], [ 6.94839497097967, 43.567627056650785 ], [ 6.944751314355753, 43.571204993046898 ], [ 6.955606107091412, 43.574651383854572 ], [ 6.963023765886971, 43.573928591415665 ] ];
// $coordQuatre = [ [ 7.031677421644278, 43.522073309094893 ], [ 7.046544988754098, 43.524351390644746 ], [ 7.070759975552823, 43.517463275557375 ], [ 7.06731071435639, 43.514399213772386 ], [ 7.042768022142016, 43.515935270486686 ], [ 7.034404706846864, 43.517302112454963 ], [ 7.031677421644278, 43.522073309094893 ] ];



// $polygones = new PolygoneCollection();
// $polygones[] = new Polygone($coordUn);
// $polygones[] = new Polygone($coordDeux);
// $polygones[] = new Polygone($coordTrois);
// $polygones[] = new Polygone($coordQuatre);

$fusionPolygones = $polygones->union();

?>

<!DOCTYPE html>
<html>
<head>
	<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
	<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>



	<title>Polygones</title>

	<script type="text/javascript">
	window.onload = function() {
		var mp1 = {
		  "type": "Feature",
		  "geometry": {
		    "type": "MultiPolygon",
		    "coordinates": [


		          <?php echo $fusionPolygones->toJSON();?>

		      ]
		  },
		  "properties": {
		    "name": "MultiPolygon",
		    "style": {
		        color: "black",
		        opacity: 1,
		        fillColor: "white",
		        fillOpacity: 1
		    }
		  }
		};
		var map1 = L.map('poly1', {
			center: [7,44],
  			zoom: 4
		});
		new L.GeoJSON(mp1, {
		  style: function(feature) {
		      return feature.properties.style
		  }
		}).addTo(map1);

		var mp2 = {
		  "type": "Feature",
		  "geometry": {
		    "type": "MultiPolygon",
		    "coordinates": [

		          <?php
		         	echo $polygones->toJSON();
		          ?>
		        		      ]
		  },
		  "properties": {
		    "name": "MultiPolygon",
		    "style": {
		        color: "black",
		        opacity: 1,
		        fillColor: "white",
		        fillOpacity: 1
		    }
		  }
		};
		var map2 = L.map('poly2', {
			center: [7,44],
  			zoom: 4
		});
		new L.GeoJSON(mp2, {
		  style: function(feature) {
		      return feature.properties.style
		  }
		}).addTo(map2);

	};
	</script>

	<style>
	#map { width: 1000px; height: 400px; }
	</style>

</head>

<body>
	<div id="poly1" style="float:left;height:480px; width:300px;margin:0;"></div>
	<div id="poly2" style="left;height:480px; width:300px;margin:0;"></div>
	<div id="poly12" style="left;height:480px; width:300px;margin:0;"></div>
	<div id="polyUnion" style="left;height:480px; width:300px;margin:0;"></div>
</body>

</html>
<commit_msg>[TECH] Correction du zoom affichage des polygones.<commit_after><?php

require_once('Collection.php');
require_once('Math.php');
require_once('Point.php');
require_once('Segment.php');
require_once('PolygonInterface.php');
require_once('Polygone.php');
require_once('MultiPolygon.php');
require_once('PolygoneCollection.php');

use Utility\PolygoneCollection;
use Utility\Polygone;
use Utility\Point;


$source = '[[[[7.0365525786912,43.507363888441],[7.047286188695,43.50949567464],[7.0553182053134,43.50774379754],[7.0477251055428,43.505026003829],[7.0365525786912,43.507363888441]]],[[[7.0722058140026,43.515694105851],[7.0728837725475,43.516870670067],[7.073663150888,43.514462405307],[7.073035318336,43.514536867],[7.0722058140026,43.515694105851]]],[[[7.0563652816086,43.506081262216],[7.0575638138606,43.506302462781],[7.0588298095905,43.506908593783],[7.0581473594692,43.505851720979],[7.0563652816086,43.506081262216]]],[[[6.963023765887,43.573928591416],[6.9694935223947,43.567922817874],[6.9643415944088,43.566797758909],[6.96638642949,43.560584073882],[6.9794296080893,43.562167905474],[6.9839222624883,43.56666660372],[6.9979879933755,43.565291507353],[7.0050399480189,43.569173668714],[7.0119038852733,43.564820376991],[7.0177136495418,43.564899072551],[7.0267199789173,43.56917737866],[7.0351910022151,43.569000082006],[7.047606977083,43.563790295356],[7.049932625522,43.552161356056],[7.0576047770376,43.550713920607],[7.0411990246668,43.542571318265],[7.0376550810394,43.534970164287],[7.0353051780877,43.538683014611],[7.0324791680354,43.538452360103],[7.0301044715818,43.539527285938],[7.0295843470323,43.541341208319],[7.0320220153873,43.538885862214],[7.03394351178,43.540964180554],[7.0325381873495,43.544343476366],[7.0309674830752,43.540829192319],[7.0323501699606,43.546248670536],[7.0212584016529,43.549925863591],[7.0162453532099,43.547497106539],[7.016460589552,43.551046289549],[7.0123048033846,43.550484614267],[7.0176195959316,43.544957494597],[7.0017053118527,43.548838296735],[6.9789300549598,43.547256002967],[6.9627310947674,43.542013470975],[6.9516824455934,43.534621686174],[6.9577458940982,43.544154386142],[6.9496945637012,43.545626005531],[6.9505593718252,43.550655780269],[6.9553287073317,43.550175876186],[6.9573773153371,43.555554086109],[6.9528605860886,43.560858778659],[6.9559947182833,43.563727611147],[6.9526545125624,43.568487194471],[6.9483949709797,43.567627056651],[6.9447513143558,43.571204993047],[6.9556061070914,43.574651383855],[6.963023765887,43.573928591416]]],[[[7.0316774216443,43.522073309095],[7.0465449887541,43.524351390645],[7.0707599755528,43.517463275557],[7.0673107143564,43.514399213772],[7.042768022142,43.515935270487],[7.0344047068469,43.517302112455],[7.0316774216443,43.522073309095]]]]';


$polygones = new PolygoneCollection();


$polyJson = json_decode($source);
if(is_array($polyJson)) {
	foreach($polyJson as $poly){
		$polygon = new Polygone($poly[0]);
		$polygones[] = $polygon;
	}
}




// $coordUn = [[7.036552578691193,43.507363888441027],[7.047286188695026,43.509495674639822],[7.055318205313394,43.507743797539959],[7.047725105542845,43.505026003828966],[7.036552578691193, 43.507363888441027]];
// $coordDeux = [[7.056365281608564, 43.506081262216313],[7.057563813860637,43.506302462781079],[7.058829809590545,43.50690859378313],[7.058147359469199,43.505851720979443],[7.056365281608564,43.506081262216313]];
// $coordTrois = [[6.963023765886971,43.573928591415665],[6.969493522394728,43.567922817874035],[6.964341594408774,43.56679775890931],[6.966386429490016,43.560584073881806],[6.979429608089318,43.562167905474439],[6.983922262488257,43.566666603719661],[6.997987993375471,43.565291507353017],[7.005039948018866,43.569173668713681],[7.011903885273295,43.564820376991172],[7.01771364954181,43.564899072551114],[7.026719978917336,43.56917737866037],[7.035191002215054,43.569000082005552],[7.047606977082983,43.563790295356142 ], [ 7.04993262552204, 43.552161356055642 ], [ 7.057604777037591, 43.550713920607159 ], [ 7.041199024666773, 43.542571318265281 ], [ 7.037655081039394, 43.534970164286818 ], [ 7.035305178087666, 43.538683014610825 ], [ 7.032479168035354, 43.538452360102703 ], [ 7.030104471581784, 43.539527285938192 ], [ 7.029584347032279, 43.541341208319288 ], [ 7.032022015387266, 43.538885862213853 ], [ 7.033943511779998, 43.540964180553772 ], [ 7.032538187349521, 43.544343476366372 ], [ 7.030967483075237, 43.540829192319457 ], [ 7.032350169960554, 43.546248670535633 ], [ 7.021258401652946, 43.549925863590786 ], [ 7.016245353209916, 43.547497106538806 ], [ 7.016460589551991, 43.551046289549241 ], [ 7.012304803384597, 43.550484614266594 ], [ 7.017619595931562, 43.544957494596865 ], [ 7.001705311852686, 43.548838296734736 ], [ 6.978930054959819, 43.547256002966684 ], [ 6.962731094767405, 43.542013470975434 ], [ 6.951682445593434, 43.534621686173658 ], [ 6.957745894098184, 43.544154386141678 ], [ 6.949694563701206, 43.545626005531282 ], [ 6.950559371825228, 43.550655780268897 ], [ 6.955328707331676, 43.550175876185811 ], [ 6.957377315337109, 43.555554086108835 ], [ 6.952860586088557, 43.560858778659124 ], [ 6.955994718283321, 43.563727611146881 ], [ 6.952654512562379, 43.568487194470869 ], [ 6.94839497097967, 43.567627056650785 ], [ 6.944751314355753, 43.571204993046898 ], [ 6.955606107091412, 43.574651383854572 ], [ 6.963023765886971, 43.573928591415665 ] ];
// $coordQuatre = [ [ 7.031677421644278, 43.522073309094893 ], [ 7.046544988754098, 43.524351390644746 ], [ 7.070759975552823, 43.517463275557375 ], [ 7.06731071435639, 43.514399213772386 ], [ 7.042768022142016, 43.515935270486686 ], [ 7.034404706846864, 43.517302112454963 ], [ 7.031677421644278, 43.522073309094893 ] ];



// $polygones = new PolygoneCollection();
// $polygones[] = new Polygone($coordUn);
// $polygones[] = new Polygone($coordDeux);
// $polygones[] = new Polygone($coordTrois);
// $polygones[] = new Polygone($coordQuatre);

$fusionPolygones = $polygones->union();

?>

<!DOCTYPE html>
<html>
<head>
	<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
	<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>



	<title>Polygones</title>

	<script type="text/javascript">
	window.onload = function() {
		var mp1 = {
		  "type": "Feature",
		  "geometry": {
		    "type": "MultiPolygon",
		    "coordinates": [


		          <?php echo $fusionPolygones->toJSON();?>

		      ]
		  },
		  "properties": {
		    "name": "MultiPolygon",
		    "style": {
		        color: "black",
		        opacity: 1,
		        fillColor: "white",
		        fillOpacity: 1
		    }
		  }
		};
		var map1 = L.map('poly1', {
			center: [43.55,7],
  			zoom: 11
		});
		new L.GeoJSON(mp1, {
		  style: function(feature) {
		      return feature.properties.style
		  }
		}).addTo(map1);

		var mp2 = {
		  "type": "Feature",
		  "geometry": {
		    "type": "MultiPolygon",
		    "coordinates": [

		          <?php
		         	echo $polygones->toJSON();
		          ?>
		        		      ]
		  },
		  "properties": {
		    "name": "MultiPolygon",
		    "style": {
		        color: "black",
		        opacity: 1,
		        fillColor: "white",
		        fillOpacity: 1
		    }
		  }
		};
		var map2 = L.map('poly2', {
			center: [43.55,7],
  			zoom: 11
		});
		new L.GeoJSON(mp2, {
		  style: function(feature) {
		      return feature.properties.style
		  }
		}).addTo(map2);

	};
	</script>

	<style>
	#map { width: 1000px; height: 400px; }
	</style>

</head>

<body>
	<div id="poly1" style="float:left;height:480px; width:300px;margin:0;"></div>
	<div id="poly2" style="left;height:480px; width:300px;margin:0;"></div>
	<div id="poly12" style="left;height:480px; width:300px;margin:0;"></div>
	<div id="polyUnion" style="left;height:480px; width:300px;margin:0;"></div>
</body>

</html>

{'fraction_non_alphanumeric': 0.17177875150822378, 'fraction_numerical': 0.5192100082555408, 'mean_word_length': 5.2245059288537545, 'pattern_counts': {'":': 28, '<': 57, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7091486', 'n_tokens_mistral': 11985, 'n_tokens_neox': 6893, 'n_words': 510}