[JPP-Devel] SVN: [6662] core/trunk/src/org/openjump/core/rasterimage/algorithms/ VectorizeAlgorithm.java
Revision: 6662 http://sourceforge.net/p/jump-pilot/code/6662 Author: michaudm Date: 2020-12-27 22:51:35 + (Sun, 27 Dec 2020) Log Message: --- Add nodata value in the index to avoid a NPE Modified Paths: -- core/trunk/src/org/openjump/core/rasterimage/algorithms/VectorizeAlgorithm.java Modified: core/trunk/src/org/openjump/core/rasterimage/algorithms/VectorizeAlgorithm.java === --- core/trunk/src/org/openjump/core/rasterimage/algorithms/VectorizeAlgorithm.java 2020-12-27 22:29:19 UTC (rev 6661) +++ core/trunk/src/org/openjump/core/rasterimage/algorithms/VectorizeAlgorithm.java 2020-12-27 22:51:35 UTC (rev 6662) @@ -156,6 +156,7 @@ final ArrayList vals = new ArrayList(); final int nx = gwrapper.getNX();//rstLayer.getLayerGridExtent().getNX(); final int ny = gwrapper.getNY();// rstLayer.getLayerGridExtent().getNY(); +vals.add(nodata); for (int x = 0; x < nx; x++) {//cols for (int y = 0; y < ny; y++) {//rows final double value = gwrapper.getCellValueAsDouble(x, y, band); ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
[JPP-Devel] SVN: [6661] core/trunk/src/com/vividsolutions/jump/util/StringUtil.java
Revision: 6661 http://sourceforge.net/p/jump-pilot/code/6661 Author: michaudm Date: 2020-12-27 22:29:19 + (Sun, 27 Dec 2020) Log Message: --- Use english locale to format numbers Modified Paths: -- core/trunk/src/com/vividsolutions/jump/util/StringUtil.java Modified: core/trunk/src/com/vividsolutions/jump/util/StringUtil.java === --- core/trunk/src/com/vividsolutions/jump/util/StringUtil.java 2020-12-24 12:47:53 UTC (rev 6660) +++ core/trunk/src/com/vividsolutions/jump/util/StringUtil.java 2020-12-27 22:29:19 UTC (rev 6661) @@ -35,10 +35,7 @@ import java.io.PrintStream; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.StringTokenizer; +import java.util.*; import com.vividsolutions.jts.util.Assert; @@ -376,7 +373,7 @@ // set up a locale independent decimal formatter, using dot separator and no grouping static DecimalFormat allDecimals; static { -DecimalFormatSymbols symbols = new DecimalFormatSymbols(); +DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.ENGLISH); symbols.setDecimalSeparator('.'); allDecimals = new DecimalFormat("#0.0###", symbols); allDecimals.setGroupingUsed(false); ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] Some Sextante tools don't like negative pixel values
not sure on the how. not familiar with XML2Java myself. but any solution not throwing errors but using senseful defaults if appropriate sounds reasonable to me. it's already dealt with conditionally in com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147) so why not instead of logging an error setting a default value? again, only if that makes sense. this seems to be thrown even when starting OJ and have it create an initial project. why? where exactly are these xml infos (styles?) stored that OJ is trying to restore? after a look i could give a more informed opinion. ..ede On 27.12.2020 19:43, Michaud Michael wrote: > Hi Ede, > > I'm not aware of a mechanism to define a default value in XML2Java framework. > Currently, the default behaviour is to throw an exception if an attribute > defined in a .java2xml configuration file is not there (null). Warning > instead of throwing an exception is just a nasty hack we added to assure > backward compatibility (attribute names logging a warn message are hard-coded > in the XML2Java class). > > It could make sense to add a "default" attribute in the .java2xml object > specification to manage this kind of situation in a proper way. Ex : > > > > I can do a Feature Request in that way if you think it is a good idea. > > Michaël > > >> envoyé : 27 décembre 2020 à 16:38 >> de : edgar.sol...@web.de >> à : jump-pilot-devel@lists.sourceforge.net >> objet : Re: [JPP-Devel] Some Sextante tools don't like negative pixel values >> >> >> Mike, >> >> On 23.12.2020 11:42, Rahkonen Jukka (MML) wrote: >> >>> - about the warning : yes, this warning has been added with the interior >>> border capability. Maybe it is not really useful. It throws a warning >>> because 'interior' attribute is not really an optional tag, but it is >>> accepted (hard-coded exception) in order to guarantee backward >>> compatibility. >>> >> is there a specific reason why it is mandatory as opposed to just use a >> default value when it is missing? isn't it safe to assume we come from a old >> version if it is missing? >> >> ..ede >> >> >> ___ >> 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
Re: [JPP-Devel] Some Sextante tools don't like negative pixel values
Hi Ede,I'm not aware of a mechanism to define a default value in XML2Java framework. Currently, the default behaviour is to throw an exception if an attribute defined in a .java2xml configuration file is not there (null). Warning instead of throwing an exception is just a nasty hack we added to assure backward compatibility (attribute names logging a warn message are hard-coded in the XML2Java class).It could make sense to add a "default" attribute in the .java2xml object specification to manage this kind of situation in a proper way. Ex :I can do a Feature Request in that way if you think it is a good idea.Michaëlenvoyé : 27 décembre 2020 à 16:38de : edgar.sol...@web.deà : jump-pilot-devel@lists.sourceforge.netobjet : Re: [JPP-Devel] Some Sextante tools don't like negative pixel valuesMike,On 23.12.2020 11:42, Rahkonen Jukka (MML) wrote:- about the warning : yes, this warning has been added with the interior border capability. Maybe it is not really useful. It throws a warning because 'interior' attribute is not really an optional tag, but it is accepted (hard-coded exception) in order to guarantee backward compatibility.is there a specific reason why it is mandatory as opposed to just use a default value when it is missing? isn't it safe to assume we come from a old version if it is missing?..ede___Jump-pilot-devel mailing listJump-pilot-devel@lists.sourceforge.nethttps://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
Re: [JPP-Devel] Some Sextante tools don't like negative pixel values
Mike, On 23.12.2020 11:42, Rahkonen Jukka (MML) wrote: > - about the warning : yes, this warning has been added with the interior > border capability. Maybe it is not really useful. It throws a warning because > 'interior' attribute is not really an optional tag, but it is accepted > (hard-coded exception) in order to guarantee backward compatibility. is there a specific reason why it is mandatory as opposed to just use a default value when it is missing? isn't it safe to assume we come from a old version if it is missing? ..ede ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel