-
Notifications
You must be signed in to change notification settings - Fork 14
/
fantoir_errone.html
155 lines (143 loc) · 5.27 KB
/
fantoir_errone.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<html>
<head>
<meta charset="UTF-8">
<title>FANTOIRs erronés</title>
<script src="js/jquery-2.1.1.min.js"></script>
<script src="js/jquery.tablesorter.min.js"></script>
<link rel="stylesheet" href="css/style.css" type="text/css"/>
<link rel="stylesheet" href="css/style_fantoir_errone.css" type="text/css"/>
<link rel="stylesheet" href="css/menu.css" type="text/css"/>
<script>
var menu_labels
var commune_valide = false
var osm_state
function start(){
$('body').css('cursor','progress');
$('#wait_ajax').empty()
.css('z-index','20')
.css('opacity','0.8')
.append($('<span>').append('Recherche des FANTOIRs erronés...'));
$.ajax({
url: "fantoir_errone.py",
})
.done(function( data ){
titre_bandeau = ' codes FANTOIR erronés'
if (data.length == 1){
titre_bandeau = ' code FANTOIR erroné'
}
$('#bandeau h1').append(data.length+titre_bandeau)
$('#wait_ajax').append($('<span>').append("Ok"));
$('body').css('cursor','default');
$('#wait_ajax').css('z-index','1').css('opacity','0');
url_map_org_part1 = 'http://www.openstreetmap.org/'
url_map_fr_part1 = 'http://tile.openstreetmap.fr/'
url_bano_part1 = 'http://tile.openstreetmap.fr/~cquest/leaflet/bano.html'
url_edit_part1 = 'http://www.openstreetmap.org/edit?editor='
delta = 0.0008
/* url_listing_fantoir = './liste_brute_fantoir.html#insee='+$('#input_insee')[0].value
add_map_link('table_infos_commune',url_listing_fantoir,'FANTOIR')
$('#table_infos_commune').append($('<tr>').append($('<td>').addClass('cellule_intitule').append('Données OSM en date du')).append($('<td>').addClass('cellule_data').append(cache_hsnr[2])))
*/
add_header('table_fantoir_errone',true)
table = 'table_fantoir_errone'
for (l=0;l<data.length;l++){
insee = (data[l][0]).substr(0,5)
//Fantoir
$('#'+table).append($('<tr>').attr('id',data[l][0]).append($('<td>').addClass('cell_fantoir').text(data[l][0])))
//Nom OSM
$('#'+table+' tr:last').append($('<td>').text(data[l][1]))
lon = data[l][2]
lat = data[l][3]
if (lon && lat){
url_ol_part2 = '?zoom=18&lat='+lat+'&lon='+lon
url_hash_coords = '18/'+lat+'/'+lon
xleft = lon-delta
xright = lon+delta
ybottom = lat-delta
ytop = lat+delta
//visu
add_map_link(table,url_map_org_part1+'#map='+url_hash_coords,'ORG')
add_map_link(table,url_map_fr_part1+url_ol_part2,'FR')
add_map_link(table,url_bano_part1+'#'+url_hash_coords,'BANO')
//JOSM
add_josm_link(table,xleft,xright,ybottom,ytop)
//ID
add_map_link(table,url_edit_part1+'id#map='+url_hash_coords,'ID')
//Potlatch
add_map_link(table,url_edit_part1+'potlatch2#map='+url_hash_coords,'P2')
//Fantoir
add_map_link(table,'./index.html#insee='+insee,'Fantoir-OSM '+insee)
add_map_link(table,'./liste_brute_fantoir.html#insee='+insee,'Fantoir brut '+insee)
}
}
})
};
function check_url_for_insee(){
pattern_insee = new RegExp('^[0-9][0-9abAB][0-9]{3}$')
var res
if (window.location.hash){
if (window.location.hash.split('insee=')[1]){
if (pattern_insee.test(window.location.hash.split('insee=')[1].split('&')[0])){
res = window.location.hash.split('insee=')[1].split('&')[0]
} else {
alert(window.location.hash.split('insee=')[1].split('&')[0]+' n\'est pas un code INSEE de commune\n\nAbandon')
}
}
}
return res
}
function add_map_link(table,href,text){
$('#'+table+' tr:last').append($('<td>')
.append($('<a>')
.attr('href',href)
.attr('target','blank')
.text(text)))
}
function add_josm_link(table,xl,xr,yb,yt){
$('#'+table+' tr:last').append($('<td>')
.addClass('zone_click')
.attr('xleft',xl).attr('xright',xr).attr('ybottom',yb).attr('ytop',yt)
.text('JOSM')
.click(function(){
srcLoadAndZoom = 'http://127.0.0.1:8111/load_and_zoom?left='+xl+'&right='+xr+'&top='+yt+'&bottom='+yb;
$('<img>').appendTo($('#josm_target')).attr('src',srcLoadAndZoom);
$(this).addClass('clicked');
})
)
}
function add_header(table,with_edit_and_map_links){
$('#'+table).append($('<tr>').append($('<th>').append('Code FANTOIR')))
$('#'+table+' tr').append($('<th>').append('Voie OSM'))
if (with_edit_and_map_links){
$('#'+table+' tr').append($('<th>').attr('colspan','3').append('Cartes'))
$('#'+table+' tr').append($('<th>').attr('colspan','3').append('Édition'))
$('#'+table+' tr').append($('<th>').attr('colspan','2').append('FANTOIR'))
}
}
</script>
</head>
<body onload="start()">
<header>
<!--#include file="includes/menu.html" -->
</header>
<div id="bandeau">
<h1></h1>
<h4>Liste des codes Fantoir trouvés dans OSM et inconnus du fichier Fantoir officiel. Ce sont souvent des codes erronés, à cause d'erreurs de frappe : minuscules, inversions de caratères, etc.</h4>
<div id="pied_de_page"></div>
</div>
<table id="rubriques">
<tr>
<td class="rubrique" id="rub_adresses_non_match" cible="table_fantoir_errone"></td>
</tr>
</table>
<div id="reponse">
<table id="table_fantoir_errone" class="table_liste_"></table>
<div id="pied_de_page"></div>
</div>
<footer>
<!--#include file="includes/footer.html" -->
</footer>
<div id="josm_target" style="visibility : hidden"></div>
<div id="wait_ajax"></div>
</body>
</html>