[JPP-Devel] SVN: [4922] core/trunk/src/org/openjump/core/ui/plugin/raster/ RasterImageLayerPropertiesPlugIn.java

2016-05-23 Thread jump-pilot-svn
Revision: 4922
  http://sourceforge.net/p/jump-pilot/code/4922
Author:   ma15569
Date: 2016-05-23 14:52:31 + (Mon, 23 May 2016)
Log Message:
---
Extended new CRS detection to Sextante raster layers

Modified Paths:
--

core/trunk/src/org/openjump/core/ui/plugin/raster/RasterImageLayerPropertiesPlugIn.java

Modified: 
core/trunk/src/org/openjump/core/ui/plugin/raster/RasterImageLayerPropertiesPlugIn.java
===
--- 
core/trunk/src/org/openjump/core/ui/plugin/raster/RasterImageLayerPropertiesPlugIn.java
 2016-05-23 10:03:05 UTC (rev 4921)
+++ 
core/trunk/src/org/openjump/core/ui/plugin/raster/RasterImageLayerPropertiesPlugIn.java
 2016-05-23 14:52:31 UTC (rev 4922)
@@ -11,6 +11,7 @@
 import java.awt.image.SampleModel;
 import java.io.File;
 import java.io.IOException;
+import java.net.URISyntaxException;
 import java.text.DecimalFormat;
 import java.text.NumberFormat;
 import java.util.Dictionary;
@@ -31,12 +32,12 @@
 import javax.swing.event.ChangeListener;
 
 import org.openjump.core.apitools.LayerTools;
+import org.openjump.core.ccordsys.utils.ProjUtils;
 import org.openjump.core.rasterimage.RasterImageLayer;
 import org.openjump.core.rasterimage.TiffTags.TiffReadingException;
 import org.openjump.core.rasterimage.sextante.OpenJUMPSextanteRasterLayer;
 import 
org.openjump.core.rasterimage.sextante.rasterWrappers.GridWrapperNotInterpolated;
 import org.openjump.core.ui.swing.DetachableInternalFrame;
-import org.openjump.core.ui.util.ProjUtils;
 import org.saig.core.gui.swing.sldeditor.util.FormUtils;
 
 import com.vividsolutions.jts.geom.Envelope;
@@ -463,36 +464,41 @@
}
}
 
