Hi, For making it robust OJ could check histogram of the floating point raster and warn user with a possibility to cancel. This is for sure slow, but users may have floating point rasters with limited number of distinct values.
-Jukka Rahkonen- Lähettäjä: michael michaud via Jump-pilot-devel <jump-pilot-devel@lists.sourceforge.net> Lähetetty: tiistai 10. marraskuuta 2020 22.21 Vastaanottaja: jump-pilot-devel@lists.sourceforge.net Kopio: michael michaud <micha...@users.sourceforge.net> Aihe: [JPP-Devel] [jump-pilot:bugs] Re: #510 Create Polygon From a Raster bug <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> Hi Peppe, Thank you for the detailed answer. Indeed, I was not trying to do something useful, just checking if I did not introduce a new bug in RasterImageLayer. I perfectly understand that applying this tool to a raster containing floating point values is not the normal use case. With such images, it would probably need an additional parameter to define intervals and include all pixels belonging to a same interval in the same polygon. I just would like to avoid IndexArrayOutOfBoundException. There are probably many options : deactivate plugin for this kind of image, intercept the exception to provide a more informative message, try to make the plugin more robust, map the floating point values to a reasonable set of integer values... Let's try to choose something easy so that we can release 1.16 soon. Anyway, your explanations about the two options will surely interest everyone trying to do something useful with this plugin. Can it be retrieved from the wiki ? Michaël envoyé : 10 novembre 2020 à 15:16 de : Giuseppe Aruta <ma15...@users.sourceforge.net<mailto:ma15...@users.sourceforge.net>> à : "[jump-pilot:bugs] " <5...@bugs.jump-pilot.p.re.sourceforge.net<mailto:5...@bugs.jump-pilot.p.re.sourceforge.net>> objet : [jump-pilot:bugs] #510 Create Polygon From a Raster bug Hi Michael, ...even the time to vectorialize a raster with continuous data like DTM084 is incredibly long... In theory in mostly case an user chooses one of Raster->Vector tool according to the type of the raster she/he wants to convert: a) a continuous raster like a DTM. Data are scattered in a continuous interval descibing a measure that gradually changes, for instance the elevation or a map of temperatures. An user wonts to convert into a contour lines (Raster to contours) or trasform into a discrete raster (eg. defining intervals of the measure: 10-30% slope, 31-50% slope and so on a) a discrete raster can be converted to a polygon layer (the case of Raster to Polygons. See file UsoSuolo.tif by Roberto: each number with 3 digits (512, 111, etc) define a unique usage of the soil (forsets, cultivar, urban, etc). There is neither no uniform measurement (a forest is different from a city) nor a continuous gradually change (after 111 there would be a 231 in the scale, for instance): we use number because we get advance (and the limit) that the Z value of a raster accept only a number (float, double, integer or whatever, but only a number not a string). Of coarse, if we consider the limit of the interval and the cell size, all the raster are tecnically discrete (each output polygon can have a size of the cell size: see Stefan's tools, create a grid of points/of polygons). When I added this plugin to OpenJUMP I wanted to bypass in one time two problems: a) Sextante Raster to Vector tool on discrete raster sometimes was giving wierd results: island of no data where it was supposed to have valid data b) the version of Raster to Polygon tool in OpenKLEM, derived from AdbToolbox software, was taking a longer time and giving sometimes a strange outputs (like sometimes self intersection polygons). This plugin seems to solve both situations. OpenKLEM now refers to VectorizeAlgorithm class, part AdbToolbox. While embedded OpenJUMP plugin can use both algorithm. They both work, except if user wants to convert a continuous raster to polygons with AdbToolbox. I will give a look and atry to correct or to add some type of check, studing a way to distinguish in OpenJUMP a continuous vs discrete raster, not sure if it possible (an histogram is required and OJ raster histogram plugin can take a very long time according the intervals. Best regards Peppe ________________________________ [bugs:#510]<https://sourceforge.net/p/jump-pilot/bugs/510/> Create Polygon From a Raster bug Status: open Milestone: OJ_1.16 Created: Tue Nov 10, 2020 12:59 PM UTC by michael michaud Last Updated: Tue Nov 10, 2020 12:59 PM UTC Owner: nobody The plugin has two modes : AdbToolbox and Sextante. With tiff images of type float like DTM084 from Roberto Rossi, I can vectorize with Sextante, but Adb throws en exception : java.lang.ArrayIndexOutOfBoundsException: Index -9999 out of bounds for length 1925123 at org.openjump.core.rasterimage.algorithms.VectorizeAlgorithm.toPolygonsAdbToolBox(VectorizeAlgorithm.java:113) at org.openjump.core.ui.plugin.raster.VectorizeToPolygonsPlugIn.run(VectorizeToPolygonsPlugIn.java:170) at com.vividsolutions.jump.workbench.ui.task.TaskMonitorManager$TaskWrapper.run(TaskMonitorManager.java:151) ________________________________ Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/jump-pilot/bugs/510/ To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/ ________________________________ [bugs:#510]<https://sourceforge.net/p/jump-pilot/bugs/510/> Create Polygon From a Raster bug Status: open Milestone: OJ_1.16 Created: Tue Nov 10, 2020 12:59 PM UTC by michael michaud Last Updated: Tue Nov 10, 2020 02:16 PM UTC Owner: nobody The plugin has two modes : AdbToolbox and Sextante. With tiff images of type float like DTM084 from Roberto Rossi, I can vectorize with Sextante, but Adb throws en exception : java.lang.ArrayIndexOutOfBoundsException: Index -9999 out of bounds for length 1925123 at org.openjump.core.rasterimage.algorithms.VectorizeAlgorithm.toPolygonsAdbToolBox(VectorizeAlgorithm.java:113) at org.openjump.core.ui.plugin.raster.VectorizeToPolygonsPlugIn.run(VectorizeToPolygonsPlugIn.java:170) at com.vividsolutions.jump.workbench.ui.task.TaskMonitorManager$TaskWrapper.run(TaskMonitorManager.java:151) ________________________________ Sent from sourceforge.net because jump-pilot-devel@lists.sourceforge.net<mailto:jump-pilot-devel@lists.sourceforge.net> is subscribed to https://sourceforge.net/p/jump-pilot/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/jump-pilot/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
_______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel