Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WP2 export #17

Open
salikatt opened this issue Mar 16, 2020 · 4 comments
Open

WP2 export #17

salikatt opened this issue Mar 16, 2020 · 4 comments

Comments

@salikatt
Copy link
Contributor

salikatt commented Mar 16, 2020

Veldig enkel kodesnutt som funker, mne må nok lage ne QT dialog for eksport.

`import pandas as pd
import csv

data = [
['Black',499000,6007000],
['White',499000,6006900],
['Red',499000,6006800],
['Light Red',499000,6006700],
['Green',499000,6006600],
['Light Green',499000,6006500],
['Blue',499000,6006400],
['Light Blue',499000,6006300],
['Cyan',499000,6006200],
['Light Cyan',499000,6006100],
['Dark Yellow',499000,6006000],
['Yellow',499000,6005900],
['Buff',499000,6005800],
['Brown',499000,6005700],
['Magenta',499000,6005600],
['Light Magenta',499000,6005500],
['Beige',499000,6005400],
['Orange',499000,6005300],
['Dark Grey',499000,6005200],
['Grey',499000,6005100],
['Light Grey',499000,6005000]
]

depth = 0
fg_color = 0
bg_color = 0
#todo: Not really needed to include all parameters, pos + depth is good enough
#todo: consider including color-palette for forgeground/background
extra_param = [depth, fg_color, bg_color, 0.1, "Arial", 0.00, -10.1, "", 0.00, "", 1, 0.000, 0.000, 0.000, 0.05]

column_names = ['name', 'easting', 'northing', 'altitude', 'fgcolor.palette',
'bgcolor.palette', 'textcolor.palette', 'fontname', 'fontsize',
'symbol.filled', 'symbolfont', 'symbolfontsize', 'note', 'titleformat',
'radius', 'extra circles', 'radiusinc', 'state']
new_list = []

for lin in data:
lin = lin + extra_param
new_list.append(lin)

df = pd.DataFrame(new_list, columns=column_names)
#print(df.head(5))
df.to_csv('df.wp2', index=False, header=False, quoting=csv.QUOTE_NONNUMERIC)`

@danielskaare
Copy link
Owner

Implemented this code with a new icon and dialog box :

image

Choose a layer from drop-down box. It looks for Name/Easting/Northing attribute names and should work for waypoint imports and MF Events.

@salikatt
Copy link
Contributor Author

salikatt commented Mar 22, 2020 via email

@danielskaare
Copy link
Owner

Ja riktig, sikkert ui fila som ikkje har blitt pusha opp. Ordner det imorgen 👍

@salikatt
Copy link
Contributor Author

salikatt commented Mar 23, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants