Revision: 6227
          http://sourceforge.net/p/jump-pilot/code/6227
Author:   michaudm
Date:     2020-01-28 23:38:15 +0000 (Tue, 28 Jan 2020)
Log Message:
-----------
PointsToPathsPlugIn : exclude geometries which are not points

Modified Paths:
--------------
    core/trunk/src/language/jump.properties
    core/trunk/src/language/jump_cz.properties
    core/trunk/src/language/jump_de.properties
    core/trunk/src/language/jump_es.properties
    core/trunk/src/language/jump_fi.properties
    core/trunk/src/language/jump_fr.properties
    core/trunk/src/language/jump_hu.properties
    core/trunk/src/language/jump_it.properties
    core/trunk/src/language/jump_ja_JP.properties
    core/trunk/src/language/jump_ml.properties
    core/trunk/src/language/jump_pt.properties
    core/trunk/src/language/jump_pt_BR.properties
    core/trunk/src/language/jump_ta_IN.properties
    core/trunk/src/language/jump_te.properties
    core/trunk/src/language/jump_zh_CN.properties
    core/trunk/src/language/jump_zh_HK.properties
    
core/trunk/src/org/openjump/core/ui/plugin/tools/geometrychange/PointsToPathsPlugIn.java

Modified: core/trunk/src/language/jump.properties
===================================================================
--- core/trunk/src/language/jump.properties     2020-01-28 07:54:17 UTC (rev 
6226)
+++ core/trunk/src/language/jump.properties     2020-01-28 23:38:15 UTC (rev 
6227)
@@ -1688,6 +1688,7 @@
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.group-by-attribute
 = Attribute used to group points
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.group-by-attribute-tooltip
 = Create distinct paths for distinct attribute values
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.invalid-path
 = Cannot build a path with less than 2 points
+org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.non-point-warning
 = Some geometries in the layer are not points : they will be excluded
 org.openjump.core.ui.plugin.tools.statistics.CalcVarianceAndMeanPerClassPlugIn 
= Calculate Mean and Variance Per Class
 
org.openjump.core.ui.plugin.tools.statistics.CalcVarianceAndMeanPerClassPlugIn.Select-attribute-to-calculate-statistics-from
 = Select attribute to calculate statistics from
 
org.openjump.core.ui.plugin.tools.statistics.CalcVarianceAndMeanPerClassPlugIn.Select-attribute-with-classification
 = Select attribute with classification information

Modified: core/trunk/src/language/jump_cz.properties
===================================================================
--- core/trunk/src/language/jump_cz.properties  2020-01-28 07:54:17 UTC (rev 
6226)
+++ core/trunk/src/language/jump_cz.properties  2020-01-28 23:38:15 UTC (rev 
6227)
@@ -2968,4 +2968,5 @@
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.layer=#T:Layer
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.order-by-attribute=#T:Sorting
 attribute
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.order-by-attribute-tooltip=#T:Attribute
 used to sort points belonging to a path
-org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.use-selection=#T:Use
 selection only
\ No newline at end of file
+org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.use-selection=#T:Use
 selection only
+org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.non-point-warning=#T:Some
 geometries in the layer are not points : they will be excluded
\ No newline at end of file

Modified: core/trunk/src/language/jump_de.properties
===================================================================
--- core/trunk/src/language/jump_de.properties  2020-01-28 07:54:17 UTC (rev 
6226)
+++ core/trunk/src/language/jump_de.properties  2020-01-28 23:38:15 UTC (rev 
6227)
@@ -2962,3 +2962,4 @@
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.order-by-attribute-tooltip=#T:Attribute
 used to sort points belonging to a path
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.use-selection=#T:Use
 selection only
 com.vividsolutions.wms.AbstractParser.wms-parser-not-found=#T:Mandatory 
element <{0}> not found in the GetCapabilities,\nThere may be a WMS version 
problem!
+org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.non-point-warning=#T:Some
 geometries in the layer are not points : they will be excluded

