Revision: 6649 http://sourceforge.net/p/jump-pilot/code/6649 Author: michaudm Date: 2020-12-19 23:57:38 +0000 (Sat, 19 Dec 2020) Log Message: ----------- replace MergeSelectedPolygonsWithNeighbourPlugIn by MergePolygonsWithNeighbourPlugIn :faster, transactional, more options
Modified Paths: -------------- core/trunk/ChangeLog core/trunk/scripts/default-plugins.xml 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/analysis/onelayer/MergeSelectedPolygonsWithNeighbourPlugIn.java Added Paths: ----------- core/trunk/src/org/openjump/core/ui/plugin/tools/analysis/onelayer/MergePolygonsWithNeighbourPlugIn.java Modified: core/trunk/ChangeLog =================================================================== --- core/trunk/ChangeLog 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/ChangeLog 2020-12-19 23:57:38 UTC (rev 6649) @@ -3,6 +3,9 @@ # 2. make sure that lines break at 80 chars for constricted display situations # 3. be concise but convey the change in a way that ordinary users understand #<-------------------------------- 80 chars ----------------------------------> +2020-12-20 mmichaud + * replaced MergeSelectedPolygonsWithNeighbourPlugIn by + MergePolygonsWithNeighbourPlugIn :faster, transactional, more options 2020-11-25 mmichaud * fix #516 modeler, z-interpolation was incorrect and transaction Modified: core/trunk/scripts/default-plugins.xml =================================================================== --- core/trunk/scripts/default-plugins.xml 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/scripts/default-plugins.xml 2020-12-19 23:57:38 UTC (rev 6649) @@ -825,8 +825,11 @@ <plug-in> org.openjump.core.ui.plugin.tools.MergeTwoSelectedPolygonsPlugIn </plug-in> + <!--plug-in> + org.openjump.core.ui.plugin.tools.analysis.onelayer.MergeSelectedPolygonsWithNeighbourPlugIn + </plug-in--> <plug-in> - org.openjump.core.ui.plugin.tools.analysis.onelayer.MergeSelectedPolygonsWithNeighbourPlugIn + org.openjump.core.ui.plugin.tools.analysis.onelayer.MergePolygonsWithNeighbourPlugIn </plug-in> <plug-in> org.openjump.core.ui.plugin.tools.SplitPolygonPlugIn Modified: core/trunk/src/language/jump.properties =================================================================== --- core/trunk/src/language/jump.properties 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/src/language/jump.properties 2020-12-19 23:57:38 UTC (rev 6649) @@ -1574,6 +1574,9 @@ org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.merge-with-neighbor-that-has-the-largest-area = merge with neighbor that has the largest area org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.merge-with-neighbor-with-the-longest-common-edge = merge with neighbor with the longest common edge org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.merged = merged +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute = Use an attribute +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute-tooltip = Only merge with features having the same attribute value +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Attribute = Select the attribute org.openjump.core.ui.plugin.tools.MergeTwoSelectedPolygonsPlugIn.Merge-Two-Polygons = Merge Two Polygons org.openjump.core.ui.plugin.tools.MultiRingBufferSelectedPlugIn.Multiple-Ring-Buffer = Multiple Ring Buffer org.openjump.core.ui.plugin.tools.MultiRingBufferSelectedPlugIn.Reset-all-buffer-options = Reset all buffer options @@ -3005,4 +3008,5 @@ org.openjump.core.ui.plugin.style.StylePlugIns.import-style=Import style com.vividsolutions.jump.workbench.ui.task.TaskMonitorManager.kill-process=Kill process com.vividsolutions.jump.workbench.ui.task.TaskMonitorManager.kill-process-warning=Warning: Killing the process may result in data corruption or data loss.\n Are you sure you want to kill the process? -com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=No georeference found \ No newline at end of file +com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=No georeference found +org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.statistics= \ No newline at end of file Modified: core/trunk/src/language/jump_cz.properties =================================================================== --- core/trunk/src/language/jump_cz.properties 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/src/language/jump_cz.properties 2020-12-19 23:57:38 UTC (rev 6649) @@ -2984,3 +2984,6 @@ ui.plugin.tools.generate.RasterizePlugIn.expand-one-cell-tip=\#T\:Expands the extension layer but this can generate area of no data at the borders ui.plugin.tools.generate.RasterizePlugIn.load-raster=\#T\:Load output raster into the view com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=\\#T\\:No georeference found +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Attribute=#T:Select the attribute +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute-tooltip=#T:Only merge with features having the same attribute value +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute=#T:Use an attribute Modified: core/trunk/src/language/jump_de.properties =================================================================== --- core/trunk/src/language/jump_de.properties 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/src/language/jump_de.properties 2020-12-19 23:57:38 UTC (rev 6649) @@ -2977,3 +2977,6 @@ ui.plugin.tools.generate.RasterizePlugIn.expand-one-cell-tip=\#T\:Expands the extension layer but this can generate area of no data at the borders ui.plugin.tools.generate.RasterizePlugIn.load-raster=\#T\:Load output raster into the view com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=#T:No georeference found +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Attribute=#T:Select the attribute +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute-tooltip=#T:Only merge with features having the same attribute value +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute=#T:Use an attribute Modified: core/trunk/src/language/jump_es.properties =================================================================== --- core/trunk/src/language/jump_es.properties 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/src/language/jump_es.properties 2020-12-19 23:57:38 UTC (rev 6649) @@ -2954,4 +2954,7 @@ ui.plugin.tools.generate.RasterizePlugIn.expand-one-cell=Expandir un tama\xF1o de celda para cada direcci\xF3n ui.plugin.tools.generate.RasterizePlugIn.expand-one-cell-tip=Expande la extensi\xF3n de la capa pero esto puede generar un \xE1rea sin datos en los bordes ui.plugin.tools.generate.RasterizePlugIn.load-raster=Cargar r\xE1ster de salida en la vista -com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=Ninguna referencia geografica encontrada \ No newline at end of file +com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=Ninguna referencia geografica encontrada +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Attribute=#T:Select the attribute +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute-tooltip=#T:Only merge with features having the same attribute value +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute=#T:Use an attribute \ No newline at end of file Modified: core/trunk/src/language/jump_fi.properties =================================================================== --- core/trunk/src/language/jump_fi.properties 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/src/language/jump_fi.properties 2020-12-19 23:57:38 UTC (rev 6649) @@ -2954,3 +2954,6 @@ ui.plugin.tools.generate.RasterizePlugIn.expand-one-cell-tip=\#T\:Expands the extension layer but this can generate area of no data at the borders ui.plugin.tools.generate.RasterizePlugIn.load-raster=\#T\:Load output raster into the view com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=#T:No georeference found +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Attribute=#T:Select the attribute +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute-tooltip=#T:Only merge with features having the same attribute value +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute=#T:Use an attribute Modified: core/trunk/src/language/jump_fr.properties =================================================================== --- core/trunk/src/language/jump_fr.properties 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/src/language/jump_fr.properties 2020-12-19 23:57:38 UTC (rev 6649) @@ -1333,12 +1333,12 @@ org.openjump.core.ui.plugin.tools.MeasureM_FTool.meters = m\u00e8tres org.openjump.core.ui.plugin.tools.MeasurementStyle.area = Surface\: org.openjump.core.ui.plugin.tools.MeasurementStyle.distance = Distance\: -org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Merge-Selected-Polygons-with-Neighbours = Fusionner le polygone avec ses voisins +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Merge-Selected-Polygons-with-Neighbours=Fusionner les polygones avec leur voisin org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Merging-polygons = Fusion des polygones... -org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Please-chose-the-merge-method = Choisir la m\u00e9thode de fusion\: +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Please-chose-the-merge-method=Choisir la m\u00e9thode de fusion: org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Searching-for-merge-candidates = Recherche des candidats... -org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.description = Fusionne les polygones s\u00e9lectionn\u00e9s avec tous leurs voisins, avec le plus grand de leurs voisins ou avec celui qui partage la plus longue fronti\u00e8re. Note\: la fonction peut renvoyer des multi-polygones si les polygones \u00e0 fusionner n'ont qu'un point commun. -org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.features-from-different-layers = Erreur\: Les objets appartiennent \u00e0 des couches diff\u00e9rentes\! +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.description=Fusionne les polygones s\u00e9lectionn\u00e9s avec tous leurs voisins, avec le plus grand de leurs voisins ou avec celui qui partage la plus longue fronti\u00e8re. Note: la fonction peut renvoyer des multi-polygones si les polygones \u00e0 fusionner n'ont qu'un point commun. +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.features-from-different-layers=Erreur: Les objets appartiennent \u00e0 des couches diff\u00e9rentes! org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.merge-with-neighbor-that-has-the-largest-area = Fusionner avec le polygone voisin de plus grande surface org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.merge-with-neighbor-with-the-longest-common-edge = Fusionner avec le polygone voisin ayant la plus grande fronti\u00e8re commune org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.merged = fusionn\u00e9s @@ -2846,7 +2846,6 @@ org.openjump.core.ui.plugin.edittoolbox.cursortools.RemodelerTool.geometrycollection-cannot-be-processed=Les GeometryCollections ne peut \xEAtre trait\xE9es com.vividsolutions.jump.workbench.model.Layer=Couche vecteur com.vividsolutions.jump.workbench.imagery.ReferencedImagesLayer=Couche image g\xE9or\xE9f\xE9renc\xE9e -com.vividsolutions.jump.workbench.imagery.ReferencedImageException=#T:Failed to open "{0}" with "{1}" driver.\n\n Try another driver and check the image for corruption. jump.plugin.edit.AffineTransformationPlugIn.image-options=Options pour les images jump.plugin.edit.AffineTransformationPlugIn.force-image-warp=Appliquer la transformation affine aux images jump.plugin.edit.AffineTransformationPlugIn.resize-image=Redimensionner l'image (r\xE9duire sa r\xE9solution) @@ -2990,3 +2989,6 @@ ui.plugin.tools.generate.RasterizePlugIn.expand-one-cell-tip=\#T\:Expands the extension layer but this can generate area of no data at the borders ui.plugin.tools.generate.RasterizePlugIn.load-raster=\#T\:Load output raster into the view com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=Aucun g\xE9or\xE9f\xE9rencement trouv\xE9 +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Attribute=S\xE9lectionner l'attribut +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute-tooltip=Fusionner uniquement avec des objets de m\xEAme valeur d'attribut +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute=Utiliser un attribut Modified: core/trunk/src/language/jump_hu.properties =================================================================== --- core/trunk/src/language/jump_hu.properties 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/src/language/jump_hu.properties 2020-12-19 23:57:38 UTC (rev 6649) @@ -2975,3 +2975,6 @@ ui.plugin.tools.generate.RasterizePlugIn.expand-one-cell-tip=\#T\:Expands the extension layer but this can generate area of no data at the borders ui.plugin.tools.generate.RasterizePlugIn.load-raster=\#T\:Load output raster into the view com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=#T:No georeference found +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Attribute=#T:Select the attribute +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute-tooltip=#T:Only merge with features having the same attribute value +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute=#T:Use an attribute Modified: core/trunk/src/language/jump_it.properties =================================================================== --- core/trunk/src/language/jump_it.properties 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/src/language/jump_it.properties 2020-12-19 23:57:38 UTC (rev 6649) @@ -2956,4 +2956,7 @@ ui.plugin.tools.generate.RasterizePlugIn.expand-one-cell=Espandi di una cella per tutte le direzioni ui.plugin.tools.generate.RasterizePlugIn.expand-one-cell-tip=Espandi la estensione del livello am potrebbe generale valori nodata ai bordi ui.plugin.tools.generate.RasterizePlugIn.load-raster=Carica il raster risultante nella vista -com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=Nessun riferimento geografico trovato \ No newline at end of file +com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=Nessun riferimento geografico trovato +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Attribute=#T:Select the attribute +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute-tooltip=#T:Only merge with features having the same attribute value +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute=#T:Use an attribute \ No newline at end of file Modified: core/trunk/src/language/jump_ja_JP.properties =================================================================== --- core/trunk/src/language/jump_ja_JP.properties 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/src/language/jump_ja_JP.properties 2020-12-19 23:57:38 UTC (rev 6649) @@ -2979,3 +2979,6 @@ ui.plugin.tools.generate.RasterizePlugIn.expand-one-cell-tip=\#T\:Expands the extension layer but this can generate area of no data at the borders ui.plugin.tools.generate.RasterizePlugIn.load-raster=\#T\:Load output raster into the view com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=#T:No georeference found +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Attribute=#T:Select the attribute +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute-tooltip=#T:Only merge with features having the same attribute value +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute=#T:Use an attribute Modified: core/trunk/src/language/jump_ml.properties =================================================================== --- core/trunk/src/language/jump_ml.properties 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/src/language/jump_ml.properties 2020-12-19 23:57:38 UTC (rev 6649) @@ -3754,3 +3754,6 @@ ui.plugin.tools.generate.RasterizePlugIn.expand-one-cell-tip=\#T\:Expands the extension layer but this can generate area of no data at the borders ui.plugin.tools.generate.RasterizePlugIn.load-raster=\#T\:Load output raster into the view com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=#T:No georeference found +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Attribute=#T:Select the attribute +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute-tooltip=#T:Only merge with features having the same attribute value +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute=#T:Use an attribute Modified: core/trunk/src/language/jump_pt.properties =================================================================== --- core/trunk/src/language/jump_pt.properties 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/src/language/jump_pt.properties 2020-12-19 23:57:38 UTC (rev 6649) @@ -2978,3 +2978,6 @@ ui.plugin.tools.generate.RasterizePlugIn.expand-one-cell-tip=\#T\:Expands the extension layer but this can generate area of no data at the borders ui.plugin.tools.generate.RasterizePlugIn.load-raster=\#T\:Load output raster into the view com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=#T:No georeference found +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Attribute=#T:Select the attribute +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute-tooltip=#T:Only merge with features having the same attribute value +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute=#T:Use an attribute Modified: core/trunk/src/language/jump_pt_BR.properties =================================================================== --- core/trunk/src/language/jump_pt_BR.properties 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/src/language/jump_pt_BR.properties 2020-12-19 23:57:38 UTC (rev 6649) @@ -2978,3 +2978,6 @@ ui.plugin.tools.generate.RasterizePlugIn.expand-one-cell-tip=\#T\:Expands the extension layer but this can generate area of no data at the borders ui.plugin.tools.generate.RasterizePlugIn.load-raster=\#T\:Load output raster into the view com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=#T:No georeference found +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Attribute=#T:Select the attribute +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute-tooltip=#T:Only merge with features having the same attribute value +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute=#T:Use an attribute Modified: core/trunk/src/language/jump_ta_IN.properties =================================================================== --- core/trunk/src/language/jump_ta_IN.properties 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/src/language/jump_ta_IN.properties 2020-12-19 23:57:38 UTC (rev 6649) @@ -2977,3 +2977,6 @@ ui.plugin.tools.generate.RasterizePlugIn.load-raster=\#T\:Load output raster into the view com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=#T:No georeference found org.openjump.core.ui.plugin.style.LegendPlugIn.modify-label=#T:Modify Label +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Attribute=#T:Select the attribute +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute-tooltip=#T:Only merge with features having the same attribute value +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute=#T:Use an attribute Modified: core/trunk/src/language/jump_te.properties =================================================================== --- core/trunk/src/language/jump_te.properties 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/src/language/jump_te.properties 2020-12-19 23:57:38 UTC (rev 6649) @@ -3484,3 +3484,6 @@ ui.plugin.tools.generate.RasterizePlugIn.expand-one-cell-tip=\#T\:Expands the extension layer but this can generate area of no data at the borders ui.plugin.tools.generate.RasterizePlugIn.load-raster=\#T\:Load output raster into the view com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=#T:No georeference found +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Attribute=#T:Select the attribute +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute-tooltip=#T:Only merge with features having the same attribute value +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute=#T:Use an attribute Modified: core/trunk/src/language/jump_zh_CN.properties =================================================================== --- core/trunk/src/language/jump_zh_CN.properties 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/src/language/jump_zh_CN.properties 2020-12-19 23:57:38 UTC (rev 6649) @@ -3141,3 +3141,6 @@ ui.plugin.tools.generate.RasterizePlugIn.expand-one-cell-tip=\#T\:Expands the extension layer but this can generate area of no data at the borders ui.plugin.tools.generate.RasterizePlugIn.load-raster=\#T\:Load output raster into the view com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=#T:No georeference found +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Attribute=#T:Select the attribute +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute-tooltip=#T:Only merge with features having the same attribute value +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute=#T:Use an attribute Modified: core/trunk/src/language/jump_zh_HK.properties =================================================================== --- core/trunk/src/language/jump_zh_HK.properties 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/src/language/jump_zh_HK.properties 2020-12-19 23:57:38 UTC (rev 6649) @@ -2677,7 +2677,7 @@ ui.AttributeTablePanel.feature.view-edit=#T:View/Edit plugin.EnableCheckFactory.selected-layers-must-be-of-type=\#T\:Selected layers must be one of types {0} but not {1}. org.openjump.core.ui.plugin.edit.SelectByTypePlugIn.Exclude-empty-geometries=\#T\:Exclude empty geometries -org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.statistics=\#T\:Statistics +org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.statistics=#T:Statistics org.openjump.core.ui.plugin.file.open.OpenFileWizardState.dummy-loader-description=\#T\:Dummy loader (ignore data) ui.plugin.ViewSchemaPlugIn.cannot-convert-to-boolean=\#T\:Cannot convert to boolean\: ui.plugin.ViewSchemaPlugIn.cannot-convert-to-long=\#T\:Cannot convert to long\: @@ -3140,3 +3140,6 @@ ui.plugin.tools.generate.RasterizePlugIn.expand-one-cell-tip=\#T\:Expands the extension layer but this can generate area of no data at the borders ui.plugin.tools.generate.RasterizePlugIn.load-raster=\#T\:Load output raster into the view com.vividsolutions.jump.workbench.imagery.geoimg.GeoReferencedRaster.no-georeference-found=#T:No georeference found +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Attribute=#T:Select the attribute +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute-tooltip=#T:Only merge with features having the same attribute value +org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute=#T:Use an attribute Added: core/trunk/src/org/openjump/core/ui/plugin/tools/analysis/onelayer/MergePolygonsWithNeighbourPlugIn.java =================================================================== --- core/trunk/src/org/openjump/core/ui/plugin/tools/analysis/onelayer/MergePolygonsWithNeighbourPlugIn.java (rev 0) +++ core/trunk/src/org/openjump/core/ui/plugin/tools/analysis/onelayer/MergePolygonsWithNeighbourPlugIn.java 2020-12-19 23:57:38 UTC (rev 6649) @@ -0,0 +1,320 @@ +package org.openjump.core.ui.plugin.tools.analysis.onelayer; + +import com.vividsolutions.jts.geom.Geometry; +import com.vividsolutions.jts.index.SpatialIndex; +import com.vividsolutions.jts.index.strtree.STRtree; +import com.vividsolutions.jump.I18N; +import com.vividsolutions.jump.feature.Feature; +import com.vividsolutions.jump.feature.FeatureCollection; +import com.vividsolutions.jump.task.TaskMonitor; +import com.vividsolutions.jump.workbench.WorkbenchContext; +import com.vividsolutions.jump.workbench.model.Layer; +import com.vividsolutions.jump.workbench.plugin.EnableCheckFactory; +import com.vividsolutions.jump.workbench.plugin.MultiEnableCheck; +import com.vividsolutions.jump.workbench.plugin.PlugInContext; +import com.vividsolutions.jump.workbench.plugin.ThreadedBasePlugIn; +import com.vividsolutions.jump.workbench.ui.*; +import com.vividsolutions.jump.workbench.ui.plugin.FeatureInstaller; + +import javax.swing.*; +import java.util.*; + +public class MergePolygonsWithNeighbourPlugIn extends ThreadedBasePlugIn { + + private String sMergeTwoPolys = "Merge Selected Polygons with Neighbours (v2)"; + private String sFeaturesFromDifferentLayer = "Error: Features from different layers!"; + private String sSidebar = "Merges selected polygons with neighboring polygons, either with the one that is largest of " + + "all neighbors, or the one with which it has " + + "the longest common boundary. Note, the function may return multi-polygons if " + + "the polygons to merge have only one point in common."; + boolean useArea = true; + boolean useBorder = false; + String sUseArea = "merge with neighbor that has the largest area"; + String sUseBoder = "merge with neighbor with the longest common edge"; + String sChoseMergeMethod = "Please chose the merge method:"; + String sMerged = "merged"; + String sSearchingForMergeCandidates = "Searching for merge candidates..."; + String sMergingPolygons = "Merging polygons..."; + boolean useAttribute = false; + String sUseAttribute = "Use an attribute"; + String sUseAttributeTooltip = "Merge features with same attribute value only"; + String sAttributeToUse = "Attribute to use"; + String attribute = null; + String layerName; + final static String sMERGEMETHOD = "MERGE METHOD"; + + private MultiInputDialog dialog; + + public void initialize(PlugInContext context) throws Exception { + + sMergeTwoPolys = I18N.get("org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Merge-Selected-Polygons-with-Neighbours"); + sFeaturesFromDifferentLayer = I18N.get("org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.features-from-different-layers"); + sSidebar = I18N.get("org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.description"); + sUseArea = I18N.get("org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.merge-with-neighbor-that-has-the-largest-area"); + sUseBoder = I18N.get("org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.merge-with-neighbor-with-the-longest-common-edge"); + sChoseMergeMethod = I18N.get("org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Please-chose-the-merge-method"); + sMerged = I18N.get("org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.merged"); + sSearchingForMergeCandidates = I18N.get("org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Searching-for-merge-candidates"); + sMergingPolygons = I18N.get("org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Merging-polygons"); + sUseAttribute = I18N.get("org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute"); + sUseAttributeTooltip = I18N.get("org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Use-attribute-tooltip"); + sAttributeToUse = I18N.get("org.openjump.core.ui.plugin.tools.MergeSelectedPolygonsWithNeighbourPlugIn.Attribute"); + + FeatureInstaller featureInstaller = new FeatureInstaller(context.getWorkbenchContext()); + featureInstaller.addMainMenuPlugin( + this, //exe + new String[]{MenuNames.TOOLS, MenuNames.TOOLS_EDIT_GEOMETRY}, //menu path + this.getName() + "...", //name methode .getName recieved by AbstractPlugIn + false, //checkbox + null, //icon + createEnableCheck(context.getWorkbenchContext())); //enable check + } + + public String getName() { + return sMergeTwoPolys; + } + + public static MultiEnableCheck createEnableCheck(WorkbenchContext workbenchContext) { + EnableCheckFactory checkFactory = new EnableCheckFactory(workbenchContext); + + return new MultiEnableCheck() + .add(checkFactory.createWindowWithLayerNamePanelMustBeActiveCheck()) + .add(checkFactory.createAtLeastNItemsMustBeSelectedCheck(1)) + .add(checkFactory.createSelectedItemsLayersMustBeEditableCheck()); + } + + public boolean execute(PlugInContext context) throws Exception { + + Collection<Layer> layers = context.getWorkbenchContext().getLayerViewPanel().getSelectionManager().getLayersWithSelectedItems(); + if (layers.size() != 1) { + context.getWorkbenchFrame().warnUser(sFeaturesFromDifferentLayer); + return false; + } + layerName = layers.iterator().next().getName(); + + initDialog(context); + dialog.setVisible(true); + if (!dialog.wasOKPressed()) { + return false; + } else { + this.getDialogValues(dialog); + } + return true; + } + + private void initDialog(PlugInContext context) { + + dialog = new MultiInputDialog(context.getWorkbenchFrame(), this.getName(), true); + dialog.setSideBarDescription(sSidebar); + final String METHODGROUP = sMERGEMETHOD; + dialog.addLabel(sChoseMergeMethod); + dialog.addRadioButton(sUseArea, METHODGROUP, this.useArea, sUseArea); + dialog.addRadioButton(sUseBoder, METHODGROUP, this.useBorder, sUseBoder); + JCheckBox jcbUseAttribute = dialog.addCheckBox(sUseAttribute, useAttribute); + List<String> attributes = AttributeTypeFilter.NO_GEOMETRY_FILTER.filter(context.getLayerManager() + .getLayer(layerName)); + jcbUseAttribute.setEnabled(!attributes.isEmpty()); + if (!jcbUseAttribute.isEnabled()) jcbUseAttribute.setSelected(false); + JComboBox<String> jcbAttribute = dialog.addComboBox(sAttributeToUse, attribute, attributes, null); + jcbAttribute.setEnabled(jcbUseAttribute.isSelected()); + jcbUseAttribute.addActionListener(e -> jcbAttribute.setEnabled(jcbUseAttribute.isSelected())); + GUIUtil.centreOnWindow(dialog); + } + + private void getDialogValues(MultiInputDialog dialog) { + this.useArea = dialog.getBoolean(this.sUseArea); + this.useBorder = dialog.getBoolean(this.sUseBoder); + if (dialog.getBoolean(sUseAttribute)) attribute = (String)dialog.getComboBox(sAttributeToUse).getSelectedItem(); + else attribute = null; + } + + public void run(TaskMonitor monitor, PlugInContext context) throws Exception { + + monitor.allowCancellationRequests(); + context.getWorkbenchContext().getLayerManager().setFiringEvents(false); + + Layer activeLayer = context.getLayerManager().getLayer(layerName); + + FeatureCollection fc = activeLayer.getFeatureCollectionWrapper(); + STRtree index = new STRtree(); + monitor.report("Indexing..."); + for (Feature f : fc.getFeatures()) { + index.insert(f.getGeometry().getEnvelopeInternal(), f); + } + + Collection<Feature> selection = context.getWorkbenchContext().getLayerViewPanel() + .getSelectionManager().getFeaturesWithSelectedItems(); + + Map<Integer,Set<Integer>> graph = getPolygonGraph(index, selection, monitor); + // ids of a all features which may change + Set<Integer> ids = new HashSet<>(); + for (Map.Entry<Integer,Set<Integer>> entry : graph.entrySet()) { + ids.add(entry.getKey()); + ids.addAll(entry.getValue()); + } + // Preserve original geometries + Map<Integer,Feature> currentFeatures = new HashMap<>(); + Map<Integer, Geometry> sourceGeometries = new HashMap<>(); + for (Feature f : fc.getFeatures()) { + if (ids.contains(f.getID())) currentFeatures.put(f.getID(), f); + if (ids.contains(f.getID())) sourceGeometries.put(f.getID(), (Geometry)f.getGeometry().clone()); + } + + monitor.report(sMergingPolygons); + int count = 0; + for (Feature f : selection) { + Feature target = useArea ? chooseMaxAreaNeighbour(f.getID(), graph, currentFeatures) + : chooseLongestBoundaryNeighbour(f.getID(), graph, currentFeatures); + monitor.report(++count, selection.size(), sMerged); + if (target != null) { + merge(f.getID(), target.getID(), graph, currentFeatures); + //fc.remove(f); + } + } + monitor.report("Prepare transaction"); + // Preserve new calculated geometries and restore original one as + // because the graph calculation was not transactional (it is difficult + // to make it transactional beacause of its iterative nature) + Map<Integer,Geometry> newGeometries = new HashMap<>(); + ids.clear(); + for (Feature f : selection) ids.add(f.getID()); + for (int i : currentFeatures.keySet()) { + if (ids.contains(i) && !graph.containsKey(i)) newGeometries.put(i, null); + else newGeometries.put(i, currentFeatures.get(i).getGeometry()); + currentFeatures.get(i).setGeometry(sourceGeometries.get(i)); + } + + // Now make the changes within a transaction + + reportNothingToUndoYet(context); + activeLayer.getLayerManager().getUndoableEditReceiver().startReceiving(); + try { + EditTransaction transaction = new EditTransaction( + new ArrayList(), + "MergePolygonWithNeighbour", + activeLayer, + true, + true, + context.getLayerViewPanel() + ); + for (int i : currentFeatures.keySet()) { + if (!graph.containsKey(i)) + if (ids.contains(i)) { + transaction.deleteFeature(currentFeatures.get(i)); + } else { + transaction.modifyFeatureGeometry(currentFeatures.get(i), newGeometries.get(i)); + } + } + transaction.commit(); + context.getWorkbenchContext().getLayerManager().setFiringEvents(true); + context.getWorkbenchContext().getLayerViewPanel().repaint(); + transaction.commit(); + activeLayer.getLayerManager().getUndoableEditReceiver().stopReceiving(); + } + finally { + activeLayer.getLayerManager().getUndoableEditReceiver().stopReceiving(); + } + } + + // Create a map containing relations between each selected feature and adjacent features + private Map<Integer,Set<Integer>> getPolygonGraph(SpatialIndex index, + Collection<Feature> selection, + TaskMonitor monitor) { + + Map<Integer,Set<Integer>> graph = new HashMap<>(); + monitor.report("Building the graph"); + int count = 0; + int total = selection.size(); + for (Feature f : selection) { + monitor.report(++count, total, "polygons"); + if (f.getGeometry().getDimension() != 2) continue; + List<Feature> candidates = index.query(f.getGeometry().getEnvelopeInternal()); + int fid = f.getID(); + Set<Integer> neighbours = graph.get(fid); + if (neighbours == null) neighbours = new HashSet<>(); + for (Feature candidate : candidates) { + int cid = candidate.getID(); + if (cid == fid) continue; + if (candidate.getGeometry().getDimension() != 2) continue; + if (attribute != null && !Objects.equals(f.getAttribute(attribute), candidate.getAttribute(attribute))) continue; + // Non, \xE7a fait des trous ! + //if (c.getGeometry().getArea() < f.getGeometry().getArea()) continue; + if (f.getGeometry().intersects(candidate.getGeometry())) { + //if (f.getGeometry().relate(c.getGeometry(),"****1****")) { + neighbours.add(candidate.getID()); + } + } + graph.put(fid, neighbours); + } + return graph; + } + + private boolean merge(int srcId, int dstId, Map<Integer,Set<Integer>> graph, Map<Integer,Feature> currentFeatures) { + Feature src = currentFeatures.get(srcId); + Feature dst = currentFeatures.get(dstId); + dst.setGeometry(dst.getGeometry().union(src.getGeometry())); + Set<Integer> newDestSet = graph.get(dstId); + if (newDestSet != null) newDestSet.remove(srcId); + // Neighbours of src + for (Integer id : graph.get(srcId)) { + if (id != srcId && id != dstId) { + if (newDestSet != null) newDestSet.add(id); + } + if (graph.containsKey(id)) graph.get(id).remove(srcId); + } + if (graph.containsKey(dst.getID())) { + for (Integer id : graph.get(dstId)) { + if (id != srcId && id != dstId) { + if (newDestSet != null) newDestSet.add(id); + } + } + } + graph.remove(srcId); + return true; + } + + private Feature chooseMaxAreaNeighbour(int fid, Map<Integer,Set<Integer>> graph, + Map<Integer,Feature> currentFeatures) { + Set<Integer> candidates = graph.get(fid); + Feature src = currentFeatures.get(fid); + double srcArea = src.getGeometry().getArea(); + double max = 0; + Feature selected = null; + for (Integer cid : candidates) { + Feature candidate = currentFeatures.get(cid); + if (cid == fid) continue; + double area = candidate.getGeometry().getArea(); + //if (area < srcArea) continue; + if (area > max) { + max = area; + selected = candidate; + } + } + return selected; + } + + private Feature chooseLongestBoundaryNeighbour(int fid, Map<Integer,Set<Integer>> graph, + Map<Integer,Feature> currentFeatures) { + Set<Integer> candidates = graph.get(fid); + Feature src = currentFeatures.get(fid); + double srcArea = src.getGeometry().getArea(); + double max = 0; + Feature selected = null; + if (candidates != null) { + for (Integer cid : candidates) { + Feature candidate = currentFeatures.get(cid); + if (cid == fid) continue; + //if (candidate.getGeometry().getArea() < srcArea) continue; + double length = candidate.getGeometry().intersection(src.getGeometry()).getLength(); + if (length > max) { + max = length; + selected = candidate; + } + } + } else { + System.out.println("L'objet " + fid + " n'est plus dans le graph"); + } + return selected; + } + +} Modified: core/trunk/src/org/openjump/core/ui/plugin/tools/analysis/onelayer/MergeSelectedPolygonsWithNeighbourPlugIn.java =================================================================== --- core/trunk/src/org/openjump/core/ui/plugin/tools/analysis/onelayer/MergeSelectedPolygonsWithNeighbourPlugIn.java 2020-12-11 16:14:31 UTC (rev 6648) +++ core/trunk/src/org/openjump/core/ui/plugin/tools/analysis/onelayer/MergeSelectedPolygonsWithNeighbourPlugIn.java 2020-12-19 23:57:38 UTC (rev 6649) @@ -77,8 +77,9 @@ /** * @author sstein - * + * @deprecated see new MergePolygonsWithNeighbourPlugIn **/ +@Deprecated public class MergeSelectedPolygonsWithNeighbourPlugIn extends ThreadedBasePlugIn{ _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel