Home Forums Nazca reusing layer name error


Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #5967

    I define a new layer in nazca. The first run is ok but from the second run I always get reusing layer name error.

    When the code nd.add_layer runs second time, it tries to add again a layer which already exists and gives error. Any one has an idea except removing the add_layer code after first run?



    Dear Shayan,

    It seems the memory is not cleared between runs. It then looks to Nazca like you are defining the same layer twice. If you work in Spyder you can tag the option:
    “Tools/Preferences/Run/Remove all variables before execution”.

    You can also remove all layers explicitly in Nazca using

    import nazca as nd

    However, better is to clear the memory between runs to avoid similar issues.

    If on another occasion you actually want to overwrite an existing layer you can use the overwrite keyword since nazca-0.5.7:

    import nazca as nd
    nd.add_layer(name='layer1', layer=1)
    nd.add_layer(name='layer1', layer=1, overwrite=True)


Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.