Modified: core/trunk/src/language/jump_es.properties
===================================================================
--- core/trunk/src/language/jump_es.properties  2020-01-28 07:54:17 UTC (rev 
6226)
+++ core/trunk/src/language/jump_es.properties  2020-01-28 23:38:15 UTC (rev 
6227)
@@ -2940,3 +2940,4 @@
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.order-by-attribute-tooltip=#T:Attribute
 used to sort points belonging to a path
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.use-selection=#T:Use
 selection only
 com.vividsolutions.wms.AbstractParser.wms-parser-not-found=#T:Mandatory 
element <{0}> not found in the GetCapabilities,\nThere may be a WMS version 
problem!
+org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.non-point-warning=#T:Some
 geometries in the layer are not points : they will be excluded

Modified: core/trunk/src/language/jump_fi.properties
===================================================================
--- core/trunk/src/language/jump_fi.properties  2020-01-28 07:54:17 UTC (rev 
6226)
+++ core/trunk/src/language/jump_fi.properties  2020-01-28 23:38:15 UTC (rev 
6227)
@@ -2939,3 +2939,4 @@
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.order-by-attribute-tooltip=#T:Attribute
 used to sort points belonging to a path
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.use-selection=#T:Use
 selection only
 com.vividsolutions.wms.AbstractParser.wms-parser-not-found=#T:Mandatory 
element <{0}> not found in the GetCapabilities,\nThere may be a WMS version 
problem!
+org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.non-point-warning=#T:Some
 geometries in the layer are not points : they will be excluded

Modified: core/trunk/src/language/jump_fr.properties
===================================================================
--- core/trunk/src/language/jump_fr.properties  2020-01-28 07:54:17 UTC (rev 
6226)
+++ core/trunk/src/language/jump_fr.properties  2020-01-28 23:38:15 UTC (rev 
6227)
@@ -2971,3 +2971,4 @@
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.order-by-attribute-tooltip=Attribute
 utilis\xE9 pour d\xE9finir l'ordre des points le long du chemin
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.use-selection=Utiliser
 uniquement la s\xE9lection
 com.vividsolutions.wms.AbstractParser.wms-parser-not-found=L''\xE9lement 
obligatoire <{0}> n''a pas \xE9t\xE9 trouv\xE9 dans le GetCapabilities,\nCela 
peut \xEAtre d\xFB \xE0 un probl\xE8me de version WMS!
+org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.non-point-warning=Certaines
 g\xE9om\xE9tries de la couche ne sont pas des points. Elles seront exclues du 
r\xE9sultat.

Modified: core/trunk/src/language/jump_hu.properties
===================================================================
--- core/trunk/src/language/jump_hu.properties  2020-01-28 07:54:17 UTC (rev 
6226)
+++ core/trunk/src/language/jump_hu.properties  2020-01-28 23:38:15 UTC (rev 
6227)
@@ -2958,3 +2958,4 @@
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.order-by-attribute-tooltip=#T:Attribute
 used to sort points belonging to a path
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.use-selection=#T:Use
 selection only
 com.vividsolutions.wms.AbstractParser.wms-parser-not-found=#T:Mandatory 
element <{0}> not found in the GetCapabilities,\nThere may be a WMS version 
problem!
+org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.non-point-warning=#T:Some
 geometries in the layer are not points : they will be excluded

Modified: core/trunk/src/language/jump_it.properties
===================================================================
--- core/trunk/src/language/jump_it.properties  2020-01-28 07:54:17 UTC (rev 
6226)
+++ core/trunk/src/language/jump_it.properties  2020-01-28 23:38:15 UTC (rev 
6227)
@@ -2942,3 +2942,4 @@
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.order-by-attribute-tooltip=#T:Attribute
 used to sort points belonging to a path
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.use-selection=#T:Use
 selection only
 com.vividsolutions.wms.AbstractParser.wms-parser-not-found=#T:Mandatory 
element <{0}> not found in the GetCapabilities,\nThere may be a WMS version 
problem!
+org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.non-point-warning=#T:Some
 geometries in the layer are not points : they will be excluded

Modified: core/trunk/src/language/jump_ja_JP.properties
===================================================================
--- core/trunk/src/language/jump_ja_JP.properties       2020-01-28 07:54:17 UTC 
(rev 6226)
+++ core/trunk/src/language/jump_ja_JP.properties       2020-01-28 23:38:15 UTC 
(rev 6227)
@@ -2964,3 +2964,4 @@
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.order-by-attribute-tooltip=#T:Attribute
 used to sort points belonging to a path
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.use-selection=#T:Use
 selection only
 com.vividsolutions.wms.AbstractParser.wms-parser-not-found=#T:Mandatory 
