예제 #1
0
def main():
    print("Content-Type: application/json")
    print("")

    params = cgi.FieldStorage()
    insee_com = params['insee'].value
    pgc = a.get_pgc()
    format_cadastre = get_cadastre_format(pgc,insee_com)
    try:
        a.main(['',insee_com,'OSM',False])
        if format_cadastre == 'VECT':
            a.main(['',insee_com,'CADASTRE',False])
        statut = '1'
    except Exception:
        statut = '0'
    print(statut)
예제 #2
0
def main():
    print "Content-Type: application/json"
    print ""

    params = cgi.FieldStorage()
    insee_com = params['insee'].value
    pgc = a.get_pgc()
    format_cadastre = get_cadastre_format(pgc, insee_com)
    try:
        a.main(['', insee_com, 'OSM', False])
        if format_cadastre == 'VECT':
            a.main(['', insee_com, 'CADASTRE', False])
        p.main(['', insee_com, False])
        statut = '1'
    except:
        statut = '0'
    print(statut)
예제 #3
0
		get_data_by_dept_from_pg('hsnr_insee',num_dept_cadastre)
		get_data_by_dept_from_pg('hsnr_bbox_insee',num_dept_cadastre)
		get_data_by_dept_from_pg('point_par_rue_insee',num_dept_cadastre)
		get_data_by_dept_from_pg('point_par_rue_complement_insee',num_dept_cadastre)
		get_data_by_dept_from_pg('type_highway_insee',num_dept_cadastre)
	# os._exit(0)
	
	get_data_by_dept_from_pg('highway_insee',num_dept_cadastre)
	get_data_by_dept_from_pg('highway_bbox_insee',num_dept_cadastre)
	get_data_by_dept_from_pg('highway_relation_insee',num_dept_cadastre)
	get_data_by_dept_from_pg('highway_relation_bbox_insee',num_dept_cadastre)
	# os._exit(0)

	clause_vecteur = ''
	if source == 'CADASTRE':
		clause_vecteur = ' AND format_cadastre = \'VECT\' '
	str_query = 'SELECT insee_com,nom_com FROM code_cadastre WHERE cadastre_dept = \'{:s}\' {:s} ORDER BY 2;'.format(num_dept_cadastre,clause_vecteur)
	cur = pgc.cursor()
	cur.execute(str_query)
	for c in cur:
		print('{:s} - {:s}'.format(c[0],c[1]))
		try:
			a.main(['',c[0],source])
		except :
			e.write_log_to_file(f_log,'Commune : {:s}\n'.format(c[1]))
			e.write_log_to_file(f_log,str(sys.exc_info()[0]))
			e.write_log_to_file(f_log,str(sys.exc_info()[1]))
			e.write_sep_to_file(f_log)
	e.end_log_to_file(f_log,True)

예제 #4
0
import glob
import addr_2_db as a

rep_parcelles_adresses = 'parcelles_adresses'
list_txt = glob.glob('./' + rep_parcelles_adresses + '/[A-Z][A|B][0-9]*.txt')
for n in list_txt:
    code_cadastre = n.split('\\')[1].split('-')[0]
    code_insee = '92' + code_cadastre[2:5]
    a.main(['', code_insee, code_cadastre])
예제 #5
0
import glob
import addr_2_db as a

rep_parcelles_adresses = 'parcelles_adresses'
list_txt = glob.glob('./'+rep_parcelles_adresses+'/[A-Z][A|B][0-9]*.txt')
for n in list_txt:
	code_cadastre = n.split('\\')[1].split('-')[0]
	code_insee = '92'+code_cadastre[2:5]
	a.main(['',code_insee,code_cadastre])