Re: [JPP-Devel] Fwd: [jump-pilot:bugs] Re: #498 Most GeoTIFF drivers fail with a simple GeoTIFF image

2020-09-20 Thread edgar . soldin
On 20.09.2020 18:53, Giuseppe Aruta wrote:
> :-)
> Sorry for misunderstanding.

nuhhh. no problemo.

> Roberto starts the course at the 1 of October. 
> He can use OJ 1.15, as well: apart from framework to read raster, there are 
> no so many changes in raster tool, except the new pixel inspector capability.

good to hear. anyway. just committed some changes that you guys should try out. 
for error reporting please set verbosity to debug!!! this can be done as 
runtime argument to the starter '-v debug' or by editing the start script 
(oj-windows.bat, oj_linux.sh) and adding it to the JUMP_OPTS variable in the 
header.

..ede


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


[JPP-Devel] SVN: [6504] core/trunk/scripts

2020-09-20 Thread jump-pilot-svn--- via Jump-pilot-devel
Revision: 6504
  http://sourceforge.net/p/jump-pilot/code/6504
Author:   edso
Date: 2020-09-20 22:41:49 + (Sun, 20 Sep 2020)
Log Message:
---
enable/explain JUMP_OPTS setting in start scripts

Modified Paths:
--
core/trunk/scripts/oj_linux.sh
core/trunk/scripts/oj_windows.bat

Modified: core/trunk/scripts/oj_linux.sh
===
--- core/trunk/scripts/oj_linux.sh  2020-09-20 22:17:08 UTC (rev 6503)
+++ core/trunk/scripts/oj_linux.sh  2020-09-20 22:41:49 UTC (rev 6504)
@@ -17,6 +17,10 @@
 ## to overwrite OS default locale setting
 #JAVA_LANG="-Duser.language=de -Duser.country=DE"
 
+## uncomment and edit if you want some default OJ parameter set
+## run OJ with '--help' argument to find out which are available
+#JUMP_OPTS="-v DEBUG"
+
 ## set some defaults (as macosx.command uses this script, it might define 
other defaults)
 MAIN="com.vividsolutions.jump.workbench.JUMPWorkbench"
 JAVA_SAXDRIVER=${JAVA_SAXDRIVER-org.apache.xerces.parsers.SAXParser}
@@ -217,16 +221,16 @@
 CLASSPATH=.:./bin:./conf:$CLASSPATH
 export CLASSPATH;
 
-## compile jump opts
+## prepend jump opts
 #
-JUMP_OPTS="-plug-in-directory $JUMP_PLUGIN_DIR"
+JUMP_OPTS="-plug-in-directory '$JUMP_PLUGIN_DIR' $JUMP_OPTS"
 if [ -f "$JUMP_PLUGINS" ]; then
-  JUMP_OPTS="$JUMP_OPTS -default-plugins $JUMP_PLUGINS"
+  JUMP_OPTS="-default-plugins '$JUMP_PLUGINS' $JUMP_OPTS"
 fi
 # workbench-properties.xml is used to manually load plugins (ISA uses this)
 JUMP_PROPERTIES=./bin/workbench-properties.xml
 if [ -n "$JUMP_PROPERTIES" ] && [ -f "$JUMP_PROPERTIES" ]; then
-  JUMP_OPTS="$JUMP_OPTS -properties $JUMP_PROPERTIES"
+  JUMP_OPTS="-properties '$JUMP_PROPERTIES' $JUMP_OPTS"
 fi
 
 # compile jre opts, respect already set ones from e.g. mac

Modified: core/trunk/scripts/oj_windows.bat
===
--- core/trunk/scripts/oj_windows.bat   2020-09-20 22:17:08 UTC (rev 6503)
+++ core/trunk/scripts/oj_windows.bat   2020-09-20 22:41:49 UTC (rev 6504)
@@ -16,6 +16,7 @@
 rem set JAVA_BIN=java
 
 rem -- set some default OJ options here (eg. -v debug), initialize empty --
+rem -- run OJ with '--help' argument to find out which are available --
 set JUMP_OPTS=
 
 rem -- set some java runtime options here, initialize empty --



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


[JPP-Devel] SVN: [6503] core/trunk/src/org/openjump/core

2020-09-20 Thread jump-pilot-svn--- via Jump-pilot-devel
Revision: 6503
  http://sourceforge.net/p/jump-pilot/code/6503
Author:   edso
Date: 2020-09-20 22:17:08 + (Sun, 20 Sep 2020)
Log Message:
---
created TiffUtilsV2, basically a caching static wrapper for GeoReferencedImage
general speedup because of reusing the established image source
replaced all TIF JAI.create("ImageRead", ...) with TiffUtilsV2.getRenderedOp()
added TiffUtilsV2.getEnvelope() to retrieve georeferencing from one point
added some logging

TODO:
port TiffUtils.readImage() and others over to TiffUtilsV2
especially the two readImage() methods can possibly be simplified a lot reusing 
GeoReferencedImage functionality