element <{0}> not found in the GetCapabilities,\nThere may be a WMS version 
problem!
+org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.non-point-warning=#T:Some
 geometries in the layer are not points : they will be excluded

Modified: core/trunk/src/language/jump_ml.properties
===================================================================
--- core/trunk/src/language/jump_ml.properties  2020-01-28 07:54:17 UTC (rev 
6226)
+++ core/trunk/src/language/jump_ml.properties  2020-01-28 23:38:15 UTC (rev 
6227)
@@ -3739,3 +3739,4 @@
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.order-by-attribute-tooltip=#T:Attribute
 used to sort points belonging to a path
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.use-selection=#T:Use
 selection only
 com.vividsolutions.wms.AbstractParser.wms-parser-not-found=#T:Mandatory 
element <{0}> not found in the GetCapabilities,\nThere may be a WMS version 
problem!
+org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.non-point-warning=#T:Some
 geometries in the layer are not points : they will be excluded

Modified: core/trunk/src/language/jump_pt.properties
===================================================================
--- core/trunk/src/language/jump_pt.properties  2020-01-28 07:54:17 UTC (rev 
6226)
+++ core/trunk/src/language/jump_pt.properties  2020-01-28 23:38:15 UTC (rev 
6227)
@@ -2963,3 +2963,4 @@
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.order-by-attribute-tooltip=#T:Attribute
 used to sort points belonging to a path
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.use-selection=#T:Use
 selection only
 com.vividsolutions.wms.AbstractParser.wms-parser-not-found=#T:Mandatory 
element <{0}> not found in the GetCapabilities,\nThere may be a WMS version 
problem!
+org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.non-point-warning=#T:Some
 geometries in the layer are not points : they will be excluded

Modified: core/trunk/src/language/jump_pt_BR.properties
===================================================================
--- core/trunk/src/language/jump_pt_BR.properties       2020-01-28 07:54:17 UTC 
(rev 6226)
+++ core/trunk/src/language/jump_pt_BR.properties       2020-01-28 23:38:15 UTC 
(rev 6227)
@@ -2963,3 +2963,4 @@
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.order-by-attribute-tooltip=#T:Attribute
 used to sort points belonging to a path
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.use-selection=#T:Use
 selection only
 com.vividsolutions.wms.AbstractParser.wms-parser-not-found=#T:Mandatory 
element <{0}> not found in the GetCapabilities,\nThere may be a WMS version 
problem!
+org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.non-point-warning=#T:Some
 geometries in the layer are not points : they will be excluded

Modified: core/trunk/src/language/jump_ta_IN.properties
===================================================================
--- core/trunk/src/language/jump_ta_IN.properties       2020-01-28 07:54:17 UTC 
(rev 6226)
+++ core/trunk/src/language/jump_ta_IN.properties       2020-01-28 23:38:15 UTC 
(rev 6227)
@@ -2961,3 +2961,4 @@
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.order-by-attribute-tooltip=#T:Attribute
 used to sort points belonging to a path
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.use-selection=#T:Use
 selection only
 com.vividsolutions.wms.AbstractParser.wms-parser-not-found=#T:Mandatory 
element <{0}> not found in the GetCapabilities,\nThere may be a WMS version 
problem!
+org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.non-point-warning=#T:Some
 geometries in the layer are not points : they will be excluded

Modified: core/trunk/src/language/jump_te.properties
===================================================================
--- core/trunk/src/language/jump_te.properties  2020-01-28 07:54:17 UTC (rev 
6226)
+++ core/trunk/src/language/jump_te.properties  2020-01-28 23:38:15 UTC (rev 
6227)
@@ -3469,3 +3469,4 @@
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.order-by-attribute-tooltip=#T:Attribute
 used to sort points belonging to a path
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.use-selection=#T:Use
 selection only
 com.vividsolutions.wms.AbstractParser.wms-parser-not-found=#T:Mandatory 
