# Which features are chosen by topologies

**URL:** https://discourse.gplates.org/t/which-features-are-chosen-by-topologies/190
**Category:** Q&A
**Created:** [21 September 2020 08:09 UTC](https://discourse.gplates.org/t/which-features-are-chosen-by-topologies/190 "2020-09-21T08:09:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![t.j.m.vanderlinden](https://discourse.gplates.org/letter_avatar_proxy/v4/letter/t/2acd7d/32.png) [@t.j.m.vanderlinden](https://discourse.gplates.org/u/t.j.m.vanderlinden)
#### Post date: [21 September 2020 08:09 UTC](https://discourse.gplates.org/t/which-features-are-chosen-by-topologies/190/1 "2020-09-21T08:09:26Z")

</div>

When I have two files loaded in GPlates with topological boundaries and features it often shows the topologies of interest incomplete. When I close the file (the one which is not of interest), it shows correctly.

This happens between files in which there are features drawn in GPlates and files in which there are topological boundaries and features based on the features in the other file, but modified in pyGPlates.

---

<div class="post-metadata">

### Author: ![john.cannon](https://discourse.gplates.org/letter_avatar_proxy/v4/letter/j/3e96dc/32.png) [@john.cannon](https://discourse.gplates.org/u/john.cannon)
#### Post date: [21 September 2020 10:18 UTC](https://discourse.gplates.org/t/which-features-are-chosen-by-topologies/190/2 "2020-09-21T10:18:37Z")

</div>

It sounds like you have multiple features with the **same** [feature ID](https://www.gplates.org/docs/pygplates/generated/pygplates.Feature.html#pygplates.Feature.get_feature_id).

This creates a problem for topologies because they use feature IDs to find the regular features. So if GPlates finds more than one regular feature with the same feature ID then it cannot know which one to use, so it uses neither to make it obvious there’s a problem (eg, no topologies visible). You can see this if you load up the same topology files _twice_ (eg, from the sample data) - all of a sudden all the topologies disappear.

In your case it sounds like you are loading existing features into pyGPlates, modifying them and saving them out. Then, in GPlates, you’re loading both the original files and the modified files, thus the duplicated feature IDs. You can avoid the duplication by [cloning](https://www.gplates.org/docs/pygplates/generated/pygplates.Feature.html#pygplates.Feature.clone) the features in pyGPlates before modifying them. The cloning ensures they get a new feature ID. Semantically you’re basically saying that you are creating a **copy** of the features and then modifying the copy. Rather than loading two different versions of the **same** feature, which contradict each other. It’s an easy mistake to make, and a relatively subtle point, but that’s the essential jist of the problem.

Another way around the problem, in GPlates, is to use the `Topological sections` input (see image below) to restrict the search for regular features used by that topology layer (when none specified it defaults to a global search, ie, searches all loaded features). In your case you’d specify either the original or the modified file (but not both)…

![image](https://discourse.gplates.org/uploads/default/original/1X/2d7a345773e71817de93600346448b3f77c41689.png)

Note that you usually specify the green layers there, since you’re restricting your search to _some_ of the green layers (as opposed to all of them). But be aware that if you have topological _line_ features (ie, different than regular static line features) then these are in purple (topology) layers, not green (regular) layers. So if these topological _lines_ are used by dynamic polygons or deforming networks (eg, part of their deforming boundaries) then you’ll need to specify the purple layer containing the topological _lines_ (in the `Topological sections` of the dynamic polygons or deforming networks layer).

---

<div class="post-metadata">

### Author: ![t.j.m.vanderlinden](https://discourse.gplates.org/letter_avatar_proxy/v4/letter/t/2acd7d/32.png) [@t.j.m.vanderlinden](https://discourse.gplates.org/u/t.j.m.vanderlinden)
#### Post date: [22 September 2020 08:11 UTC](https://discourse.gplates.org/t/which-features-are-chosen-by-topologies/190/3 "2020-09-22T08:11:16Z")

</div>

Thanks John for the explanation and the two solutions. That solves it 🙂
