forked from osm-fr/osm-vs-fantoir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fantoir_errone.html
298 lines (293 loc) · 7.45 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<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>
<style>
body{
font-family: monospace;
}
#bandeau{
top:0px;
width:100%;
height:150px;
z-index:3;
position:fixed;
background-color:white;
}
.cellule_intitule{
text-align: right;
}
.cellule_data{
font-weight: bold;
}
#rubriques{
position:absolute;
top:130px;
}
#rubriques th{
background-color:black;
color:white;
}
#reponse{
position:absolute;
top:150px;
z-index:2;
}
.emphase{
color:red;
font-size: x-large;
}
.rubrique{
cursor:pointer;
width:200px;
height:50px;
position:relative;
color:black;
font-weight: bold;
background:white;
margin-right:10px;
}
.rubrique.active{
border:3px solid black;
}
.table_liste{
display:none;
}
.zone_click{
cursor:pointer;
color:blue;
text-decoration: underline;
}
.zone_click.clicked{
background-color:green;
color:white;
}
#refresh_infos{
position: fixed;
width: 250px;
height: 56px;
top: 6px;
right: 109px;
display:none;
}
#refresh_infos span{
font-weight: bold;
}
#bouton_refresh{
position: fixed;
background-image: url("img/72176-600.png");
background-size: 49px 56px;
background-repeat: no-repeat;
width: 49px;
height: 56px;
top: 6px;
right: 60px;
}
#infos_refresh{
width:100%;
height:200px;
top:0px;
left:0px;
background-color:lightgrey;
opacity:0.8;
position:fixed;
//visibility:hidden;
display:none;
z-index: 15;
}
#wait_ajax{
position:fixed;
z-index:1;
width:100%;
height:100%;
background-color:lightgray;
opacity:0;
text-align:center;
}
#wait_ajax span{
background-color:black;
vertical-align:middle;
font-size:30px;
line-height:500px;
color:white;
border:50px solid black;
}
#infobulle_aide{
position: fixed;
color: red;
background: #dddddd;
width: 40px;
height: 40px;
border-radius: 40px;
top: 10px;
right: 10px;
vertical-align: bottom;
text-align: center;
font-weight: bolder;
font-size: 35px;
}
#aide{
position:fixed;
top:5px;
right:5px;
width:400px;
height:100%;
background-color:lavender;
overflow-y:scroll;
visibility:hidden;
z-index: 10;
}
#table_fantoir_errone tr td,
background:white;
color:black;
font-weight: normal;
}
#pied_de_page{
position:relative;
width:100%;
height:30px;
z-index:3;
}
#credits{
background:darkgrey;
position:fixed;
bottom:0px;
width:100%;
overflow:visible;
z-index:4;
text-align: justify;
}
</style>
<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()">
<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>
<div id="reponse">
<table id="table_fantoir_errone" class="table_liste_"></table>
<div id="pied_de_page"></div>
</div>
<div id="credits">
Données OpenStreetMap : © les Contributeurs d'OpenStreetMap <a href="http://opendatacommons.org/licenses/odbl/">Licence ODbL</a>
</div>
<div id="josm_target" style="visibility : hidden"></div>
<div id="wait_ajax"></div>
</body>
</html>