-   /*
-* Get Projection of selected raster. First it checks if selected 
raster is
-* a GeoTIF and scan tiff tags for projection. If selected file is not a
-* GeoTIF, it checks if .AUX.XML exists and scans inside it. 
As
-* last choice it scans into .PRJ file
-*/
-   private void setInfoProjection(RasterImageLayer layer) throws 
IOException {
-   String fileSourcePath = layer.getImageFileName();
-   String extension = FileUtil.getExtension(fileSourcePath);
-   if ((extension.equals("tif") || extension.equals("tiff")
-   || extension.equals("TIF") || 
extension.equals("TIFF"))) {
-   if (ProjUtils.isGeoTIFF(fileSourcePath)) {
-   proj_file_path = GEO_METADATA;
-   proj_coordinate = ProjUtils
-   
.getGeoTiffProjection(fileSourcePath);
-   } else {
-   proj_file_path = ProjUtils
-   
.getFileProjectionPath(fileSourcePath);
-   proj_coordinate = 
ProjUtils.getFileProjection(fileSourcePath);
-   }
-   } else if ((extension.equals("asc") || extension.equals("ASC")
-   || extension.equals("FLT") || 
extension.equals("flt"))) {
-   proj_file_path = 
ProjUtils.getFileProjectionPath(fileSourcePath);
-   proj_coordinate = 
ProjUtils.getFileProjection(fileSourcePath);
-   } else {
-   proj_file_path = 
ProjUtils.getFileProjectionPath(fileSourcePath);
-   proj_coordinate = 
ProjUtils.getFileProjection(fileSourcePath);
-   }
-   }
+  /*
+   * Get Projection of selected raster. First it checks if selected raster is
+   * a GeoTIF and scan tiff tags for projection. If selected file is not a
+   * GeoTIF, it checks if .AUX.XML exists and scans inside it. As
+   * last choice it scans into .PRJ file
+   */
+  private void setInfoProjection(RasterImageLayer layer) throws IOException,
+  URISyntaxException {
+  String fileSourcePath = layer.getImageFileName();
+  String extension = FileUtil.getExtension(fileSourcePath);
+  if ((extension.equals("tif") || extension.equals("tiff")
+  || extension.equals("TIF") || extension.equals("TIFF"))) {
+  if (ProjUtils.isGeoTIFF(fileSourcePath)) {
+  proj_file_path = GEO_METADATA;
+  proj_coordinate = ProjUtils
+  .readSRSFromGeoTiffFile(fileSourcePath);
+  } else {
 
+  proj_file_path = ProjUtils
+  .getAuxiliaryProjFilePath(fileSourcePath);
+  proj_coordinate = ProjUtils
+  .readSRSFromAuxiliaryFile(fileSourcePath);
+
+  }
+  } else if ((extension.equals("asc") || extension.equals("ASC")
+  || extension.equals("FLT") || extension.equals("flt"))) {
+  proj_file_path = ProjUtils.getAuxiliaryProjFilePath(fileSourcePath);
+  proj_coordinate = ProjUtils
+  

Re: [JPP-Devel] Improved version of Layer Properties plugin

2016-05-23 Thread Stefan Steiniger


Hi, i think ReprojectionPlugIn must be the original JUMP plugin, programed by Jon, which projects onto a sphere or so, but it never got activated. It kind of works and code should be in the original JUMP tree. Back then VividSolutions  (Jon & Martin) started working on CTS support, but they never really got full into it. Could be that there was no funding. cheers,stefan -- Originalnachricht --Von: Giuseppe Aruta Datum: 23.05.2016 6:20An: OpenJump evelop and use;Betreff:Re: [JPP-Devel] Improved version of Layer Properties pluginCTSPlugIn is your plugin, Ede. I have been used  a lot and it is still valid in case of local transformation.I found also a:org.openjump.core.ui.plugin.layer.ReprojectionPlugIn which is not included in OJ code neither in the plugins.Does someone know what is that?Peppe2016-05-23 12:15 GMT+02:00 Giuseppe Aruta :Hi Ede,But there are some plugin which are not actived even if they are in the default_plugins.xml file, like- org.openjump.core.ui.plugin.layer.CTSPlugInafter-org.openjump.core.ui.plugin.layer.NewLayerPropertiesPlugInand - org.openjump.core.ui.plugin.layer.LayerPropertiesPlugIn (this is a duplicate) after  - com.vividsolutions.jump.workbench.ui.plugin.AddNewFeaturesPlugInPeppe2016-05-23 11:00 GMT+02:00 :Peppe,

double entries in default-plugins.xml are not dead but merely entries for if a plugin is installed into more than one menu (eg. main and layerview popup).

..ede


On 21.05.2016 17:14, Giuseppe Aruta wrote:
> Hi Michael,
> Thanks for clarification.I correct the plugin position.
> I was confused as there are two org.openjump.core.ui.plugin.layer.LayerPropertiesPlugIn  entries on default-plugins.xml file.
> There are also other "dead" lines.
> Peppe
>
> 2016-05-21 11:03 GMT+02:00 Michaël Michaud >:
>
> Hi Peppe,
>
> I'm OK with putting LayerProperties plugin between "Zoom to Layer" and "View / edit attributes"
>
> but I don't understand your previous mail.
> Curently, LayerProperties (old one) is just before "Zoom to Layer" (line 1077 in default-plugins)
> NewLayerProperties is located after "Add New Features" (line 1217 in default-plugins)
>
> I think you don't want NewLayerProperties to be at this place...
>
> Michaël
>
>
>
> Le 21/05/2016 à 07:38, Giuseppe Aruta a écrit :
>> Anyhow I would prefer to have Layer Properties plugin and View / edit attributes  close to each other. I would move Zoom to layer one step higher.
>>
>> 2016-05-21 7:33 GMT+02:00 Giuseppe Aruta >:
>>
>> Hi Michael,
>> No Michael, I found the two codes (apperently both actived) and  I only substituted my commits in the same place where Layer Properties was displayed on my laptop. In my case it was the reverse (from OJ4915 (the one before my changes) and on my Win8): the displayed LayerPropertyPlugIn was the one afte "Delete All features" while the one after AddNewFeaturesPlugIn was not displayed. I uncommeted the one that was active on my laptop, but left the other.
>> I wonder if the double code creates different menu organizations on different  PC/OS
>> Peppe
>>
>>
>> 2016-05-21 1:28 GMT+02:00 Michaël Michaud <m.michael.mich...@orange.fr >:
>>
>> Hi Peppe,
>>
>> Nice looking :o)
>> In the default-plugin.xml, the LayerPropertyPlugIn just after "Delete All features" is still the old one.
>> The new one is located after "Add New Features" Is it intended ?
>> You probably wanted to replace old one by new one.
>>
>> Michaël
>>
>>
>> Le 20/05/2016 à 14:38, Stefan Steiniger a écrit :
>>>
>>> Hey Peppe,
>>>
>>> looks nice!
>>> I wondered about the package location and naming, but I see now that I actually did create openjump.core.ccordsys :( or better ;)
>>>
>>> cheers,
>>> Stefan
>>>
>>> On 5/20/16 07:06, Giuseppe Aruta wrote:

 ​Hi all,
 An enhenced version of Layer property plugin is available on OpenJUMP Nightly build 4916.
 Immagine incorporata 1
 This new version displays all the information in a nice table which can be saved as HTML
 Among the new improvents:
 a) plugin can detect if selected layer is a vector, image, geotabase or a WFS sand shows path/url and extension/sorce layer
 b) if more than a layer is selected or if selected layer is a catalogue with some image files, the plugin shows the complete list of the related layer/files
 c) Add a good capability to detect spatial reference 

