Revision 6752
trunk/extensions/extGeoprocessingExtensions/src/com/iver/cit/gvsig/geoprocess/impl/reproject/fmap/ReprojectGeoprocess.java | ||
---|---|---|
45 | 45 |
* |
46 | 46 |
* $Id$ |
47 | 47 |
* $Log$ |
48 |
* Revision 1.2 2006-07-04 16:43:18 azabala
|
|
48 |
* Revision 1.3 2006-08-11 17:20:32 azabala
|
|
49 | 49 |
* *** empty log message *** |
50 | 50 |
* |
51 |
* Revision 1.2 2006/07/04 16:43:18 azabala |
|
52 |
* *** empty log message *** |
|
53 |
* |
|
51 | 54 |
* Revision 1.1 2006/07/03 20:28:38 azabala |
52 | 55 |
* *** empty log message *** |
53 | 56 |
* |
... | ... | |
60 | 63 |
import org.cresques.cts.ICoordTrans; |
61 | 64 |
import org.cresques.cts.IProjection; |
62 | 65 |
import org.cresques.cts.gt2.CoordSys; |
63 |
import org.cresques.cts.gt2.CoordTrans; |
|
64 | 66 |
|
67 |
|
|
65 | 68 |
import com.hardcode.gdbms.engine.data.driver.DriverException; |
66 | 69 |
import com.hardcode.gdbms.engine.values.Value; |
67 | 70 |
import com.hardcode.gdbms.engine.values.ValueFactory; |
... | ... | |
293 | 296 |
selection = firstLayer.getRecordset().getSelection(); |
294 | 297 |
IProjection from = firstLayer.getProjection(); |
295 | 298 |
IProjection to = targetProjection; |
296 |
ICoordTrans ct = new CoordTrans((CoordSys) from, (CoordSys) to); |
|
299 |
|
|
300 |
// ICoordTrans ct = new CoordTrans((CoordSys) to, (CoordSys) from); |
|
301 |
ICoordTrans ct = from.getCT((CoordSys)to); |
|
297 | 302 |
ReprojectVisitor visitor = new ReprojectVisitor(resultLayerDefinition, |
298 | 303 |
processor, selection, ct); |
299 | 304 |
Strategy strategy = StrategyManager.getStrategy(firstLayer); |
trunk/extensions/extGeoprocessingExtensions/src/com/iver/cit/gvsig/geoprocess/impl/reproject/gui/GeoprocessingReprojectPanel.java | ||
---|---|---|
45 | 45 |
* |
46 | 46 |
* $Id$ |
47 | 47 |
* $Log$ |
48 |
* Revision 1.3 2006-07-05 06:47:26 jaume
|
|
49 |
* refactor package name for java naming convention
|
|
48 |
* Revision 1.4 2006-08-11 17:20:32 azabala
|
|
49 |
* *** empty log message ***
|
|
50 | 50 |
* |
51 | 51 |
* Revision 1.2 2006/07/04 16:43:18 azabala |
52 | 52 |
* *** empty log message *** |
... | ... | |
58 | 58 |
*/ |
59 | 59 |
package com.iver.cit.gvsig.geoprocess.impl.reproject.gui; |
60 | 60 |
|
61 |
import java.awt.BorderLayout; |
|
61 | 62 |
import java.awt.GridBagConstraints; |
63 |
import java.awt.Insets; |
|
62 | 64 |
import java.awt.event.ActionEvent; |
63 | 65 |
import java.awt.event.ActionListener; |
64 | 66 |
import java.awt.event.ItemEvent; |
65 | 67 |
|
66 | 68 |
import javax.swing.JLabel; |
69 |
import javax.swing.JPanel; |
|
67 | 70 |
|
68 | 71 |
import org.cresques.cts.IProjection; |
69 | 72 |
import org.cresques.cts.ProjectionPool; |
... | ... | |
72 | 75 |
import com.iver.andami.PluginServices; |
73 | 76 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
74 | 77 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
75 |
import com.iver.cit.gvsig.geoprocess.impl.AbstractGeoprocessGridbagPanel;
|
|
78 |
import com.iver.cit.gvsig.geoprocess.core.gui.AbstractGeoprocessGridbagPanel;
|
|
76 | 79 |
import com.iver.cit.gvsig.gui.dialogs.CSSelectionDialog; |
77 | 80 |
|
78 | 81 |
public class GeoprocessingReprojectPanel extends AbstractGeoprocessGridbagPanel { |
... | ... | |
84 | 87 |
* projection of the target layer |
85 | 88 |
*/ |
86 | 89 |
private IProjection targetLayerProjection; |
87 |
|
|
90 |
|
|
88 | 91 |
/** |
89 | 92 |
* label to show input projection name |
90 | 93 |
*/ |
91 | 94 |
private JLabel inputProjectionLabel; |
92 |
|
|
95 |
|
|
93 | 96 |
/** |
94 | 97 |
* label to show target projection name |
95 | 98 |
*/ |
96 | 99 |
private JLabel targetProjectionLabel; |
97 |
|
|
100 |
|
|
98 | 101 |
/** |
99 | 102 |
* Constructor. |
100 |
* |
|
103 |
*
|
|
101 | 104 |
*/ |
102 | 105 |
public GeoprocessingReprojectPanel(FLayers layers) { |
103 |
super(layers, |
|
104 |
PluginServices.getText(null, |
|
106 |
super(layers,
|
|
107 |
PluginServices.getText(null,
|
|
105 | 108 |
"Reproyeccion._Introduccion_de_datos")); |
106 | 109 |
} |
107 | 110 |
|
108 | 111 |
protected void addSpecificDesign() { |
112 |
Insets insets = new Insets(5, 5, 5, 5); |
|
109 | 113 |
inputLayerProjection = getInputLayer().getProjection(); |
110 | 114 |
targetLayerProjection = ProjectionPool.get("EPSG:23030"); |
111 |
inputProjectionLabel = new JLabel(inputLayerProjection.getAbrev()); |
|
112 |
targetProjectionLabel = new JLabel(targetLayerProjection.getAbrev()); |
|
113 |
addComponent(PluginServices.getText(this, "Proyeccion_Actual"), |
|
114 |
inputProjectionLabel, GridBagConstraints.NONE); |
|
115 |
|
|
116 |
addComponent(new JLabel(PluginServices.getText(this, "Proyeccion_Destino")), |
|
117 |
targetProjectionLabel, |
|
115 |
String inputProjectionText = PluginServices. |
|
116 |
getText(this, "Proyeccion_Actual")+ |
|
117 |
": "+ |
|
118 |
inputLayerProjection.getAbrev(); |
|
119 |
inputProjectionLabel = new JLabel(inputProjectionText); |
|
120 |
addComponent(inputProjectionLabel, insets); |
|
121 |
|
|
122 |
|
|
123 |
String targetProjectionText = PluginServices. |
|
124 |
getText(this, "Proyeccion_Destino")+ |
|
125 |
": " + |
|
126 |
targetLayerProjection.getAbrev(); |
|
127 |
targetProjectionLabel = new JLabel(targetProjectionText); |
|
128 |
addComponent(targetProjectionLabel, |
|
118 | 129 |
getOpenProjectionDialogButton(), |
119 |
GridBagConstraints.NONE); |
|
130 |
GridBagConstraints.REMAINDER, |
|
131 |
insets); |
|
132 |
initSelectedItemsJCheckBox(); |
|
133 |
updateNumSelectedFeaturesLabel(); |
|
120 | 134 |
} |
121 |
|
|
122 |
|
|
135 |
|
|
136 |
|
|
123 | 137 |
private JButton getOpenProjectionDialogButton(){ |
124 | 138 |
JButton solution = new JButton("..."); |
125 | 139 |
solution.addActionListener(new ActionListener(){ |
... | ... | |
128 | 142 |
csSelect.setProjection(targetLayerProjection); |
129 | 143 |
PluginServices.getMDIManager().addView(csSelect); |
130 | 144 |
if (csSelect.isOkPressed()) { |
131 |
targetLayerProjection = |
|
145 |
targetLayerProjection =
|
|
132 | 146 |
csSelect.getProjection(); |
147 |
String targetProjectionText = PluginServices. |
|
148 |
getText(this, "Proyeccion_Destino")+ |
|
149 |
": " + |
|
150 |
targetLayerProjection.getAbrev(); |
|
133 | 151 |
targetProjectionLabel. |
134 |
setText(targetLayerProjection.getAbrev());
|
|
152 |
setText(targetProjectionText);
|
|
135 | 153 |
} |
136 | 154 |
}}); |
137 | 155 |
return solution; |
... | ... | |
145 | 163 |
protected void processLayerComboBoxStateChange(ItemEvent e) { |
146 | 164 |
FLyrVect inputLyr = getInputLayer(); |
147 | 165 |
inputLayerProjection = inputLyr.getProjection(); |
148 |
inputProjectionLabel.setText(inputLayerProjection.getAbrev()); |
|
166 |
String inputProjectionText = PluginServices. |
|
167 |
getText(this, "Proyeccion_Actual")+ |
|
168 |
": "+ |
|
169 |
inputLayerProjection.getAbrev(); |
|
170 |
|
|
171 |
inputProjectionLabel.setText(inputProjectionText); |
|
149 | 172 |
} |
150 |
|
|
173 |
|
|
151 | 174 |
public IProjection getTargetProjection(){ |
152 | 175 |
return targetLayerProjection; |
153 | 176 |
} |
trunk/extensions/extGeoprocessingExtensions/src/com/iver/cit/gvsig/geoprocess/impl/reproject/ReprojectGeoprocessPlugin.java | ||
---|---|---|
45 | 45 |
* |
46 | 46 |
* $Id$ |
47 | 47 |
* $Log$ |
48 |
* Revision 1.2 2006-07-04 16:43:18 azabala
|
|
48 |
* Revision 1.3 2006-08-11 17:20:32 azabala
|
|
49 | 49 |
* *** empty log message *** |
50 | 50 |
* |
51 |
* Revision 1.2 2006/07/04 16:43:18 azabala |
|
52 |
* *** empty log message *** |
|
53 |
* |
|
51 | 54 |
* Revision 1.1 2006/07/03 20:28:29 azabala |
52 | 55 |
* *** empty log message *** |
53 | 56 |
* |
... | ... | |
56 | 59 |
package com.iver.cit.gvsig.geoprocess.impl.reproject; |
57 | 60 |
|
58 | 61 |
import java.net.URL; |
62 |
import java.util.Locale; |
|
59 | 63 |
|
60 | 64 |
import com.iver.andami.PluginServices; |
61 | 65 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
... | ... | |
64 | 68 |
import com.iver.cit.gvsig.geoprocess.core.gui.IGeoprocessPanel; |
65 | 69 |
import com.iver.cit.gvsig.geoprocess.impl.reproject.gui.GeoprocessingReprojectPanel; |
66 | 70 |
import com.iver.cit.gvsig.geoprocess.impl.xyshift.XYShiftGeoprocessPlugin; |
71 |
import com.iver.cit.gvsig.geoprocess.manager.GeoprocessManager; |
|
67 | 72 |
import com.iver.cit.gvsig.gui.View; |
68 | 73 |
|
69 | 74 |
public class ReprojectGeoprocessPlugin implements IGeoprocessPlugin { |
70 | 75 |
|
76 |
private static String dataConvertPkg; |
|
77 |
private static String geoprocessName; |
|
78 |
|
|
79 |
static{ |
|
80 |
dataConvertPkg = |
|
81 |
PluginServices.getText(null, "Conversion_de_datos"); |
|
82 |
geoprocessName = |
|
83 |
PluginServices.getText(null, "Reproyectar"); |
|
84 |
} |
|
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
|
71 | 89 |
public IGeoprocessPanel getGeoprocessPanel() { |
72 | 90 |
com.iver.andami.ui.mdiManager.View view = PluginServices.getMDIManager().getActiveView(); |
73 | 91 |
View vista = (View) view; |
... | ... | |
76 | 94 |
} |
77 | 95 |
|
78 | 96 |
public URL getHtmlDescription() { |
97 |
Locale locale = Locale.getDefault(); |
|
98 |
String localeStr = locale.getLanguage(); |
|
99 |
String urlStr = "resources/description_" + |
|
100 |
localeStr + |
|
101 |
".html"; |
|
79 | 102 |
URL url = ReprojectGeoprocessPlugin.class |
80 |
.getResource("resources/description.html");
|
|
103 |
.getResource(urlStr);
|
|
81 | 104 |
return url; |
82 | 105 |
} |
83 | 106 |
|
... | ... | |
91 | 114 |
return new ReprojectGeoprocessController(); |
92 | 115 |
} |
93 | 116 |
|
94 |
/* |
|
95 |
* TODO INTERNACIONALIZAR LOS NAMESPACES |
|
96 |
*/ |
|
117 |
|
|
97 | 118 |
public String getNamespace() { |
98 |
return "Conversion de datos/Reproject";
|
|
119 |
return dataConvertPkg + "/" + geoprocessName;
|
|
99 | 120 |
} |
100 | 121 |
|
101 | 122 |
public String toString(){ |
102 |
return "Reproyecci?n";
|
|
123 |
return geoprocessName;
|
|
103 | 124 |
} |
104 | 125 |
|
105 | 126 |
} |
trunk/extensions/extGeoprocessingExtensions/src/com/iver/cit/gvsig/geoprocess/impl/reproject/resources/description_en.html | ||
---|---|---|
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
|
2 |
<HTML> |
|
3 |
<HEAD> |
|
4 |
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252"> |
|
5 |
<TITLE>Reproyecci?n</TITLE> |
|
6 |
</HEAD> |
|
7 |
<BODY LANG="es-ES" DIR="LTR"> |
|
8 |
<P> |
|
9 |
<FONT COLOR="#800000"> |
|
10 |
<B>Reproject</B> |
|
11 |
</FONT> |
|
12 |
</P> |
|
13 |
<P>This geoprocess reproject all features of the input layer. |
|
14 |
To do that, user must specify the new projection for them. |
|
15 |
</P> |
|
16 |
<P> |
|
17 |
<IMG SRC="reprojectdesc.png" NAME="Imagen1" ALIGN=LEFT BORDER=0> |
|
18 |
</P> |
|
19 |
<P> |
|
20 |
This is useful to load layers with different projections in a same project. |
|
21 |
</P> |
|
22 |
</BODY> |
|
23 |
</HTML> |
|
0 | 24 |
trunk/extensions/extGeoprocessingExtensions/src/com/iver/cit/gvsig/geoprocess/impl/reproject/resources/description_es.html | ||
---|---|---|
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
|
2 |
<HTML> |
|
3 |
<HEAD> |
|
4 |
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252"> |
|
5 |
<TITLE>Reproyecci?n</TITLE> |
|
6 |
</HEAD> |
|
7 |
<BODY LANG="es-ES" DIR="LTR"> |
|
8 |
<P> |
|
9 |
<FONT COLOR="#800000"> |
|
10 |
<B>Reproyecci?n</B> |
|
11 |
</FONT> |
|
12 |
</P> |
|
13 |
<P>Este geoproceso permite cambiar la proyecci?n geod?sica de los elementos vectoriales de la capa de entrada. |
|
14 |
Para tal fín, el usuario deberá especificar la nueva proyección a aplicar. |
|
15 |
</P> |
|
16 |
<P> |
|
17 |
<IMG SRC="reprojectdesc.png" NAME="Imagen1" ALIGN=LEFT BORDER=0> |
|
18 |
</P> |
|
19 |
<P> |
|
20 |
Este geoproceso puede ser de gran utilidad para hacer concordar |
|
21 |
cartografías en un mismo proyecto cartografías que se encuentran en proyecciones distintas. |
|
22 |
</P> |
|
23 |
</BODY> |
|
24 |
</HTML> |
|
0 | 25 |
trunk/extensions/extGeoprocessingExtensions/src/com/iver/cit/gvsig/geoprocess/impl/reproject/ReprojectGeoprocessController.java | ||
---|---|---|
45 | 45 |
* |
46 | 46 |
* $Id$ |
47 | 47 |
* $Log$ |
48 |
* Revision 1.2 2006-07-04 16:43:18 azabala
|
|
48 |
* Revision 1.3 2006-08-11 17:20:32 azabala
|
|
49 | 49 |
* *** empty log message *** |
50 | 50 |
* |
51 |
* Revision 1.2 2006/07/04 16:43:18 azabala |
|
52 |
* *** empty log message *** |
|
53 |
* |
|
51 | 54 |
* Revision 1.1 2006/07/03 20:28:29 azabala |
52 | 55 |
* *** empty log message *** |
53 | 56 |
* |
... | ... | |
56 | 59 |
package com.iver.cit.gvsig.geoprocess.impl.reproject; |
57 | 60 |
|
58 | 61 |
import java.io.File; |
62 |
import java.io.FileNotFoundException; |
|
59 | 63 |
import java.util.HashMap; |
60 | 64 |
|
61 | 65 |
import org.cresques.cts.IProjection; |
... | ... | |
93 | 97 |
public boolean launchGeoprocess() { |
94 | 98 |
FLyrVect inputLayer = panel.getInputLayer(); |
95 | 99 |
FLayers layers = panel.getFLayers(); |
96 |
File outputFile = panel.getOutputFile(); |
|
100 |
File outputFile = null; |
|
101 |
try { |
|
102 |
outputFile = panel.getOutputFile(); |
|
103 |
} catch (FileNotFoundException e3) { |
|
104 |
String error = PluginServices.getText(this, "Error_entrada_datos"); |
|
105 |
String errorDescription = PluginServices.getText(this, "Error_seleccionar_resultado"); |
|
106 |
panel.error(errorDescription, error); |
|
107 |
return false; |
|
108 |
} |
|
97 | 109 |
if (outputFile == null || (outputFile.getAbsolutePath().length() == 0)) { |
98 | 110 |
String error = PluginServices.getText(this, "Error_entrada_datos"); |
99 | 111 |
String errorDescription = PluginServices.getText(this, "Error_seleccionar_resultado"); |
trunk/extensions/extGeoprocessingExtensions/src/com/iver/cit/gvsig/geoprocess/impl/xyshift/XYShiftGeoprocessController.java | ||
---|---|---|
45 | 45 |
* |
46 | 46 |
* $Id$ |
47 | 47 |
* $Log$ |
48 |
* Revision 1.2 2006-06-29 17:58:31 azabala
|
|
48 |
* Revision 1.3 2006-08-11 17:17:55 azabala
|
|
49 | 49 |
* *** empty log message *** |
50 | 50 |
* |
51 |
* Revision 1.2 2006/06/29 17:58:31 azabala |
|
52 |
* *** empty log message *** |
|
53 |
* |
|
51 | 54 |
* Revision 1.1 2006/06/28 18:17:21 azabala |
52 | 55 |
* first version in cvs |
53 | 56 |
* |
... | ... | |
56 | 59 |
package com.iver.cit.gvsig.geoprocess.impl.xyshift; |
57 | 60 |
|
58 | 61 |
import java.io.File; |
62 |
import java.io.FileNotFoundException; |
|
59 | 63 |
import java.util.HashMap; |
60 | 64 |
|
61 | 65 |
import com.iver.andami.PluginServices; |
... | ... | |
71 | 75 |
import com.iver.cit.gvsig.geoprocess.core.gui.IGeoprocessPanel; |
72 | 76 |
import com.iver.cit.gvsig.geoprocess.impl.xyshift.fmap.XYShiftGeoprocess; |
73 | 77 |
import com.iver.cit.gvsig.geoprocess.impl.xyshift.gui.GeoprocessingXYShiftPanel; |
78 |
import com.iver.cit.gvsig.geoprocess.impl.xyshift.gui.GeoprocessingXYShiftPanel2; |
|
74 | 79 |
import com.iver.utiles.swing.threads.IMonitorableTask; |
75 | 80 |
import com.iver.utiles.swing.threads.MonitorableDecoratorMainFirst; |
76 | 81 |
|
77 | 82 |
public class XYShiftGeoprocessController extends AbstractGeoprocessController { |
78 | 83 |
|
79 |
private GeoprocessingXYShiftPanel panel; |
|
84 |
private GeoprocessingXYShiftPanel2 panel;
|
|
80 | 85 |
private XYShiftGeoprocess xyShift; |
81 | 86 |
|
82 | 87 |
|
83 | 88 |
public void setView(IGeoprocessPanel viewPanel) { |
84 |
this.panel = (GeoprocessingXYShiftPanel) viewPanel; |
|
89 |
this.panel = (GeoprocessingXYShiftPanel2) viewPanel;
|
|
85 | 90 |
} |
86 | 91 |
|
87 | 92 |
public IGeoprocess getGeoprocess() { |
... | ... | |
91 | 96 |
public boolean launchGeoprocess() { |
92 | 97 |
FLyrVect inputLayer = panel.getInputLayer(); |
93 | 98 |
FLayers layers = panel.getFLayers(); |
94 |
File outputFile = panel.getOutputFile(); |
|
99 |
File outputFile = null; |
|
100 |
try { |
|
101 |
outputFile = panel.getOutputFile(); |
|
102 |
} catch (FileNotFoundException e3) { |
|
103 |
String error = PluginServices.getText(this, "Error_entrada_datos"); |
|
104 |
String errorDescription = PluginServices.getText(this, "Error_seleccionar_resultado"); |
|
105 |
panel.error(errorDescription, error); |
|
106 |
return false; |
|
107 |
} |
|
95 | 108 |
if (outputFile == null || (outputFile.getAbsolutePath().length() == 0)) { |
96 | 109 |
String error = PluginServices.getText(this, "Error_entrada_datos"); |
97 | 110 |
String errorDescription = PluginServices.getText(this, "Error_seleccionar_resultado"); |
... | ... | |
119 | 132 |
} |
120 | 133 |
xyShift.setResultLayerProperties(writer, schemaManager); |
121 | 134 |
HashMap params = new HashMap(); |
122 |
boolean onlySelected = panel.isOnlySelected(); |
|
135 |
boolean onlySelected = panel.isFirstOnlySelected();
|
|
123 | 136 |
params.put("firstlayerselection", new Boolean(onlySelected)); |
124 | 137 |
try { |
125 | 138 |
double xShift = panel.getXOffset(); |
trunk/extensions/extGeoprocessingExtensions/src/com/iver/cit/gvsig/geoprocess/impl/xyshift/gui/GeoprocessingXYShiftPanel.java | ||
---|---|---|
45 | 45 |
* |
46 | 46 |
* $Id$ |
47 | 47 |
* $Log$ |
48 |
* Revision 1.3 2006-07-03 20:29:08 azabala
|
|
48 |
* Revision 1.4 2006-08-11 17:17:55 azabala
|
|
49 | 49 |
* *** empty log message *** |
50 | 50 |
* |
51 |
* Revision 1.3 2006/07/03 20:29:08 azabala |
|
52 |
* *** empty log message *** |
|
53 |
* |
|
51 | 54 |
* Revision 1.2 2006/06/29 17:58:31 azabala |
52 | 55 |
* *** empty log message *** |
53 | 56 |
* |
... | ... | |
90 | 93 |
private JCheckBox selectedOnlyCheckBox = null; |
91 | 94 |
private JPanel resultSelectionPanel = null; |
92 | 95 |
private JButton openResultButton = null; |
93 |
private JTextField jTextField = null; |
|
94 | 96 |
private JLabel jLabel2 = null; |
95 | 97 |
private JLabel xoffsetLabel = null; |
96 | 98 |
private JTextField xoffsetTextField = null; |
... | ... | |
268 | 270 |
* @return javax.swing.JTextField |
269 | 271 |
*/ |
270 | 272 |
public JTextField getFileNameResultTextField() { |
271 |
if (jTextField == null) { |
|
272 |
jTextField = new JTextField(); |
|
273 |
jTextField.setBounds(new Rectangle(135, 11, 169, 21)); |
|
273 |
if (fileNameResultTextField == null) { |
|
274 |
super.getFileNameResultTextField(). |
|
275 |
setBounds(new Rectangle(135, 11, |
|
276 |
169, 21)); |
|
274 | 277 |
} |
275 |
return jTextField;
|
|
278 |
return fileNameResultTextField;
|
|
276 | 279 |
} |
277 | 280 |
|
278 | 281 |
/** |
... | ... | |
301 | 304 |
return yoffsetTextField; |
302 | 305 |
} |
303 | 306 |
|
304 |
public File getOutputFile() { |
|
305 |
String fileName = getFileNameResultTextField().getText(); |
|
306 |
if(! fileName.endsWith(".shp")){ |
|
307 |
if(! fileName.endsWith(".")) |
|
308 |
fileName += "."; |
|
309 |
fileName += "shp"; |
|
310 |
} |
|
311 |
return new File(fileName); |
|
312 |
} |
|
313 |
|
|
314 | 307 |
} // @jve:decl-index=0:visual-constraint="13,15" |
315 | 308 |
|
trunk/extensions/extGeoprocessingExtensions/src/com/iver/cit/gvsig/geoprocess/impl/xyshift/gui/GeoprocessingXYShiftPanel2.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 31-jul-2006 |
|
3 |
* |
|
4 |
* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
5 |
* |
|
6 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
7 |
* |
|
8 |
* This program is free software; you can redistribute it and/or |
|
9 |
* modify it under the terms of the GNU General Public License |
|
10 |
* as published by the Free Software Foundation; either version 2 |
|
11 |
* of the License, or (at your option) any later version. |
|
12 |
* |
|
13 |
* This program is distributed in the hope that it will be useful, |
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
* GNU General Public License for more details. |
|
17 |
* |
|
18 |
* You should have received a copy of the GNU General Public License |
|
19 |
* along with this program; if not, write to the Free Software |
|
20 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
21 |
* |
|
22 |
* For more information, contact: |
|
23 |
* |
|
24 |
* Generalitat Valenciana |
|
25 |
* Conselleria d'Infraestructures i Transport |
|
26 |
* Av. Blasco Ib??ez, 50 |
|
27 |
* 46010 VALENCIA |
|
28 |
* SPAIN |
|
29 |
* |
|
30 |
* +34 963862235 |
|
31 |
* gvsig@gva.es |
|
32 |
* www.gvsig.gva.es |
|
33 |
* |
|
34 |
* or |
|
35 |
* |
|
36 |
* IVER T.I. S.A |
|
37 |
* Salamanca 50 |
|
38 |
* 46005 Valencia |
|
39 |
* Spain |
|
40 |
* |
|
41 |
* +34 963163400 |
|
42 |
* dac@iver.es |
|
43 |
*/ |
|
44 |
/* CVS MESSAGES: |
|
45 |
* |
|
46 |
* $Id$ |
|
47 |
* $Log$ |
|
48 |
* Revision 1.1 2006-08-11 17:17:55 azabala |
|
49 |
* *** empty log message *** |
|
50 |
* |
|
51 |
* |
|
52 |
*/ |
|
53 |
package com.iver.cit.gvsig.geoprocess.impl.xyshift.gui; |
|
54 |
|
|
55 |
import java.awt.GridBagConstraints; |
|
56 |
import java.awt.Insets; |
|
57 |
import java.awt.event.ItemEvent; |
|
58 |
|
|
59 |
import javax.swing.JLabel; |
|
60 |
import javax.swing.JTextField; |
|
61 |
|
|
62 |
import com.iver.andami.PluginServices; |
|
63 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
|
64 |
import com.iver.cit.gvsig.geoprocess.core.fmap.GeoprocessException; |
|
65 |
import com.iver.cit.gvsig.geoprocess.core.gui.AbstractGeoprocessGridbagPanel; |
|
66 |
|
|
67 |
public class GeoprocessingXYShiftPanel2 extends AbstractGeoprocessGridbagPanel { |
|
68 |
|
|
69 |
|
|
70 |
private JLabel offsetLabel; |
|
71 |
private JTextField xoffsetTextField; |
|
72 |
private JTextField yoffsetTextField; |
|
73 |
|
|
74 |
/** |
|
75 |
* Constructor. |
|
76 |
* |
|
77 |
*/ |
|
78 |
public GeoprocessingXYShiftPanel2(FLayers layers) { |
|
79 |
super(layers, PluginServices. |
|
80 |
getText(null, "XYShift._Introduccion_de_datos") + ":"); |
|
81 |
} |
|
82 |
|
|
83 |
protected void addSpecificDesign() { |
|
84 |
Insets insets = new Insets(5, 5, 5, 5); |
|
85 |
|
|
86 |
offsetLabel = new JLabel(); |
|
87 |
offsetLabel.setText(PluginServices. |
|
88 |
getText(this,"Introducir_valores_desplazamiento")); |
|
89 |
addComponent(offsetLabel, insets); |
|
90 |
|
|
91 |
xoffsetTextField = new JTextField(20); |
|
92 |
addComponent(PluginServices.getText(this,"xOffset")+":", |
|
93 |
xoffsetTextField, GridBagConstraints.BOTH, insets); |
|
94 |
|
|
95 |
yoffsetTextField = new JTextField(20); |
|
96 |
addComponent(PluginServices.getText(this,"yOffset")+":", |
|
97 |
yoffsetTextField, GridBagConstraints.BOTH, insets); |
|
98 |
|
|
99 |
initSelectedItemsJCheckBox(); |
|
100 |
updateNumSelectedFeaturesLabel(); |
|
101 |
|
|
102 |
} |
|
103 |
|
|
104 |
public double getXOffset() throws GeoprocessException{ |
|
105 |
try { |
|
106 |
String strDist = xoffsetTextField.getText(); |
|
107 |
return Double.parseDouble(strDist); |
|
108 |
} catch (NumberFormatException ex) { |
|
109 |
throw new GeoprocessException( |
|
110 |
"Offset en x introducido no numerico"); |
|
111 |
} |
|
112 |
} |
|
113 |
|
|
114 |
public double getYOffset() throws GeoprocessException{ |
|
115 |
try { |
|
116 |
String strDist = yoffsetTextField.getText(); |
|
117 |
return Double.parseDouble(strDist); |
|
118 |
} catch (NumberFormatException ex) { |
|
119 |
throw new GeoprocessException( |
|
120 |
"Distancia de buffer introducida no numerica"); |
|
121 |
} |
|
122 |
} |
|
123 |
|
|
124 |
protected void processLayerComboBoxStateChange(ItemEvent e) { |
|
125 |
} |
|
126 |
|
|
127 |
|
|
128 |
|
|
129 |
} |
|
130 |
|
|
0 | 131 |
trunk/extensions/extGeoprocessingExtensions/src/com/iver/cit/gvsig/geoprocess/impl/xyshift/XYShiftGeoprocessPlugin.java | ||
---|---|---|
45 | 45 |
* |
46 | 46 |
* $Id$ |
47 | 47 |
* $Log$ |
48 |
* Revision 1.2 2006-06-29 17:58:31 azabala
|
|
48 |
* Revision 1.3 2006-08-11 17:17:55 azabala
|
|
49 | 49 |
* *** empty log message *** |
50 | 50 |
* |
51 |
* Revision 1.2 2006/06/29 17:58:31 azabala |
|
52 |
* *** empty log message *** |
|
53 |
* |
|
51 | 54 |
* Revision 1.1 2006/06/28 18:17:21 azabala |
52 | 55 |
* first version in cvs |
53 | 56 |
* |
... | ... | |
56 | 59 |
package com.iver.cit.gvsig.geoprocess.impl.xyshift; |
57 | 60 |
|
58 | 61 |
import java.net.URL; |
62 |
import java.util.Locale; |
|
59 | 63 |
|
60 | 64 |
import com.iver.andami.PluginServices; |
61 | 65 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
62 | 66 |
import com.iver.cit.gvsig.geoprocess.core.IGeoprocessController; |
63 | 67 |
import com.iver.cit.gvsig.geoprocess.core.IGeoprocessPlugin; |
64 |
import com.iver.cit.gvsig.geoprocess.core.gui.GeoProcessingOverlayPanel; |
|
65 | 68 |
import com.iver.cit.gvsig.geoprocess.core.gui.IGeoprocessPanel; |
66 |
import com.iver.cit.gvsig.geoprocess.impl.buffer.BufferGeoprocessPlugin; |
|
67 |
import com.iver.cit.gvsig.geoprocess.impl.xyshift.gui.GeoprocessingXYShiftPanel; |
|
69 |
import com.iver.cit.gvsig.geoprocess.impl.xyshift.gui.GeoprocessingXYShiftPanel2; |
|
68 | 70 |
import com.iver.cit.gvsig.gui.View; |
69 | 71 |
|
70 | 72 |
public class XYShiftGeoprocessPlugin implements IGeoprocessPlugin { |
71 | 73 |
|
74 |
private static String dataConvertPkg; |
|
75 |
private static String geoprocessName; |
|
76 |
|
|
77 |
static{ |
|
78 |
dataConvertPkg = |
|
79 |
PluginServices.getText(null, "Conversion_de_datos"); |
|
80 |
geoprocessName = |
|
81 |
PluginServices.getText(null, "XYShift"); |
|
82 |
} |
|
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
|
72 | 87 |
public IGeoprocessPanel getGeoprocessPanel() { |
73 | 88 |
View vista = (View)PluginServices. |
74 | 89 |
getMDIManager(). |
... | ... | |
77 | 92 |
getMapContext(). |
78 | 93 |
getLayers(); |
79 | 94 |
|
80 |
return new GeoprocessingXYShiftPanel(layers); |
|
95 |
return new GeoprocessingXYShiftPanel2(layers);
|
|
81 | 96 |
} |
82 | 97 |
|
83 | 98 |
public URL getHtmlDescription() { |
99 |
Locale locale = Locale.getDefault(); |
|
100 |
String localeStr = locale.getLanguage(); |
|
101 |
String urlStr = "resources/description_" + |
|
102 |
localeStr + |
|
103 |
".html"; |
|
84 | 104 |
URL url = XYShiftGeoprocessPlugin.class. |
85 |
getResource("resources/description.html");
|
|
105 |
getResource(urlStr);
|
|
86 | 106 |
return url; |
87 | 107 |
} |
88 | 108 |
|
... | ... | |
97 | 117 |
} |
98 | 118 |
|
99 | 119 |
public String getNamespace() { |
100 |
return "Conversion de datos/XYShift";
|
|
120 |
return dataConvertPkg + "/" + geoprocessName;
|
|
101 | 121 |
} |
102 | 122 |
|
103 | 123 |
public String toString(){ |
104 |
return "XYShift";
|
|
124 |
return geoprocessName;
|
|
105 | 125 |
} |
106 | 126 |
|
107 | 127 |
} |
trunk/extensions/extGeoprocessingExtensions/src/com/iver/cit/gvsig/geoprocess/impl/xyshift/resources/description.html | ||
---|---|---|
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
|
2 |
<HTML> |
|
3 |
<HEAD> |
|
4 |
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252"> |
|
5 |
<TITLE></TITLE> |
|
6 |
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.1 (Win32)"> |
|
7 |
<META NAME="CREATED" CONTENT="20060629;17004817"> |
|
8 |
<META NAME="CHANGED" CONTENT="16010101;0"> |
|
9 |
<STYLE> |
|
10 |
<!-- |
|
11 |
@page { size: 21cm 29.7cm; margin: 2cm } |
|
12 |
P { margin-bottom: 0.21cm } |
|
13 |
--> |
|
14 |
</STYLE> |
|
15 |
</HEAD> |
|
16 |
<BODY LANG="es-ES" DIR="LTR"> |
|
17 |
<P><FONT COLOR="#800000"><B>XYSHIFT</B></FONT></P> |
|
18 |
<P><BR><BR> |
|
19 |
</P> |
|
20 |
<P>Este geoproceso permite aplicar una transformación de |
|
21 |
traslación sobre todos los puntos de las geometrías de |
|
22 |
la capa de entrada. Para tal fin, el usuario deberá |
|
23 |
especificar el desplazamiento en X y en Y a aplicar.</P> |
|
24 |
<P><IMG SRC="xyshiftdesc.png" NAME="Imagen1" ALIGN=LEFT WIDTH=400 HEIGHT=315 BORDER=0><BR CLEAR=LEFT><BR><BR> |
|
25 |
</P> |
|
26 |
<P>Este geoproceso puede ser de gran utilidad para hacer concordar |
|
27 |
cartografías procedentes de fuentes distintas, en lo que se |
|
28 |
viene a denominar por el término inglés “conflation”.</P> |
|
29 |
<P><BR><BR> |
|
30 |
</P> |
|
31 |
</BODY> |
|
32 |
</HTML> |
trunk/extensions/extGeoprocessingExtensions/src/com/iver/cit/gvsig/geoprocess/impl/xyshift/resources/description_en.html | ||
---|---|---|
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
|
2 |
<HTML> |
|
3 |
<HEAD> |
|
4 |
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252"> |
|
5 |
<TITLE>Traslaci?n 2D</TITLE> |
|
6 |
</HEAD> |
|
7 |
<BODY LANG="es-ES" DIR="LTR"> |
|
8 |
<P> |
|
9 |
<FONT COLOR="#800000"> |
|
10 |
<B>XY Shift</B> |
|
11 |
</FONT> |
|
12 |
</P> |
|
13 |
<P>This geoprocess applies a 2D translation transform to all points of the geometry of all the features |
|
14 |
of the input layer. To do that, user must enter x and y offsets. |
|
15 |
</P> |
|
16 |
<P> |
|
17 |
<IMG SRC="xyshiftdesc.png" NAME="Imagen1" ALIGN=LEFT BORDER=0> |
|
18 |
</P> |
|
19 |
<P> |
|
20 |
This is useful for conflation task, to integrate layers from different sources and |
|
21 |
cartographic technical specs. |
|
22 |
</P> |
|
23 |
</BODY> |
|
24 |
</HTML> |
|
0 | 25 |
trunk/extensions/extGeoprocessingExtensions/src/com/iver/cit/gvsig/geoprocess/impl/xyshift/resources/description_es.html | ||
---|---|---|
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
|
2 |
<HTML> |
|
3 |
<HEAD> |
|
4 |
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252"> |
|
5 |
<TITLE>Traslaci?n 2D</TITLE> |
|
6 |
</HEAD> |
|
7 |
<BODY LANG="es-ES" DIR="LTR"> |
|
8 |
<P> |
|
9 |
<FONT COLOR="#800000"> |
|
10 |
<B>Traslaci?n 2D</B> |
|
11 |
</FONT> |
|
12 |
</P> |
|
13 |
<P>Este geoproceso permite aplicar una transformación de |
|
14 |
traslación sobre todos los puntos de las geometrías de |
|
15 |
la capa de entrada. Para tal fin, el usuario deberá |
|
16 |
especificar el desplazamiento en X y en Y a aplicar. |
|
17 |
</P> |
|
18 |
<P> |
|
19 |
<IMG SRC="xyshiftdesc.png" NAME="Imagen1" ALIGN=LEFT BORDER=0> |
|
20 |
</P> |
|
21 |
<P> |
|
22 |
Este geoproceso puede ser de gran utilidad para hacer concordar |
|
23 |
cartografías procedentes de fuentes distintas, en lo que se |
|
24 |
viene a denominar por el término inglés “conflation”. |
|
25 |
</P> |
|
26 |
</BODY> |
|
27 |
</HTML> |
|
0 | 28 |
Also available in: Unified diff