Modified Paths:
--
core/trunk/src/org/openjump/core/rasterimage/OverviewsUtils.java
core/trunk/src/org/openjump/core/rasterimage/RasterImageIO.java
core/trunk/src/org/openjump/core/rasterimage/RasterImageLayer.java
core/trunk/src/org/openjump/core/rasterimage/TiffUtils.java
core/trunk/src/org/openjump/core/ui/plugin/raster/RasterQueryCursorTool.java

Added Paths:
---
core/trunk/src/org/openjump/core/rasterimage/TiffUtilsV2.java

Modified: core/trunk/src/org/openjump/core/rasterimage/OverviewsUtils.java
===
--- core/trunk/src/org/openjump/core/rasterimage/OverviewsUtils.java
2020-09-20 21:39:16 UTC (rev 6502)
+++ core/trunk/src/org/openjump/core/rasterimage/OverviewsUtils.java
2020-09-20 22:17:08 UTC (rev 6503)
@@ -91,10 +91,11 @@
  */
 public static void createOverviews(File tiffFile, int overviewsCount) 
throws IOException {
 
-ParameterBlock pbjRead = new ParameterBlock();
-pbjRead.add(ImageIO.createImageInputStream(tiffFile));
-RenderedOp originalImage = JAI.create("ImageRead", pbjRead, null);
+//ParameterBlock pbjRead = new ParameterBlock();
+//pbjRead.add(ImageIO.createImageInputStream(tiffFile));
+//RenderedOp originalImage = JAI.create("ImageRead", pbjRead, null);
 
+RenderedOp originalImage = TiffUtilsV2.getRenderedOp(tiffFile);
 
 OutputStream out = new FileOutputStream(new File(tiffFile.getParent(), 
tiffFile.getName() + ".ovr"));
 

Modified: core/trunk/src/org/openjump/core/rasterimage/RasterImageIO.java
===
--- core/trunk/src/org/openjump/core/rasterimage/RasterImageIO.java 
2020-09-20 21:39:16 UTC (rev 6502)
+++ core/trunk/src/org/openjump/core/rasterimage/RasterImageIO.java 
2020-09-20 22:17:08 UTC (rev 6503)
@@ -126,26 +126,29 @@
new Point(bImage.getWidth(), 
bImage.getHeight()), cellSize,
cellSize, Double.NaN, stats));
 
