diff --git a/shp_2_txt.py b/shp_2_txt.py index fcfc3f9..ebbe661 100644 --- a/shp_2_txt.py +++ b/shp_2_txt.py @@ -16,18 +16,26 @@ Example Output for a complete record of MA.dbf: ('MARKER', 'DE = TRAVERSE STATION DISK'), ('SETTING', '7 = SET IN TOP OF CONCRETE MONUMENT'), ('STAMPING', '204 S')]) ''' + # dbfread 4 reading dbf files xD # https://dbfread.readthedocs.io/en/latest/ from dbfread import DBF +# open dbf file dbf_file = DBF("f:\\testing\\shp_2_txt\\MA.dbf", load=True, encoding='utf8') + +# open txt file txt_file = open("f:\\testing\\shp_2_txt\\MA.txt", 'w') +# get lat, lon, elip height and ortho height for idx, record in enumerate(dbf_file): txt_file.write(str(record['DEC_LON'] + record['DEC_LAT'] + record['ELLIP_HT'] + record['ORTHO_HT']) + '\n') +# write txt file txt_file.close() + + ''' example output: