Re: [JPP-Devel] ExtractLayerByGeometry

2016-09-17 Thread Michaël Michaud

Hi Jukka,

I just noticed that you already wrote a FR about this :


   #211 Easy extraxt layers for saving to shapefiles

Let me know if new options covers this FR so that I can close it.

Michaël


Le 15/09/2016 à 19:54, Stefan Steiniger a écrit :

Hi,

sounds good. I think I just sorted all GeomColl types into one layer for
ease of use/lazyness as I had to deal with non-empty GeomCollections
(btw. for instance a cycle path or hiking trail (or even a lake shore?)
may be modeled as a collection). So if you just put them in separate
layers at the end this seems fine to me. If all of them are "explodable"
(in a sense making way), I don't know. Would need to explore OSM files
in detail again.

thanks for improving this,
stefan

On 9/15/16 03:15, Michaël Michaud wrote:

Hi Stefan,

Current plugin with option decompose checked is OK  for me (I think this
is the one you need for OSM and I want to keep it)
-> every original geometry component goes in one of Point/LineString/Polygon

but current plugin with "decompose unchecked" produces the following
Empty -> empty layer
Point -> Point layer
LineString -> LineString layer
Polygon -> Polygon Layer
MultiPoint, MultiLineString, MultiPolygon, GeometryCollection -> Mixed layer

This one seems useless to me (except if you confirm this option is also
need to process osm) and I want to replace it by other propositions
which makes more sense (shapefile like or geometry dimension)

Let me know if I understood your comment correctly.

Michaël


Le 15/09/2016 à 03:29, Stefan Steiniger a écrit :

Hey,

rather than valuing Michaels proposal. Just a comment: If I remember
correctly I did this change with the GeometryCollections to further
process (split) a previously imported OpenStreetMap *.osm file
(resulting in one Layer with everything mixed up). And I also think that
I used the empty GeometryCollection trick to get some OSM objects loaded
that may have no geometry (similar trick as with loading csv table?). So
if Michaels changes still allow me to load and split (arbitrary) osm
files, I am happy with it :)

cheers,
stefan

On 9/14/16 18:31, Michaël Michaud wrote:

Hi list,

ExtractLayerByGeometry is a very useful tool, but after several
revisions, its semantic is still not the one I'd like:

first version (beckerl)
empty features -> deleted
(multi)point -> first layer
(multi)linestring -> second layer
(multi)polygon -> third layer

second version (beckerl)
geometrycollection : decompose to simple geometries
point -> first layer
linestring -> second layer
polygon -> third layer

third version (mmichaud)
same as previous but put empty geometrycollection in a separate layer

fourth (last) version (mentaer)
option explode geometries
yes -> same as previous
no -> all geometrycollections (including multi*) go to the same "mixed"
layer

What I want
radio button 1 : extract simple types (point / linestring / polygon)
after explosion of all geometrycollections and multi*
radio button 2 : extract by shapefile base types (point / polyline /
polygon / multipoint) + geometryCollection for true GeometryCollection
radio button 3 : extract by dimension ((multi)point / (multi)linestring
/ (multi)polygon) + geometryCollection for true GeometryCollection
- option : empty geometries in a separate layer

Any comment ?

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

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

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


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



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


[JPP-Devel] SVN: [5020] core/trunk

2016-09-17 Thread jump-pilot-svn
Revision: 5020
  http://sourceforge.net/p/jump-pilot/code/5020
Author:   michaudm
Date: 2016-09-17 16:51:08 + (Sat, 17 Sep 2016)
Log Message:
---
Fix bug happening when modifying schema two times with InfoPanel opened

Modified Paths:
--
core/trunk/ChangeLog
core/trunk/src/com/vividsolutions/jump/workbench/ui/AttributePanel.java
core/trunk/src/com/vividsolutions/jump/workbench/ui/InfoModel.java

Modified: core/trunk/ChangeLog
===
--- core/trunk/ChangeLog2016-09-17 14:02:43 UTC (rev 5019)
+++ core/trunk/ChangeLog2016-09-17 16:51:08 UTC (rev 5020)
@@ -5,6 +5,7 @@
 
 2016-09-17 mmichaud 
   * FR #235 : Improved ExtractLayersByGeometryPlugIn
+  * Fix bug happening when modifying schema two times with InfoPanel opened
 
 2016-09-10 mmichaud 
   * bugfix : old postgis driver could not save layer with pk != dbid

Modified: 
core/trunk/src/com/vividsolutions/jump/workbench/ui/AttributePanel.java
===
--- core/trunk/src/com/vividsolutions/jump/workbench/ui/AttributePanel.java 
2016-09-17 14:02:43 UTC (rev 5019)
+++ core/trunk/src/com/vividsolutions/jump/workbench/ui/AttributePanel.java 
2016-09-17 16:51:08 UTC (rev 5020)
@@ -30,6 +30,7 @@
  * www.vividsolutions.com
  */
 package com.vividsolutions.jump.workbench.ui;
+
 import java.awt.*;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
@@ -45,6 +46,7 @@
 import com.vividsolutions.jump.workbench.WorkbenchContext;
 import com.vividsolutions.jump.workbench.model.Layer;
 import com.vividsolutions.jump.workbench.model.LayerManagerProxy;
+import com.vividsolutions.jump.workbench.model.Layerable;
 import com.vividsolutions.jump.workbench.ui.zoom.PanToSelectedItemsPlugIn;
 import com.vividsolutions.jump.workbench.ui.zoom.ZoomToSelectedItemsPlugIn;
 
@@ -56,7 +58,7 @@
 
 //private SelectionManager selectionManager;
 private GridBagLayout gridBagLayout1 = new GridBagLayout();
-private HashMap layerToTablePanelMap = new HashMap();
+private HashMap layerToTablePanelMap = new 
HashMap();
 private InfoModel model;
 private WorkbenchContext workbenchContext;
 private ZoomToSelectedItemsPlugIn zoomToSelectedItemsPlugIn =