-   } else if (fileNameOrURL.toLowerCase().endsWith(".tif")
-   || 
fileNameOrURL.toLowerCase().endsWith(".tiff")) {
+} else if (fileNameOrURL.toLowerCase().endsWith(".tif") || 
fileNameOrURL.toLowerCase().endsWith(".tiff")) {
 
-   TiffMetadata tiffMetadata = TiffTags.readMetadata(new 
File(
-   fileNameOrURL));
+  File tiffFile = new File(fileNameOrURL);
 
-   int imgWidth = tiffMetadata.getColsCount();
-   int imgHeight = tiffMetadata.getRowsCount();
+// TiffMetadata tiffMetadata = TiffTags.readMetadata(new 
File(
+// fileNameOrURL));
+//
+// int imgWidth = tiffMetadata.getColsCount();
+// int imgHeight = tiffMetadata.getRowsCount();
+//
+// Envelope imageEnvelope = tiffMetadata.getEnvelope();
+  // Envelope imageEnvelope = getGeoReferencing(fileNameOrURL, true,
+  // new Point(imgWidth, imgHeight));
 
-   Envelope imageEnvelope = tiffMetadata.getEnvelope();
-   //  Envelope imageEnvelope = 
getGeoReferencing(fileNameOrURL, true,
-   //  new Point(imgWidth, imgHeight));
+// Overviews overviews = OverviewsUtils.getOverviews(new 
File(
+// fileNameOrURL), imageEnvelope);
 
-   Overviews overviews = OverviewsUtils.getOverviews(new 
File(
-   fileNameOrURL), imageEnvelope);
+  Envelope imageEnvelope = TiffUtilsV2.getEnvelope(tiffFile);
+  Overviews overviews = OverviewsUtils.getOverviews(new 
File(fileNameOrURL), imageEnvelope);
 
-   return TiffUtils.readImage(new File(fileNameOrURL),
-   viewPortEnvelope, requestedRes, 
overviews, stats);
+  return TiffUtils.readImage(tiffFile, viewPortEnvelope, requestedRes, 
overviews, stats);
 
-   } else if (fileNameOrURL.toLowerCase().endsWith(".flt")) {
+} else if 

[JPP-Devel] SVN: [6502] core/trunk/src/com/vividsolutions/jump/workbench/imagery/ geoimg

2020-09-20 Thread jump-pilot-svn--- via Jump-pilot-devel
Revision: 6502
  http://sourceforge.net/p/jump-pilot/code/6502
Author:   edso
Date: 2020-09-20 21:39:16 + (Sun, 20 Sep 2020)
Log Message:
---
de-abstract GeoRaster, it's totally valid to use it independent 
ReferencedGeoRaster functionality
minor refinements
make errors in fixed_reader final
little cleanup, removed obsolete code

Modified Paths:
--

core/trunk/src/com/vividsolutions/jump/workbench/imagery/geoimg/GeoRaster.java

core/trunk/src/com/vividsolutions/jump/workbench/imagery/geoimg/GeoReferencedRaster.java

Modified: 
core/trunk/src/com/vividsolutions/jump/workbench/imagery/geoimg/GeoRaster.java
===
--- 
core/trunk/src/com/vividsolutions/jump/workbench/imagery/geoimg/GeoRaster.java  
2020-09-20 19:02:12 UTC (rev 6501)
+++ 
core/trunk/src/com/vividsolutions/jump/workbench/imagery/geoimg/GeoRaster.java  
2020-09-20 21:39:16 UTC (rev 6502)
@@ -81,8 +81,9 @@
 import com.vividsolutions.jump.workbench.model.Disposable;
 import com.vividsolutions.jump.workbench.model.Prioritized;
 
-public abstract class GeoRaster implements Disposable {
+public class GeoRaster implements Disposable {
   protected String imageFileLocation;
+  private URI uri = null;
   protected Object fixed_reader = null;
   protected RenderedOp src = null;
   private ImageReader src_reader = null;
@@ -128,9 +129,12 @@
   public GeoRaster(String imageFileLocation, Object fixed_reader) {
 this.imageFileLocation = imageFileLocation;
 this.fixed_reader = fixed_reader;
+  }
 
+  protected URI getURI() {
+return uri;
   }
-
+  
   /**
* Basic fetchRasters retrieves a raster from a file. To get a raster from
* somewhere else, override this method in subclasses.
@@ -140,12 +144,17 @@
* @throws ReferencedImageException
*/
   protected void fetchRaster() throws ReferencedImageException {
-final URI uri;
+// we accept either URI strings or string file paths
 try {
   uri = new URI(imageFileLocation);
 } catch (URISyntaxException e) {
-  throw new ReferencedImageException(e);
+  Logger.debug("not an URI, will treat as path -> "+imageFileLocation, e);
+  File file = new File(imageFileLocation);
+  uri = file.toURI();
 }
+// check availability early
+if (!new File(uri).canRead())
+  throw new ReferencedImageException("cannot read file -> 
"+imageFileLocation);
 
 // prepare jai parameters
 final ParameterBlockJAI pbjImageRead;
@@ -153,77 +162,77 @@
 pbjImageRead = new ParameterBlockJAI("ImageRead");
 pbjImageRead.setParameter("readParam", param);
 
-try {
-  // route, if fixed_reader was set
-  List affirmed_readers;
-  // default case, auto detection
-  if (fixed_reader == null) {
-affirmed_readers = new ArrayList(listValidImageIOReaders(uri, null));
-// sort readers by priority
-Collections.sort(affirmed_readers, new Comparator() {
-  public int compare(final ImageReaderSpi o1, final ImageReaderSpi o2) 
{
-final Prioritized p1 = new Prioritized() {
-  public int getPriority() {
-return GeoImageFactory.getPriority(o1);
-  }
-};
-final Prioritized p2 = new Prioritized() {
-  public int getPriority() {
-return GeoImageFactory.getPriority(o2);
-  }
-};
+// route, if fixed_reader was set
+List affirmed_readers;
+// default case, auto detection
+if (fixed_reader == null) {
+  affirmed_readers = new ArrayList(listValidImageIOReaders(uri, null));
+  // sort readers by priority
+  Collections.sort(affirmed_readers, new Comparator() {
+public int compare(final ImageReaderSpi o1, final ImageReaderSpi o2) {
+  final Prioritized p1 = new Prioritized() {
+public int getPriority() {
+  return GeoImageFactory.getPriority(o1);
+}
+  };
+  final Prioritized p2 = new Prioritized() {
+public int getPriority() {
+  return GeoImageFactory.getPriority(o2);
+}
+  };
 //
System.out.println(o1+"="+p1.getPriority()+"/"+o2+"="+p2.getPriority());
-return Prioritized.COMPARATOR.compare(p1, p2);
-  }
-});
-  }
-  // fixed reader is imageio reader
-  else if (fixed_reader instanceof ImageReaderSpi)
-affirmed_readers = Collections.singletonList((ImageReaderSpi) 
fixed_reader);
-  else {
-// fixed reader is something else, hopefully jai codec ;)
-// simply define an empty imageio reader list here to skip to jai below
-affirmed_readers = Collections.emptyList();
-  }
+  return Prioritized.COMPARATOR.compare(p1, p2);
+}
+  });
+}
+// fixed reader is imageio reader
+else if (fixed_reader instanceof ImageReaderSpi)
+  affirmed_readers = 

[JPP-Devel] SVN: [6501] core/trunk/src/org/geotools/shapefile/Shapefile.java

2020-09-20 Thread jump-pilot-svn--- via Jump-pilot-devel
Revision: 6501
  http://sourceforge.net/p/jump-pilot/code/6501
Author:   edso
Date: 2020-09-20 19:02:12 + (Sun, 20 Sep 2020)
Log Message:
---
minor cleanup

Modified Paths:
--
core/trunk/src/org/geotools/shapefile/Shapefile.java

Modified: core/trunk/src/org/geotools/shapefile/Shapefile.java
===
--- core/trunk/src/org/geotools/shapefile/Shapefile.java2020-09-20 
18:57:11 UTC (rev 6500)
+++ core/trunk/src/org/geotools/shapefile/Shapefile.java2020-09-20 
19:02:12 UTC (rev 6501)
@@ -146,7 +146,6 @@
 Logger.warn("found a negative content length (" + 
contentLength + ")");
 continue;
 }
-long lastUpdatedAt = 0L;
 try{
 body = handler.read(file,geometryFactory,contentLength);
 Logger.debug("" + recordNumber + " : from " + (pos-4) + " 
for " + contentLength + " (" + body.getNumPoints() + " pts)");
@@ -504,7 +503,6 @@
 TaskMonitorUtil.report(getTaskMonitor(),
 I18N.getMessage("Reader.parsed-{0}-features", 
String.format("%,10d", count)));
   }
-  
 }
 
 }



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


[JPP-Devel] SVN: [6500] core/trunk/src

2020-09-20 Thread jump-pilot-svn--- via Jump-pilot-devel
Revision: 6500
  http://sourceforge.net/p/jump-pilot/code/6500
Author:   edso
Date: 2020-09-20 18:57:11 + (Sun, 20 Sep 2020)
Log Message:
---
implement Taskmonitor and Cancelling in ShapeFileReader

Modified Paths:
--
core/trunk/src/com/vividsolutions/jump/io/ShapefileReader.java

core/trunk/src/com/vividsolutions/jump/io/datasource/ReaderWriterFileDataSource.java
core/trunk/src/org/geotools/shapefile/Shapefile.java

Added Paths:
---
core/trunk/src/com/vividsolutions/jump/task/TaskCancelledException.java

Modified: core/trunk/src/com/vividsolutions/jump/io/ShapefileReader.java
===
--- core/trunk/src/com/vividsolutions/jump/io/ShapefileReader.java  
2020-09-20 18:51:52 UTC (rev 6499)
+++ core/trunk/src/com/vividsolutions/jump/io/ShapefileReader.java  
2020-09-20 18:57:11 UTC (rev 6500)
@@ -132,8 +132,10 @@
 throw new 
IllegalParametersException(I18N.get("io.ShapefileReader.no-file-property-specified"));
 }
 
-//okay, we have .shp and .dbf file paths, lets create Shapefile and 
DbfFile
+// okay, we have .shp and .dbf file paths, lets create Shapefile and 
DbfFile
 Shapefile myshape = getShapefile(shpFileName, 
dp.getProperty(DataSource.COMPRESSED_KEY));
+// attach task monitor
+myshape.setTaskMonitor(getTaskMonitor());
 
 // charset used to read dbf (one charset defined by cpg file,
 // charset defined in dp or default platform charset)
@@ -147,7 +149,7 @@
 GeometryFactory factory = new GeometryFactory();
 GeometryCollection collection;
 // Read the shapefile either from shx (if provided) or directly 
from shp
-   collection = shx == null ? myshape.read(factory) : 
myshape.readFromIndex(factory, shx);
+collection = shx == null ? myshape.read(factory) : 
myshape.readFromIndex(factory, shx);
 
 // Minimal schema for FeatureCollection (if no dbf is provided)
 FeatureSchema fs = new FeatureSchema();

Modified: 
core/trunk/src/com/vividsolutions/jump/io/datasource/ReaderWriterFileDataSource.java
===
--- 
core/trunk/src/com/vividsolutions/jump/io/datasource/ReaderWriterFileDataSource.java
2020-09-20 18:51:52 UTC (rev 6499)
+++ 
core/trunk/src/com/vividsolutions/jump/io/datasource/ReaderWriterFileDataSource.java
2020-09-20 18:57:11 UTC (rev 6500)
@@ -45,6 +45,7 @@
 import com.vividsolutions.jump.io.DriverProperties;
 import com.vividsolutions.jump.io.JUMPReader;
 import com.vividsolutions.jump.io.JUMPWriter;
+import com.vividsolutions.jump.task.TaskCancelledException;
 import com.vividsolutions.jump.task.TaskMonitor;
 import com.vividsolutions.jump.task.TaskMonitorSupport;
 import com.vividsolutions.jump.task.TaskMonitorUtil;
@@ -107,7 +108,13 @@
 
   exceptions.addAll(reader.getExceptions());
   return fc;
-} catch (Exception e) {
+}
+// we were cancelled
+catch (TaskCancelledException e) {
+  // "nothing to see here. please disperse!"
+  return null;
+}
+catch (Exception e) {
   exceptions.add(e);
   return null;
   // <> Modify Readers and Writers to store exceptions and

Added: core/trunk/src/com/vividsolutions/jump/task/TaskCancelledException.java
===
--- core/trunk/src/com/vividsolutions/jump/task/TaskCancelledException.java 
(rev 0)
+++ core/trunk/src/com/vividsolutions/jump/task/TaskCancelledException.java 
2020-09-20 18:57:11 UTC (rev 6500)
@@ -0,0 +1,13 @@
+package com.vividsolutions.jump.task;
+
+import com.vividsolutions.jump.JUMPException;
+
+/**
+ * a simple way to signal whatever was done down the line
+ * was cancelled whereever this was thrown
+ */
+public class TaskCancelledException extends JUMPException {
+  public TaskCancelledException() {
+super("");
+  }
+}


Property changes on: 
core/trunk/src/com/vividsolutions/jump/task/TaskCancelledException.java
___
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: core/trunk/src/org/geotools/shapefile/Shapefile.java
===
--- core/trunk/src/org/geotools/shapefile/Shapefile.java2020-09-20 
18:51:52 UTC (rev 6499)
+++ core/trunk/src/org/geotools/shapefile/Shapefile.java2020-09-20 
18:57:11 UTC (rev 6500)
@@ -7,8 +7,11 @@
 import java.util.ArrayList;
 
 import com.vividsolutions.jts.geom.*;
+import com.vividsolutions.jump.I18N;
 import com.vividsolutions.jump.io.EndianDataInputStream;
 import com.vividsolutions.jump.io.EndianDataOutputStream;
+import com.vividsolutions.jump.task.*;
+import 

[JPP-Devel] SVN: [6499] core/trunk/src/com/vividsolutions/jump/util/Timer.java

2020-09-20 Thread jump-pilot-svn--- via Jump-pilot-devel
Revision: 6499
  http://sourceforge.net/p/jump-pilot/code/6499
Author:   edso
Date: 2020-09-20 18:51:52 + (Sun, 20 Sep 2020)
Log Message:
---
add utility method now() to replace repeated milliSecondsSince(0) calls

Modified Paths:
--
core/trunk/src/com/vividsolutions/jump/util/Timer.java

Modified: core/trunk/src/com/vividsolutions/jump/util/Timer.java
===
--- core/trunk/src/com/vividsolutions/jump/util/Timer.java  2020-09-20 
14:48:50 UTC (rev 6498)
+++ core/trunk/src/com/vividsolutions/jump/util/Timer.java  2020-09-20 
18:51:52 UTC (rev 6499)
@@ -3,6 +3,14 @@
 public class Timer {
   /**
*  a helper method to measure time frames in milliseconds 
+   * @return current time in milliseconds
+   */
+  public static long now(){
+return System.currentTimeMillis();
+  }
+
+  /**
+   *  a helper method to measure time frames in milliseconds 
* @param i time in milliseconds
* @return milliseconds since time
*/



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


Re: [JPP-Devel] Fwd: [jump-pilot:bugs] Re: #498 Most GeoTIFF drivers fail with a simple GeoTIFF image

2020-09-20 Thread Giuseppe Aruta
:-)
Sorry for misunderstanding.
Roberto starts the course at the 1 of October.
He can use OJ 1.15, as well: apart from framework to read raster, there are
no so many changes in raster tool, except the new pixel inspector
capability.
Peppe


Il dom 20 set 2020, 18:42  ha scritto:

> Peppe,
>
> misunderstanding ;). my question is when do you need it working as stable
> or better as in OJ 1.15? when do the courses start? ..ede
>
> On 20.09.2020 18:19, Giuseppe Aruta wrote:
> > Hi Ede
> >>what was your time frame again?
> > TiffUtils ->6398  30/08/2020
> > RasterImageLayer  -> 6399   31/08/2020
> > RasterImageIO  -->5413  01/04/2017
> > AddRasterImageLayerWizard   --> 5916  18/08/2018
> >
> > All my modification started from 02/09/2020
> >
> > Il giorno dom 20 set 2020 alle ore 14:52  edgar.sol...@web.de>> ha scritto:
> >
> > Mike, Jukka,
> >
> > as you are far more knowledgeable wrt. to file formats you maybe
> want to come up with some tiled TIFFs or otherwise difficult formats that
> are currently not readable by Apache Commons Imaging as requested below?!
> >
> > tickets can be opened (after a short account creation) on
> https://issues.apache.org/jira/projects/IMAGING/summary <
> https://issues.apache.org/jira/projects/IMAGING/summary>
> >
> > ..ede
> >
> >  Forwarded Message 
> > Subject:[JPP-Devel] [jump-pilot:bugs] Re: #498 Most GeoTIFF
> drivers fail with a simple GeoTIFF image
> > Date:   Sat, 19 Sep 2020 03:15:16 -
> > From:   G. W. Lucas via Jump-pilot-devel <
> jump-pilot-devel@lists.sourceforge.net  jump-pilot-devel@lists.sourceforge.net>>
> > Reply-To:   [jump-pilot:bugs] <
> 4...@bugs.jump-pilot.p.re.sourceforge.net  4...@bugs.jump-pilot.p.re.sourceforge.net>>, OpenJump develop and use <
> jump-pilot-devel@lists.sourceforge.net  jump-pilot-devel@lists.sourceforge.net>>
> > To: jump-pilot-devel@lists.sourceforge.net  jump-pilot-devel@lists.sourceforge.net>
> > CC: G. W. Lucas  gwlu...@users.sourceforge.net>>
> >
> >
> >
> > The problem is due to a TIFF format that is not supported by
> Commons-Imaging. I posted some notes to your bug report. I completed a code
> change and the fix is in the pipeline.
> >
> > Thanks for the test file. It helped a lot. If you have others
> (particular examples using a tile-organization rather than strips), I'd
> welcome them.
> >
> > ___
> > Jump-pilot-devel mailing list
> > Jump-pilot-devel@lists.sourceforge.net  Jump-pilot-devel@lists.sourceforge.net>
> > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel <
> 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


Re: [JPP-Devel] Fwd: [jump-pilot:bugs] Re: #498 Most GeoTIFF drivers fail with a simple GeoTIFF image

2020-09-20 Thread edgar . soldin
Peppe,

misunderstanding ;). my question is when do you need it working as stable or 
better as in OJ 1.15? when do the courses start? ..ede

On 20.09.2020 18:19, Giuseppe Aruta wrote:
> Hi Ede
>>what was your time frame again?
> TiffUtils ->6398  30/08/2020
> RasterImageLayer  -> 6399   31/08/2020
> RasterImageIO  -->5413  01/04/2017
> AddRasterImageLayerWizard   --> 5916  18/08/2018
>
> All my modification started from 02/09/2020
>
> Il giorno dom 20 set 2020 alle ore 14:52  > ha scritto:
>
> Mike, Jukka,
>
> as you are far more knowledgeable wrt. to file formats you maybe want to 
> come up with some tiled TIFFs or otherwise difficult formats that are 
> currently not readable by Apache Commons Imaging as requested below?!
>
> tickets can be opened (after a short account creation) on 
> https://issues.apache.org/jira/projects/IMAGING/summary 
> 
>
> ..ede
>
>  Forwarded Message 
> Subject:        [JPP-Devel] [jump-pilot:bugs] Re: #498 Most GeoTIFF 
> drivers fail with a simple GeoTIFF image
> Date:   Sat, 19 Sep 2020 03:15:16 -
> From:   G. W. Lucas via Jump-pilot-devel 
>  >
> Reply-To:       [jump-pilot:bugs] 
> <4...@bugs.jump-pilot.p.re.sourceforge.net 
> >, OpenJump develop and use 
>  >
> To:     jump-pilot-devel@lists.sourceforge.net 
> 
> CC:     G. W. Lucas  >
>
>
>
> The problem is due to a TIFF format that is not supported by 
> Commons-Imaging. I posted some notes to your bug report. I completed a code 
> change and the fix is in the pipeline.
>
> Thanks for the test file. It helped a lot. If you have others (particular 
> examples using a tile-organization rather than strips), I'd welcome them.
>
> ___
> 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] Fwd: [jump-pilot:bugs] Re: #498 Most GeoTIFF drivers fail with a simple GeoTIFF image

2020-09-20 Thread Giuseppe Aruta
Hi Ede
>what was your time frame again?
TiffUtils ->6398  30/08/2020
RasterImageLayer  -> 6399   31/08/2020
RasterImageIO  -->5413  01/04/2017
AddRasterImageLayerWizard   --> 5916  18/08/2018

All my modification started from 02/09/2020

Il giorno dom 20 set 2020 alle ore 14:52  ha scritto:

> Mike, Jukka,
>
> as you are far more knowledgeable wrt. to file formats you maybe want to
> come up with some tiled TIFFs or otherwise difficult formats that are
> currently not readable by Apache Commons Imaging as requested below?!
>
> tickets can be opened (after a short account creation) on
> https://issues.apache.org/jira/projects/IMAGING/summary
>
> ..ede
>
>  Forwarded Message 
> Subject:[JPP-Devel] [jump-pilot:bugs] Re: #498 Most GeoTIFF
> drivers fail with a simple GeoTIFF image
> Date:   Sat, 19 Sep 2020 03:15:16 -
> From:   G. W. Lucas via Jump-pilot-devel <
> jump-pilot-devel@lists.sourceforge.net>
> Reply-To:   [jump-pilot:bugs] <
> 4...@bugs.jump-pilot.p.re.sourceforge.net>, OpenJump develop and use <
> jump-pilot-devel@lists.sourceforge.net>
> To: jump-pilot-devel@lists.sourceforge.net
> CC: G. W. Lucas 
>
>
>
> The problem is due to a TIFF format that is not supported by
> Commons-Imaging. I posted some notes to your bug report. I completed a code
> change and the fix is in the pipeline.
>
> Thanks for the test file. It helped a lot. If you have others (particular
> examples using a tile-organization rather than strips), I'd welcome them.
>
> ___
> 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: [6498] core/trunk/src/org/openjump/core/rasterimage/TiffUtils.java

2020-09-20 Thread jump-pilot-svn--- via Jump-pilot-devel
Revision: 6498
  http://sourceforge.net/p/jump-pilot/code/6498
Author:   edso
Date: 2020-09-20 14:48:50 + (Sun, 20 Sep 2020)
Log Message:
---
just reformatting mixed tab/spaces indention to spaces only/tabwidth 2 spaces

Modified Paths:
--
core/trunk/src/org/openjump/core/rasterimage/TiffUtils.java

Modified: core/trunk/src/org/openjump/core/rasterimage/TiffUtils.java
===
--- core/trunk/src/org/openjump/core/rasterimage/TiffUtils.java 2020-09-20 
12:56:33 UTC (rev 6497)
+++ core/trunk/src/org/openjump/core/rasterimage/TiffUtils.java 2020-09-20 
14:48:50 UTC (rev 6498)
@@ -39,355 +39,338 @@
  * @author AdL
  */
 public class TiffUtils {
-
-public static ImageAndMetadata readImage(
-File tiffFile, Envelope viewportEnvelope, Resolution requestedRes, 
Overviews overviews, Stats stats)
-throws NoninvertibleTransformException, IOException, 
FileNotFoundException, TiffTags.TiffReadingException, Exception {
-
-// Try to read geotiff tags
-TiffTags.TiffMetadata tiffMetadata = TiffTags.readMetadata(tiffFile);
-int originalImageWidth = tiffMetadata.getColsCount();
-int originalImageHeight = tiffMetadata.getRowsCount();
-Resolution cellSize = tiffMetadata.getResolution();
-Double noData = tiffMetadata.getNoData();
-
-// Now try with tfw
-if(cellSize == null) {
-WorldFileHandler worldFileHandler = new 
WorldFileHandler(tiffFile.getAbsolutePath(), true);
-Envelope envelope = 
worldFileHandler.readWorldFile(originalImageWidth, originalImageHeight);
-cellSize = new Resolution(
-envelope.getWidth() / originalImageWidth,
-envelope.getHeight() / originalImageHeight);
-}
-
-  Envelope wholeImageEnvelope = 
RasterImageIO.getGeoReferencing(tiffFile.getAbsolutePath(), true, new Point 
(originalImageWidth, originalImageHeight));
-
-if(requestedRes == null) {
-requestedRes = cellSize;
-}
-
-int overviewLevel = overviews.pickOverviewLevel(requestedRes);
 
-if(stats == null) {
-// Statistics on all pixels
-stats = calculateStats(tiffFile, noData, tiffFile);
-}
-
-if(overviews.getOverviewsCount() == 1) {
-
-// No overviews, decimation (subsampling)  
+  public static ImageAndMetadata readImage(File tiffFile, Envelope 
viewportEnvelope, Resolution requestedRes,
+  Overviews overviews, Stats stats) throws 
NoninvertibleTransformException, IOException, FileNotFoundException,
+  TiffTags.TiffReadingException, Exception {
 
-float xScale = (float) (cellSize.getX() / requestedRes.getX());
-float yScale = (float) (cellSize.getY() / requestedRes.getY());
-xScale = Math.min(xScale, 1);
-yScale = Math.min(yScale, 1);
-
-RenderedOp renderedOp = readSubsampled(tiffFile, xScale, yScale);
-
-// For better looking results, but slower:
-// rop = JAI.create("SubsampleAverage", pb);
+// Try to read geotiff tags
+TiffTags.TiffMetadata tiffMetadata = TiffTags.readMetadata(tiffFile);
+int originalImageWidth = tiffMetadata.getColsCount();
+int originalImageHeight = tiffMetadata.getRowsCount();
+Resolution cellSize = tiffMetadata.getResolution();
+Double noData = tiffMetadata.getNoData();
 
-Resolution subsetResolution = new Resolution(
-wholeImageEnvelope.getWidth() / renderedOp.getWidth(),
-wholeImageEnvelope.getHeight() / renderedOp.getHeight());
-   
-Rectangle imageSubset = RasterImageIO.getDrawingRectangle(
-renderedOp.getWidth(),
-renderedOp.getHeight(),
-wholeImageEnvelope,
-viewportEnvelope,
-subsetResolution);
-
-BufferedImage bufferedImage;
-Envelope imagePartEnvelope;
-int actualImageWidth;
-int actualImageHeight;
-if(imageSubset == null) {
-bufferedImage = null;
-imagePartEnvelope = null;
-actualImageWidth = 0;
-actualImageHeight = 0;
-} else {
-bufferedImage = renderedOp.getAsBufferedImage(imageSubset, 
null);
-imagePartEnvelope = 
TiffUtils.getImageSubsetEnvelope(wholeImageEnvelope, imageSubset, 
subsetResolution);
-actualImageWidth = bufferedImage.getWidth();
-actualImageHeight = bufferedImage.getHeight();
-}
-
-Metadata metadata = new Metadata(
-wholeImageEnvelope, imagePartEnvelope,
-   

[JPP-Devel] apache commons imaging vs. monoband tiffs

2020-09-20 Thread edgar . soldin
fyi,

just opened an issue wrt. to a monoband raster provided by Peppe
https://issues.apache.org/jira/browse/IMAGING-267

..ede


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


[JPP-Devel] SVN: [6497] core/trunk/src/com/vividsolutions/jump/workbench/imagery/ geoimg/GeoImageFactory.java

2020-09-20 Thread jump-pilot-svn--- via Jump-pilot-devel
Revision: 6497
  http://sourceforge.net/p/jump-pilot/code/6497
Author:   edso
Date: 2020-09-20 12:56:33 + (Sun, 20 Sep 2020)
Log Message:
---
reordered/added priority for JP2GDAL readers as agreed in 
https://sourceforge.net/p/jump-pilot/bugs/430/

Modified Paths:
--

core/trunk/src/com/vividsolutions/jump/workbench/imagery/geoimg/GeoImageFactory.java

Modified: 
core/trunk/src/com/vividsolutions/jump/workbench/imagery/geoimg/GeoImageFactory.java
===
--- 
core/trunk/src/com/vividsolutions/jump/workbench/imagery/geoimg/GeoImageFactory.java
2020-09-18 12:15:58 UTC (rev 6496)
+++ 
core/trunk/src/com/vividsolutions/jump/workbench/imagery/geoimg/GeoImageFactory.java
2020-09-20 12:56:33 UTC (rev 6497)
@@ -209,40 +209,42 @@
 return getPriority(loader);
   }
 
-  // return a pririty for the given loader object
+  // return a priority for the given loader object
   public static int getPriority(Object loader) {
 String name = loader.getClass().getName();
 
 // some special cases
 if 
(name.equals("com.vividsolutions.jump.workbench.imagery.imageio.JP2GDALOpenJPEGImageReaderSpi"))
-  return Prioritized.NOPRIORITY; // currently very unstable
+  return 10; // tested and working well, preferred for JP2
+if 
(name.equals("com.vividsolutions.jump.workbench.imagery.imageio.JP2GDALEcwImageReaderSpi"))
+  return 15; // tested and working well, second best choice for JP2 
currently
 if 
(name.equals("it.geosolutions.imageio.plugins.jp2ecw.JP2GDALEcwImageReaderSpi"))
   return Prioritized.NOPRIORITY; // replaced by our patched version under 
com.vividsolutions.jump.workbench.imagery
 
 // we've got some patched
 if (name.startsWith("com.vividsolutions.jump.workbench.imagery")) {
-  return 10;
+  return 20;
 }
-// prefer oss jai core implementation over all
+// prefer oss jai core implementation, currently only TIF
 else if (name.startsWith("com.github.jaiimageio")){
-  return 19;
+  return 30;
 }
 // next are imageio-ext readers
 else if (name.startsWith("it.geosolutions.imageio")){
   // prefer plain java readers
   if (classGDALImageReaderSpiAvailable && loader instanceof 
GDALImageReaderSpi)
-return 25;
-  return 20;
+return 45;
+  return 40;
 }
 // next are sun's imageio readers
 else if (name.startsWith("com.sun.media.imageio"))
-  return 30;
+  return 60;
 // next in line are all other imageio readers
 else if (loader instanceof ImageReaderSpi)
-  return 40;
+  return 80;
 
-// return prio or hardcoded 100 priority,
-// after all GeoImage is supposed to be superior
+// return priority above or hardcoded 100 priority,
+// after all GeoImage is supposed to be superior to the other frameworks
 return 100;
   }
 



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


[JPP-Devel] Fwd: [jump-pilot:bugs] Re: #498 Most GeoTIFF drivers fail with a simple GeoTIFF image

2020-09-20 Thread edgar . soldin
Mike, Jukka,

as you are far more knowledgeable wrt. to file formats you maybe want to come 
up with some tiled TIFFs or otherwise difficult formats that are currently not 
readable by Apache Commons Imaging as requested below?!

tickets can be opened (after a short account creation) on 
https://issues.apache.org/jira/projects/IMAGING/summary

..ede

 Forwarded Message 
Subject:[JPP-Devel] [jump-pilot:bugs] Re: #498 Most GeoTIFF drivers 
fail with a simple GeoTIFF image
Date:   Sat, 19 Sep 2020 03:15:16 -
From:   G. W. Lucas via Jump-pilot-devel 

Reply-To:   [jump-pilot:bugs] <4...@bugs.jump-pilot.p.re.sourceforge.net>, 
OpenJump develop and use 
To: jump-pilot-devel@lists.sourceforge.net
CC: G. W. Lucas 



The problem is due to a TIFF format that is not supported by Commons-Imaging. I 
posted some notes to your bug report. I completed a code change and the fix is 
in the pipeline.

Thanks for the test file. It helped a lot. If you have others (particular 
examples using a tile-organization rather than strips), I'd welcome them.


___
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] [jump-pilot:bugs] Re: #498 Most GeoTIFF drivers fail with a simple GeoTIFF image

2020-09-20 Thread edgar . soldin
On 19.09.2020 07:56, Giuseppe Aruta wrote:
> Ede, MIchael,
> regarding RasterImageLayers.
> At this stage, even if I partially solved the problems of the warning from my 
> side, Roberto still finds them.
> I also find a problem on Sextante. Whenever a raster is generated by a 
> Sextante tool, it is loaded but neither displayed nor readable on Openjump.

what'd help would be a step-by-step list to test if some functionality is 
working or not.

> I am considering to restore RasterImageLayer framework at the previous 
> working version (OJ 1.15) with few modifications.

well, it won't hurt. but i wonder if it is necessary. let me investigate the 
monoband read errors at least first.

however. in the worst case we can re-include the proven-working imageio-ext 
TIFF reader and force sextante to use it. what was your time frame again?

> a) I will restore the modified classes AddRasterImageWizard, RasterImageIO, 
> RatserImageLayer and TiffUtils to version 1.15 depuring of any dependency 
> from GeoRasterImage.class
>
> b) The original 1.15 RasterImageIO, RatserImageLayer and TiffUtils classes 
> use the method JAI("fileLoad"..) to read TIF.
> I will substitute it with the method JAI("ImageRead"...).
>
> Using ImageRead will solve the problem to read, display and query the 
> problematic raster like small_world.tif and the AsterDEMs
>
> Before doing these modification, I would like to have your opinion

got it above :).. ede


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