Re: [JPP-Devel] Improved version of Layer Properties plugin

2016-05-23 Thread edgar . soldin
morning,

what do you mean by 'not activated'?

..ede

On 23.05.2016 12:15, Giuseppe Aruta wrote:
> Hi Ede,
> 
> But there are some plugin which are not actived even if they are in the 
> default_plugins.xml file, like
> 
> - org.openjump.core.ui.plugin.layer.CTSPlugIn
> after
> -org.openjump.core.ui.plugin.layer.NewLayerPropertiesPlugIn
> 
> and
> 
> - org.openjump.core.ui.plugin.layer.LayerPropertiesPlugIn (this is a 
> duplicate)
>  after 
> - com.vividsolutions.jump.workbench.ui.plugin.AddNewFeaturesPlugIn
> 
> Peppe
> 
> 2016-05-23 11:00 GMT+02:00 >:
> 
> Peppe,
> 
> double entries in default-plugins.xml are not dead but merely entries for 
> if a plugin is installed into more than one menu (eg. main and layerview 
> popup).
> 
> ..ede
> 
> 
> On 21.05.2016 17:14, Giuseppe Aruta wrote:
> > Hi Michael,
> > Thanks for clarification.I correct the plugin position.
> > I was confused as there are two 
> org.openjump.core.ui.plugin.layer.LayerPropertiesPlugIn  entries on 
> default-plugins.xml file.
> > There are also other "dead" lines.
> > Peppe
> >
> > 2016-05-21 11:03 GMT+02:00 Michaël Michaud    >>:
> >
> > Hi Peppe,
> >
> > I'm OK with putting LayerProperties plugin between "Zoom to Layer" 
> and "View / edit attributes"
> >
> > but I don't understand your previous mail.
> > Curently, LayerProperties (old one) is just before "Zoom to Layer" 
> (line 1077 in default-plugins)
> > NewLayerProperties is located after "Add New Features" (line 1217 
> in default-plugins)
> >
> > I think you don't want NewLayerProperties to be at this place...
> >
> > Michaël
> >
> >
> >
> > Le 21/05/2016 à 07:38, Giuseppe Aruta a écrit :
> >> Anyhow I would prefer to have Layer Properties plugin and View / 
> edit attributes  close to each other. I would move Zoom to layer one step 
> higher.
> >>
> >> 2016-05-21 7:33 GMT+02:00 Giuseppe Aruta    >>:
> >>
> >> Hi Michael,
> >> No Michael, I found the two codes (apperently both actived) 
> and  I only substituted my commits in the same place where Layer Properties 
> was displayed on my laptop. In my case it was the reverse (from OJ4915 (the 
> one before my changes) and on my Win8): the displayed LayerPropertyPlugIn was 
> the one afte "Delete All features" while the one after AddNewFeaturesPlugIn 
> was not displayed. I uncommeted the one that was active on my laptop, but 
> left the other.
> >> I wonder if the double code creates different menu 
> organizations on different  PC/OS
> >> Peppe
> >>
> >>
> >> 2016-05-21 1:28 GMT+02:00 Michaël Michaud 
> < >m.michael.mich...@orange.fr 
>   >>:
> >>
> >> Hi Peppe,
> >>
> >> Nice looking :o)
> >> In the default-plugin.xml, the LayerPropertyPlugIn just 
> after "Delete All features" is still the old one.
> >> The new one is located after "Add New Features" Is it 
> intended ?
> >> You probably wanted to replace old one by new one.
> >>
> >> Michaël
> >>
> >>
> >> Le 20/05/2016 à 14:38, Stefan Steiniger a écrit :
> >>>
> >>> Hey Peppe,
> >>>
> >>> looks nice!
> >>> I wondered about the package location and naming, but I 
> see now that I actually did create openjump.core.ccordsys :( or better ;)
> >>>
> >>> cheers,
> >>> Stefan
> >>>
> >>> On 5/20/16 07:06, Giuseppe Aruta wrote:
> 
>  ​Hi all,
>  An enhenced version of Layer property plugin is 
> available on OpenJUMP Nightly build 4916.
>  Immagine incorporata 1
>  This new version displays all the information in a nice 
> table which can be saved as HTML
>  Among the new improvents:
>  a) plugin can detect if selected layer is a vector, 
> image, geotabase or a WFS sand shows path/url and extension/sorce layer
>  b) if more than a layer is selected or if selected layer 
> is a catalogue with some image files, the plugin shows the complete list of 
> the related layer/files
>  c) Add a good capability to detect spatial reference 
> system (srid code and 

Re: [JPP-Devel] Improved version of Layer Properties plugin

2016-05-23 Thread edgar . soldin
On 23.05.2016 12:20, Giuseppe Aruta wrote:
> CTSPlugIn is your plugin, Ede. I have been used  a lot and it is still valid 
> in case of local transformation.

nope, it's Mike's and quite new btw. ... it's just named similar as my own 
which never made it into CORE.

..ede

--
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
___
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


Re: [JPP-Devel] Improved version of Layer Properties plugin

2016-05-23 Thread Giuseppe Aruta
CTSPlugIn is your plugin, Ede. I have been used  a lot and it is still
valid in case of local transformation.

I found also a:
org.openjump.core.ui.plugin.layer.ReprojectionPlugIn which is not included
in OJ code neither in the plugins.
Does someone know what is that?
Peppe



2016-05-23 12:15 GMT+02:00 Giuseppe Aruta :

> Hi Ede,
>
> But there are some plugin which are not actived even if they are in the
> default_plugins.xml file, like
>
> - org.openjump.core.ui.plugin.layer.CTSPlugIn
> after
> -org.openjump.core.ui.plugin.layer.NewLayerPropertiesPlugIn
>
> and
>
> - org.openjump.core.ui.plugin.layer.LayerPropertiesPlugIn (this is a
> duplicate)
>  after
> - com.vividsolutions.jump.workbench.ui.plugin.AddNewFeaturesPlugIn
>
> Peppe
>
> 2016-05-23 11:00 GMT+02:00 :
>
>> Peppe,
>>
>> double entries in default-plugins.xml are not dead but merely entries for
>> if a plugin is installed into more than one menu (eg. main and layerview
>> popup).
>>
>> ..ede
>>
>>
>> On 21.05.2016 17:14, Giuseppe Aruta wrote:
>> > Hi Michael,
>> > Thanks for clarification.I correct the plugin position.
>> > I was confused as there are two
>> org.openjump.core.ui.plugin.layer.LayerPropertiesPlugIn  entries on
>> default-plugins.xml file.
>> > There are also other "dead" lines.
>> > Peppe
>> >
>> > 2016-05-21 11:03 GMT+02:00 Michaël Michaud > >:
>> >
>> > Hi Peppe,
>> >
>> > I'm OK with putting LayerProperties plugin between "Zoom to Layer"
>> and "View / edit attributes"
>> >
>> > but I don't understand your previous mail.
>> > Curently, LayerProperties (old one) is just before "Zoom to Layer"
>> (line 1077 in default-plugins)
>> > NewLayerProperties is located after "Add New Features" (line 1217
>> in default-plugins)
>> >
>> > I think you don't want NewLayerProperties to be at this place...
>> >
>> > Michaël
>> >
>> >
>> >
>> > Le 21/05/2016 à 07:38, Giuseppe Aruta a écrit :
>> >> Anyhow I would prefer to have Layer Properties plugin and View /
>> edit attributes  close to each other. I would move Zoom to layer one step
>> higher.
>> >>
>> >> 2016-05-21 7:33 GMT+02:00 Giuseppe Aruta > >:
>> >>
>> >> Hi Michael,
>> >> No Michael, I found the two codes (apperently both actived)
>> and  I only substituted my commits in the same place where Layer Properties
>> was displayed on my laptop. In my case it was the reverse (from OJ4915 (the
>> one before my changes) and on my Win8): the displayed LayerPropertyPlugIn
>> was the one afte "Delete All features" while the one after
>> AddNewFeaturesPlugIn was not displayed. I uncommeted the one that was
>> active on my laptop, but left the other.
>> >> I wonder if the double code creates different menu
>> organizations on different  PC/OS
>> >> Peppe
>> >>
>> >>
>> >> 2016-05-21 1:28 GMT+02:00 Michaël Michaud <> m.michael.mich...@orange.fr>m.michael.mich...@orange.fr > m.michael.mich...@orange.fr>>:
>> >>
>> >> Hi Peppe,
>> >>
>> >> Nice looking :o)
>> >> In the default-plugin.xml, the LayerPropertyPlugIn just
>> after "Delete All features" is still the old one.
>> >> The new one is located after "Add New Features" Is it
>> intended ?
>> >> You probably wanted to replace old one by new one.
>> >>
>> >> Michaël
>> >>
>> >>
>> >> Le 20/05/2016 à 14:38, Stefan Steiniger a écrit :
>> >>>
>> >>> Hey Peppe,
>> >>>
>> >>> looks nice!
>> >>> I wondered about the package location and naming, but I
>> see now that I actually did create openjump.core.ccordsys :( or better ;)
>> >>>
>> >>> cheers,
>> >>> Stefan
>> >>>
>> >>> On 5/20/16 07:06, Giuseppe Aruta wrote:
>> 
>>  ​Hi all,
>>  An enhenced version of Layer property plugin is
>> available on OpenJUMP Nightly build 4916.
>>  Immagine incorporata 1
>>  This new version displays all the information in a nice
>> table which can be saved as HTML
>>  Among the new improvents:
>>  a) plugin can detect if selected layer is a vector,
>> image, geotabase or a WFS sand shows path/url and extension/sorce layer
>>  b) if more than a layer is selected or if selected layer
>> is a catalogue with some image files, the plugin shows the complete list of
>> the related layer/files
>>  c) Add a good capability to detect spatial reference
>> system (srid code and srs definition). This capability works well with
>> geotiffs, image/vector files with auxiliary (.aux.xml or .prj) files,
>> geodatabase or WFS (which automatically load SRID into OJ as Style)
>> 
>>  The point c) is related to few extra files [a registy
>> 

Re: [JPP-Devel] Improved version of Layer Properties plugin

2016-05-23 Thread Giuseppe Aruta
Hi Ede,

But there are some plugin which are not actived even if they are in the
default_plugins.xml file, like

- org.openjump.core.ui.plugin.layer.CTSPlugIn
after
-org.openjump.core.ui.plugin.layer.NewLayerPropertiesPlugIn

and

- org.openjump.core.ui.plugin.layer.LayerPropertiesPlugIn (this is a
duplicate)
 after
- com.vividsolutions.jump.workbench.ui.plugin.AddNewFeaturesPlugIn

Peppe

2016-05-23 11:00 GMT+02:00 :

> Peppe,
>
> double entries in default-plugins.xml are not dead but merely entries for
> if a plugin is installed into more than one menu (eg. main and layerview
> popup).
>
> ..ede
>
>
> On 21.05.2016 17:14, Giuseppe Aruta wrote:
> > Hi Michael,
> > Thanks for clarification.I correct the plugin position.
> > I was confused as there are two
> org.openjump.core.ui.plugin.layer.LayerPropertiesPlugIn  entries on
> default-plugins.xml file.
> > There are also other "dead" lines.
> > Peppe
> >
> > 2016-05-21 11:03 GMT+02:00 Michaël Michaud  >:
> >
> > Hi Peppe,
> >
> > I'm OK with putting LayerProperties plugin between "Zoom to Layer"
> and "View / edit attributes"
> >
> > but I don't understand your previous mail.
> > Curently, LayerProperties (old one) is just before "Zoom to Layer"
> (line 1077 in default-plugins)
> > NewLayerProperties is located after "Add New Features" (line 1217 in
> default-plugins)
> >
> > I think you don't want NewLayerProperties to be at this place...
> >
> > Michaël
> >
> >
> >
> > Le 21/05/2016 à 07:38, Giuseppe Aruta a écrit :
> >> Anyhow I would prefer to have Layer Properties plugin and View /
> edit attributes  close to each other. I would move Zoom to layer one step
> higher.
> >>
> >> 2016-05-21 7:33 GMT+02:00 Giuseppe Aruta  >:
> >>
> >> Hi Michael,
> >> No Michael, I found the two codes (apperently both actived)
> and  I only substituted my commits in the same place where Layer Properties
> was displayed on my laptop. In my case it was the reverse (from OJ4915 (the
> one before my changes) and on my Win8): the displayed LayerPropertyPlugIn
> was the one afte "Delete All features" while the one after
> AddNewFeaturesPlugIn was not displayed. I uncommeted the one that was
> active on my laptop, but left the other.
> >> I wonder if the double code creates different menu
> organizations on different  PC/OS
> >> Peppe
> >>
> >>
> >> 2016-05-21 1:28 GMT+02:00 Michaël Michaud < m.michael.mich...@orange.fr>m.michael.mich...@orange.fr  m.michael.mich...@orange.fr>>:
> >>
> >> Hi Peppe,
> >>
> >> Nice looking :o)
> >> In the default-plugin.xml, the LayerPropertyPlugIn just
> after "Delete All features" is still the old one.
> >> The new one is located after "Add New Features" Is it
> intended ?
> >> You probably wanted to replace old one by new one.
> >>
> >> Michaël
> >>
> >>
> >> Le 20/05/2016 à 14:38, Stefan Steiniger a écrit :
> >>>
> >>> Hey Peppe,
> >>>
> >>> looks nice!
> >>> I wondered about the package location and naming, but I
> see now that I actually did create openjump.core.ccordsys :( or better ;)
> >>>
> >>> cheers,
> >>> Stefan
> >>>
> >>> On 5/20/16 07:06, Giuseppe Aruta wrote:
> 
>  ​Hi all,
>  An enhenced version of Layer property plugin is available
> on OpenJUMP Nightly build 4916.
>  Immagine incorporata 1
>  This new version displays all the information in a nice
> table which can be saved as HTML
>  Among the new improvents:
>  a) plugin can detect if selected layer is a vector,
> image, geotabase or a WFS sand shows path/url and extension/sorce layer
>  b) if more than a layer is selected or if selected layer
> is a catalogue with some image files, the plugin shows the complete list of
> the related layer/files
>  c) Add a good capability to detect spatial reference
> system (srid code and srs definition). This capability works well with
> geotiffs, image/vector files with auxiliary (.aux.xml or .prj) files,
> geodatabase or WFS (which automatically load SRID into OJ as Style)
> 
>  The point c) is related to few extra files [a registy
> file (srid.txt) and a selection of methods (ProjUtils.java)] located into a
> new org.openjump.core.ccordsys.utils package. The codes don't affect OJ
> plugin previous structure and it desn't use other esternal libraries. The
> registry file is small as the main scope is SRS detection of files. The
> ProjUtils.java can be extended to new usage, for instance extending to
> MrSID files which may use the same GeoTIFF tag.
> 
>  As soon as possible I will write down 

[JPP-Devel] SVN: [4921] core/trunk/src/org/openjump/core/ccordsys/utils/ProjUtils.java

2016-05-23 Thread jump-pilot-svn
Revision: 4921
  http://sourceforge.net/p/jump-pilot/code/4921
Author:   ma15569
Date: 2016-05-23 10:03:05 + (Mon, 23 May 2016)
Log Message:
---
Workaround if projection definition uses other syntax than WKT or contains 
different information

Modified Paths:
--
core/trunk/src/org/openjump/core/ccordsys/utils/ProjUtils.java

Modified: core/trunk/src/org/openjump/core/ccordsys/utils/ProjUtils.java
===
--- core/trunk/src/org/openjump/core/ccordsys/utils/ProjUtils.java  
2016-05-21 17:33:58 UTC (rev 4920)
+++ core/trunk/src/org/openjump/core/ccordsys/utils/ProjUtils.java  
2016-05-23 10:03:05 UTC (rev 4921)
@@ -434,13 +434,14 @@
  * @return  - SRS definition
  */
 private static String decodeProjDescription(String textProj) {
+  String prjname = "";
+  try {
   // Workaround if aux.xml has been download from web.
   // convert HTML quotes [] to ["]
   textProj = textProj.replaceAll("", "\"");
 int start = textProj.indexOf("[\"");
 int end = textProj.indexOf("\",", start);
-String prjname = "";
-prjname = textProj.substring(start + 2, end);
+ prjname = textProj.substring(start + 2, end);
 // The following set of replacements allows to "harmonize" OGC, ESRI 
and
 // few other WKT projection definitions
 prjname = prjname.replaceAll("_", " ").replace(" / ", " ")
@@ -461,8 +462,12 @@
 .replace("\\bParis\\b", "(Paris)")
 .replace("\\bFerro\\b", "(Ferro)");
 
-return prjname;
-}
+  } catch (Exception ex) {
+  // If there is other info than a WKT definition in the aux file
+  prjname = NOT_RECOGNIZED;
+  }
+  return prjname;
+  }
 
 /**
  * returns OGC WKT string located between projection tags ( or )


--
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
___
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


Re: [JPP-Devel] Improved version of Layer Properties plugin

2016-05-23 Thread edgar . soldin
Peppe,

double entries in default-plugins.xml are not dead but merely entries for if a 
plugin is installed into more than one menu (eg. main and layerview popup).

..ede


On 21.05.2016 17:14, Giuseppe Aruta wrote:
> Hi Michael,
> Thanks for clarification.I correct the plugin position.
> I was confused as there are two 
> org.openjump.core.ui.plugin.layer.LayerPropertiesPlugIn  entries on 
> default-plugins.xml file.
> There are also other "dead" lines.
> Peppe
> 
> 2016-05-21 11:03 GMT+02:00 Michaël Michaud  >:
> 
> Hi Peppe,
> 
> I'm OK with putting LayerProperties plugin between "Zoom to Layer" and 
> "View / edit attributes"
> 
> but I don't understand your previous mail.
> Curently, LayerProperties (old one) is just before "Zoom to Layer" (line 
> 1077 in default-plugins)
> NewLayerProperties is located after "Add New Features" (line 1217 in 
> default-plugins)
> 
> I think you don't want NewLayerProperties to be at this place...
> 
> Michaël
> 
> 
> 
> Le 21/05/2016 à 07:38, Giuseppe Aruta a écrit :
>> Anyhow I would prefer to have Layer Properties plugin and View / edit 
>> attributes  close to each other. I would move Zoom to layer one step higher.
>>
>> 2016-05-21 7:33 GMT+02:00 Giuseppe Aruta > >:
>>
>> Hi Michael,
>> No Michael, I found the two codes (apperently both actived) and  I 
>> only substituted my commits in the same place where Layer Properties was 
>> displayed on my laptop. In my case it was the reverse (from OJ4915 (the one 
>> before my changes) and on my Win8): the displayed LayerPropertyPlugIn was 
>> the one afte "Delete All features" while the one after AddNewFeaturesPlugIn 
>> was not displayed. I uncommeted the one that was active on my laptop, but 
>> left the other.
>> I wonder if the double code creates different menu organizations on 
>> different  PC/OS
>> Peppe
>>
>>
>> 2016-05-21 1:28 GMT+02:00 Michaël Michaud 
>> <m.michael.mich...@orange.fr 
>> >:
>>
>> Hi Peppe,
>>
>> Nice looking :o)
>> In the default-plugin.xml, the LayerPropertyPlugIn just after 
>> "Delete All features" is still the old one.
>> The new one is located after "Add New Features" Is it intended ?
>> You probably wanted to replace old one by new one.
>>
>> Michaël
>>
>>
>> Le 20/05/2016 à 14:38, Stefan Steiniger a écrit :
>>>
>>> Hey Peppe,
>>>
>>> looks nice!
>>> I wondered about the package location and naming, but I see now 
>>> that I actually did create openjump.core.ccordsys :( or better ;)
>>>  
>>> cheers,
>>> Stefan
>>>
>>> On 5/20/16 07:06, Giuseppe Aruta wrote:

 ​Hi all,
 An enhenced version of Layer property plugin is available on 
 OpenJUMP Nightly build 4916.
 Immagine incorporata 1
 This new version displays all the information in a nice table 
 which can be saved as HTML
 Among the new improvents:
 a) plugin can detect if selected layer is a vector, image, 
 geotabase or a WFS sand shows path/url and extension/sorce layer
 b) if more than a layer is selected or if selected layer is a 
 catalogue with some image files, the plugin shows the complete list of the 
 related layer/files
 c) Add a good capability to detect spatial reference system 
 (srid code and srs definition). This capability works well with geotiffs, 
 image/vector files with auxiliary (.aux.xml or .prj) files, geodatabase or 
 WFS (which automatically load SRID into OJ as Style)

 The point c) is related to few extra files [a registy file 
 (srid.txt) and a selection of methods (ProjUtils.java)] located into a new 
 org.openjump.core.ccordsys.utils package. The codes don't affect OJ plugin 
 previous structure and it desn't use other esternal libraries. The 
 registry file is small as the main scope is SRS detection of files. The 
 ProjUtils.java can be extended to new usage, for instance extending to 
 MrSID files which may use the same GeoTIFF tag.

 As soon as possible I will write down extra user/developer 
 info on OJ wiki

 See below some screenshots

 Best regards

 Giuseppe Aruta

 A) Geotiff

 ​

 B) Image with auxiliary file


 ​

 B) shapefile with .prj file

 ​

 D) Catalogue image file


 ​