Skip to content

Commit

Permalink
Fix #1 in GraphNodesPlugIn (filter on outdegree = 0)
Browse files Browse the repository at this point in the history
  • Loading branch information
mukoki committed Oct 5, 2022
1 parent 1c7f870 commit a34818e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.openjump</groupId>
<artifactId>graph-toolbox</artifactId>
<version>2.0.2</version>
<version>2.0.3</version>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
* @author Micha&euml;l Michaud
* @version 2.0.1 (2022-03-09)
*/
//version 2.0.3 (2022-10-05) Fix bug in GraphNodesPlugIn
//version 2.0.2 (2022-08-27) Fix compatibility issue with JTS 1.19 and set I18N to UTF-8
//version 2.0.1 (2022-03-09) Resources encoding
//version 2.0.0 (2022-03-01) Complete refactoring for OpenJUMP 2.0
//version 1.1.0 (2021-08-08) Refactoring to use new I18N and FeatureInstaller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,16 +319,19 @@ public void run(TaskMonitor monitor, PlugInContext context) throws Exception {
degree1 && degree == 1 ||
degree2 && degree == 2 ||
degree3p && degree > 2) {
if (indegree0 && indegree != 0) continue;
if (outdegree0 && outdegree != 0) continue;
if (indegree0 && indegree != 0 && !outdegree0) continue;
if (outdegree0 && outdegree != 0 && !indegree0) continue;
// indegree0 && outdegree0 checked means one OR the other
// -> continue if neither indegree nor outdegree are 0
if (indegree0 && outdegree0 && indegree != 0 && outdegree !=0) continue;
//if (outdegree0 && outdegree != 0) continue;
Feature bf = new BasicFeature(schemaNodes);
bf.setGeometry(node.getGeometry());
if (use_attribute) bf.setAttribute(attribute, k);
bf.setAttribute(IN_DEGREE, indegree);
bf.setAttribute(OUT_DEGREE, outdegree);
bf.setAttribute(DEGREE, degree);
resultNodes.add(bf);

}
}
}
Expand Down

0 comments on commit a34818e

Please sign in to comment.