element <{0}> not found in the GetCapabilities,\nThere may be a WMS version 
problem!
+org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.non-point-warning=#T:Some
 geometries in the layer are not points : they will be excluded

Modified: core/trunk/src/language/jump_zh_CN.properties
===================================================================
--- core/trunk/src/language/jump_zh_CN.properties       2020-01-28 07:54:17 UTC 
(rev 6226)
+++ core/trunk/src/language/jump_zh_CN.properties       2020-01-28 23:38:15 UTC 
(rev 6227)
@@ -3126,3 +3126,4 @@
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.order-by-attribute-tooltip=#T:Attribute
 used to sort points belonging to a path
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.use-selection=#T:Use
 selection only
 com.vividsolutions.wms.AbstractParser.wms-parser-not-found=#T:Mandatory 
element <{0}> not found in the GetCapabilities,\nThere may be a WMS version 
problem!
+org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.non-point-warning=#T:Some
 geometries in the layer are not points : they will be excluded

Modified: core/trunk/src/language/jump_zh_HK.properties
===================================================================
--- core/trunk/src/language/jump_zh_HK.properties       2020-01-28 07:54:17 UTC 
(rev 6226)
+++ core/trunk/src/language/jump_zh_HK.properties       2020-01-28 23:38:15 UTC 
(rev 6227)
@@ -3125,3 +3125,4 @@
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.order-by-attribute-tooltip=#T:Attribute
 used to sort points belonging to a path
 
org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.use-selection=#T:Use
 selection only
 com.vividsolutions.wms.AbstractParser.wms-parser-not-found=#T:Mandatory 
element <{0}> not found in the GetCapabilities,\nThere may be a WMS version 
problem!
+org.openjump.core.ui.plugin.tools.geometrychange.PointsToPathsPlugIn.non-point-warning=#T:Some
 geometries in the layer are not points : they will be excluded

Modified: 
core/trunk/src/org/openjump/core/ui/plugin/tools/geometrychange/PointsToPathsPlugIn.java
===================================================================
--- 
core/trunk/src/org/openjump/core/ui/plugin/tools/geometrychange/PointsToPathsPlugIn.java
    2020-01-28 07:54:17 UTC (rev 6226)
+++ 
core/trunk/src/org/openjump/core/ui/plugin/tools/geometrychange/PointsToPathsPlugIn.java
    2020-01-28 23:38:15 UTC (rev 6227)
@@ -1,6 +1,7 @@
 package org.openjump.core.ui.plugin.tools.geometrychange;
 
 import com.vividsolutions.jts.geom.CoordinateList;
+import com.vividsolutions.jts.geom.Point;
 import com.vividsolutions.jump.I18N;
 import com.vividsolutions.jump.feature.*;
 import com.vividsolutions.jump.task.TaskMonitor;
@@ -85,16 +86,21 @@
                     ): layer.getFeatureCollectionWrapper().getFeatures();
             Map<Object,List<Feature>> map = new HashMap<>();
             String keyName = getStringParam(P_GROUP_BY_ATTRIBUTE);
+            int countNonPoint = 0;
             for (Feature feature : input) {
-                Object key = (keyName == null) ? "" : 
feature.getAttribute(keyName);
-                System.out.println("Get key for " + feature.getID() + " :" + 
key);
-                List<Feature> list = map.get(key);
-                if (list == null) {
-                    list = new ArrayList<>();
-                    map.put(key, list);
-                }
-                list.add(feature);
+                if (feature.getGeometry() instanceof Point) {
+                    Object key = (keyName == null) ? "" : 
feature.getAttribute(keyName);
+                    List<Feature> list = map.get(key);
+                    if (list == null) {
+                        list = new ArrayList<>();
+                        map.put(key, list);
+                    }
+                    list.add(feature);
+                } else { countNonPoint++; }
             }
+            if (countNonPoint > 0) {
+                context.getWorkbenchFrame().warnUser(I18N.get(KEY + 
".non-point-warning"));
+            }
             Comparator<Feature> comparator = Comparator.comparing(new 
Function<Feature,Comparable>() {
                 public Comparable apply(Feature f) {
                     if (f.getSchema().hasAttribute(orderByAttribute)) {



_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to