@@ -116,7 +118,7 @@
 }
 }
 public AttributeTablePanel getTablePanel(Layer layer) {
-return (AttributeTablePanel) layerToTablePanelMap.get(layer);
+return layerToTablePanelMap.get(layer);
 }
 public InfoModel getModel() {
 return model;
@@ -391,11 +393,11 @@
 return getTablePanel(nextLayer());
 }
 private Layer previousLayer() {
-return (Layer) getModel().getLayers().get(
+return getModel().getLayers().get(
 getModel().getLayers().indexOf(panel.getModel().getLayer()) - 
1);
 }
 private Layer nextLayer() {
-return (Layer) getModel().getLayers().get(
+return getModel().getLayers().get(
 getModel().getLayers().indexOf(panel.getModel().getLayer()) + 
1);
 }
 public Feature getFeature() {

Modified: core/trunk/src/com/vividsolutions/jump/workbench/ui/InfoModel.java
===
--- core/trunk/src/com/vividsolutions/jump/workbench/ui/InfoModel.java  
2016-09-17 14:02:43 UTC (rev 5019)
+++ core/trunk/src/com/vividsolutions/jump/workbench/ui/InfoModel.java  
2016-09-17 16:51:08 UTC (rev 5020)
@@ -40,6 +40,7 @@
 
 
 public class InfoModel {
+
 /**
  * Releases references to the data, to facilitate garbage collection.
  * Important for MDI apps like the JCS Workbench.
@@ -87,6 +88,7 @@
 }
 
 public void remove(Layer layer) {
+if (!layerToTableModelMap.containsKey(layer)) return;
 LayerTableModel layerTableModel = getTableModel(layer);
 
 for (Iterator i = listeners.iterator(); i.hasNext();) {
@@ -94,7 +96,7 @@
 listener.layerRemoved(layerTableModel);
 }
 
-((LayerTableModel) layerToTableModelMap.get(layer)).dispose();
+layerToTableModelMap.get(layer).dispose();
 layerToTableModelMap.remove(layer);
 }
 
@@ -112,7 +114,7 @@
 layerToTableModelMap.put(layer, new LayerTableModel(layer));
 }
 
-return (LayerTableModel) layerToTableModelMap.get(layer);
+return layerToTableModelMap.get(layer);
 }
 
 public List getLayers() {


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


[JPP-Devel] SVN: [5019] core/trunk

2016-09-17 Thread jump-pilot-svn
Revision: 5019
  http://sourceforge.net/p/jump-pilot/code/5019
Author:   michaudm
Date: 2016-09-17 14:02:43 + (Sat, 17 Sep 2016)
Log Message:
---
Improved ExtractLayersByGeometryPlugIn

Modified Paths:
--
core/trunk/ChangeLog
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/datastore/postgis/PostGISSaveDriverPanel.java

core/trunk/src/org/openjump/core/ui/plugin/layer/ExtractLayersByGeometry.java

Modified: core/trunk/ChangeLog
===
--- core/trunk/ChangeLog2016-09-17 09:50:59 UTC (rev 5018)
+++ core/trunk/ChangeLog2016-09-17 14:02:43 UTC (rev 5019)
@@ -3,6 +3,9 @@
 # 2. make sure that lines break at 80 chars for constricted display situations
 #< 80 chars 
-->#
 
+2016-09-17 mmichaud 
+  * FR #235 : Improved ExtractLayersByGeometryPlugIn
+
 2016-09-10 mmichaud 
   * bugfix : old postgis driver could not save layer with pk != dbid
 

Modified: core/trunk/src/language/jump.properties
===
--- core/trunk/src/language/jump.properties 2016-09-17 09:50:59 UTC (rev 
5018)
+++ core/trunk/src/language/jump.properties 2016-09-17 14:02:43 UTC (rev 
5019)
@@ -538,20 +538,22 @@
 
org.openjump.core.ui.plugin.datastore.postgis.PostGISSaveDataSourceQueryChooser.no-table-choosen
 = No table choosen\!
 
org.openjump.core.ui.plugin.datastore.postgis.PostGISSaveDataSourceQueryChooser.selected-connection-is-not-postgis
 = Selected connection is not a PostGIS connection\!
 
org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.create-database-primary-key
 = Create a database Primary Key
-org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.create-or-replace
 = Create new or replace existing table
-org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.create-or-replace-help-string
 = Create a new table or replace existing table.
-org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.insert-only = 
Insert all features as new rows
-org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.insert-only-help-string
 = Insert all features as new rows.
-org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.insert-or-update
 = Insert or update rows using identifiers
-org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.insert-or-update-help-string
 = Insert features if they do not already exist in the table and update 
existing features.
-org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.insert-update-or-delete
 = Insert, update or delete rows using identifiers
-org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.insert-update-or-delete-help-string
 = WARNING \!\n\
+org.openjump.core.ui.plugin.datastore.postgis.PostGISSaveDriverPanel.create-or-replace
 = Create new or replace existing table
+org.openjump.core.ui.plugin.datastore.postgis.PostGISSaveDriverPanel.create-or-replace-help-string
 = Create a new table or replace existing table.
+org.openjump.core.ui.plugin.datastore.postgis.PostGISSaveDriverPanel.insert-only
 = Insert all features as new rows
+org.openjump.core.ui.plugin.datastore.postgis.PostGISSaveDriverPanel.insert-only-help-string
 = Insert all features as new rows.
+org.openjump.core.ui.plugin.datastore.postgis.PostGISSaveDriverPanel.insert-or-update
 = Insert or update rows using identifiers
+org.openjump.core.ui.plugin.datastore.postgis.PostGISSaveDriverPanel.insert-or-update-help-string
 = Insert features if they do not already exist in the table and update 
existing features.
+org.openjump.core.ui.plugin.datastore.postgis.PostGISSaveDriverPanel.insert-update-or-delete
 = Insert, update or delete rows using identifiers
+org.openjump.core.ui.plugin.datastore.postgis.PostGISSaveDriverPanel.insert-update-or-delete-help-string
 = WARNING \!\n\
Insert new features, update existing features and delete rows which do 
not match a layer feature.
-org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.primary_key = 
Primary Key