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

[Feature Request]Use magic word to allow element calculation #9

Open
LaoshuBaby opened this issue Mar 30, 2022 · 0 comments
Open

[Feature Request]Use magic word to allow element calculation #9

LaoshuBaby opened this issue Mar 30, 2022 · 0 comments
Labels
enhancement New feature or request Feature Request

Comments

@LaoshuBaby
Copy link
Collaborator

LaoshuBaby commented Mar 30, 2022

For example, define a __add__() function to allow user merge 2 node/way/relation

And have such logic:

if A.type == B.type:
    if A.type == "Node" and B.type == "Node":
        C = Node()
        if A.pos != B.pos:
            C.pos=avg_pos(A.pos, B.pos) #Need geography lib support
        for ki,vi in A,tags:
            for kj,vj in B.tags:
                 if don't conflict:
                     C.tags.append(ki,vi)
     if type == "Way":
        pass
     if type == "Relation":
        pass
else:
    throw exception("Type for A with B don't match")

This also should offer a method called add(A:Node, B:Node), like a=Way\a=a.reverse() mentioned in #5

@LaoshuBaby LaoshuBaby added the enhancement New feature or request label Mar 30, 2022
@LaoshuBaby LaoshuBaby changed the title Use magic word to allow element calculation [Feature Request]Use magic word to allow element calculation Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Feature Request
Projects
None yet
Development

No branches or pull requests

1 participant