Re: [JPP-Devel] Tool for swithing x and y coordinates of features
Hi, The tool does the job fast and obviously correctly. Course speed estimate is 1 vertises per second but I need to test with some bigger datasets later. Tool baffles something in OJ, you cannot zoom to layer when it is flipped and it is having perhaps some invisible style or something. It is possible to see that converted features exist by opening the attribute table, selecting and zooming to selected. The selection shows highlighted as usual. After saving to disk and opening the result everything is naturally OK. Thanks for the nice little tool which is once again just what I like in OpenJUMP: light, fast, gives correct result and even it is simple, such tool probably does not exist in other open source GIS. Perhaps soon will, but OJ was the first. -Jukka Rahkonen- > -Alkuperäinen viesti- > Lähettäjä: Michaël Michaud [mailto:michael.mich...@free.fr] > Lähetetty: 15. marraskuuta 2011 2:04 > Vastaanottaja: OpenJump develop and use > Aihe: Re: [JPP-Devel] Tool for swithing x and y coordinates > of features > > Hi Jukka, > > > After this introduction I wonder if it could be possible to > convert the whole layer with OpenJUMP so that the result > would keep all the attributes but have all the coordinates in > reversed x and y coordinate order? So this > > LINESTRING (6610069.234 170739.665, 6606506.505 184937.743) > would become > > LINESTRING (170739.665 6610069.234, 184937.743 > 6606506.505). Perhaps it could be handled by some BeanShell > or Python tool? > Try to copy paste the following script in beantools folder > Should switch longitude and latitude for all the selected layers > > //Inverse longitude and latitude - Michael Michaud 2011-11-15 > import com.vividsolutions.jump.workbench.model.Layer; > > // Create the filter > public CoordinateFilter switchLatLon = new CoordinateFilter() { > void filter(Coordinate coord) { > t = coord.x; > coord.x = coord.y; > coord.y = t; > } > }; > // apply > for (Layer lyr : wc.layerNamePanel.selectedLayers) { > for (Feature f : lyr.featureCollectionWrapper.features) { > f.geometry.apply(switchLatLon); > f.geometry.geometryChanged(); > } > } > // refresh > wc.layerViewPanel.repaint(); > > > > > -Jukka Rahkonen- > > > -- > > > RSA(R) Conference 2012 > > Save $700 by Nov 18 > > Register now > > http://p.sf.net/sfu/rsa-sfdev2dev1 > > ___ > > Jump-pilot-devel mailing list > > Jump-pilot-devel@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > > > > > > > -- > > RSA(R) Conference 2012 > Save $700 by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > ___ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] Tool for swithing x and y coordinates of features
Beanshell is a very nice tool. I used JRuby in OpenJUMP to create the complete list of PlugIns (see another mail on this list). I've added the Ruby source code to the code paste: https://gist.github.com/1361280 I think the normal development workflow with scripts such as Beanshell or JRuby in OpenJUMP should be such like: (10) Create a script file manually in scripts folder. (20) Open this script in external text editor. (30) Refresh script list in Bean shell menu within OpenJUMP for the new entry. (40) Edit the script file in external text editor. (50) Run the script in OpenJUMP. (60) Evaluate the output. (70) GOTO 40. Greetings Benjamin 2011/11/15 Stefan Steiniger > wow! > > I should really consider to learn > (a) more about Beanshell (never used it) > (b) coordinate filter > > I would have programmed it as plugin... with probably consuming way more > time. > > stefan > > PS: can we find a spot for that on the wiki, or better adding it to > built-in the Beanshell functions? > > Am 14.11.11 17:04, schrieb Michaël Michaud: > > Hi Jukka, > > > >> After this introduction I wonder if it could be possible to convert the > whole layer with OpenJUMP so that the result would keep all the attributes > but have all the coordinates in reversed x and y coordinate order? So this > >> LINESTRING (6610069.234 170739.665, 6606506.505 184937.743) would > become > >> LINESTRING (170739.665 6610069.234, 184937.743 6606506.505). Perhaps > it could be handled by some BeanShell or Python tool? > > Try to copy paste the following script in beantools folder > > Should switch longitude and latitude for all the selected layers > > > > //Inverse longitude and latitude - Michael Michaud 2011-11-15 > > import com.vividsolutions.jump.workbench.model.Layer; > > > > // Create the filter > > public CoordinateFilter switchLatLon = new CoordinateFilter() { > > void filter(Coordinate coord) { > > t = coord.x; > > coord.x = coord.y; > > coord.y = t; > > } > > }; > > // apply > > for (Layer lyr : wc.layerNamePanel.selectedLayers) { > > for (Feature f : lyr.featureCollectionWrapper.features) { > > f.geometry.apply(switchLatLon); > > f.geometry.geometryChanged(); > > } > > } > > // refresh > > wc.layerViewPanel.repaint(); > > > >> > >> -Jukka Rahkonen- > >> > -- > >> RSA(R) Conference 2012 > >> Save $700 by Nov 18 > >> Register now > >> http://p.sf.net/sfu/rsa-sfdev2dev1 > >> ___ > >> Jump-pilot-devel mailing list > >> Jump-pilot-devel@lists.sourceforge.net > >> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > >> > >> > > > > > > > -- > > RSA(R) Conference 2012 > > Save $700 by Nov 18 > > Register now > > http://p.sf.net/sfu/rsa-sfdev2dev1 > > ___ > > Jump-pilot-devel mailing list > > Jump-pilot-devel@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > > > -- > RSA(R) Conference 2012 > Save $700 by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > ___ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] Tool for swithing x and y coordinates of features
wow! I should really consider to learn (a) more about Beanshell (never used it) (b) coordinate filter I would have programmed it as plugin... with probably consuming way more time. stefan PS: can we find a spot for that on the wiki, or better adding it to built-in the Beanshell functions? Am 14.11.11 17:04, schrieb Michaël Michaud: > Hi Jukka, > >> After this introduction I wonder if it could be possible to convert the >> whole layer with OpenJUMP so that the result would keep all the attributes >> but have all the coordinates in reversed x and y coordinate order? So this >> LINESTRING (6610069.234 170739.665, 6606506.505 184937.743) would become >> LINESTRING (170739.665 6610069.234, 184937.743 6606506.505). Perhaps it >> could be handled by some BeanShell or Python tool? > Try to copy paste the following script in beantools folder > Should switch longitude and latitude for all the selected layers > > //Inverse longitude and latitude - Michael Michaud 2011-11-15 > import com.vividsolutions.jump.workbench.model.Layer; > > // Create the filter > public CoordinateFilter switchLatLon = new CoordinateFilter() { > void filter(Coordinate coord) { > t = coord.x; > coord.x = coord.y; > coord.y = t; > } > }; > // apply > for (Layer lyr : wc.layerNamePanel.selectedLayers) { > for (Feature f : lyr.featureCollectionWrapper.features) { > f.geometry.apply(switchLatLon); > f.geometry.geometryChanged(); > } > } > // refresh > wc.layerViewPanel.repaint(); > >> >> -Jukka Rahkonen- >> -- >> RSA(R) Conference 2012 >> Save $700 by Nov 18 >> Register now >> http://p.sf.net/sfu/rsa-sfdev2dev1 >> ___ >> Jump-pilot-devel mailing list >> Jump-pilot-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel >> >> > > > -- > RSA(R) Conference 2012 > Save $700 by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > ___ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] Tool for swithing x and y coordinates of features
Hi Jukka, > After this introduction I wonder if it could be possible to convert the whole > layer with OpenJUMP so that the result would keep all the attributes but have > all the coordinates in reversed x and y coordinate order? So this > LINESTRING (6610069.234 170739.665, 6606506.505 184937.743) would become > LINESTRING (170739.665 6610069.234, 184937.743 6606506.505). Perhaps it > could be handled by some BeanShell or Python tool? Try to copy paste the following script in beantools folder Should switch longitude and latitude for all the selected layers //Inverse longitude and latitude - Michael Michaud 2011-11-15 import com.vividsolutions.jump.workbench.model.Layer; // Create the filter public CoordinateFilter switchLatLon = new CoordinateFilter() { void filter(Coordinate coord) { t = coord.x; coord.x = coord.y; coord.y = t; } }; // apply for (Layer lyr : wc.layerNamePanel.selectedLayers) { for (Feature f : lyr.featureCollectionWrapper.features) { f.geometry.apply(switchLatLon); f.geometry.geometryChanged(); } } // refresh wc.layerViewPanel.repaint(); > > -Jukka Rahkonen- > -- > RSA(R) Conference 2012 > Save $700 by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > ___ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > > -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] a couple of observations about OpenJUMP PLUS
nice catch, fixed in trunk.. could you tell the author (in case he is not reading in) as well so it gets fixed upstream? Geoff Roy http://www.cadplan.com.au/ - He usually read OpenJUMP user list, I belive Peppe -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] a couple of observations about OpenJUMP PLUS
On 14.11.2011 22:04, Giuseppe Aruta wrote: > > Hi All, > > 1) CADPLAN PRINTER - Printer used to come out in English even if my > computer works in Italian (CadPlan has been internationalized to the Italian > language). > It works with German or Spanish ( I did the Spanish one, together with the > Italian) but not with Italian. > So I opened language zip files of Printer JAR and I realized that the IT file > is JumpPrinterPlugin_it.POPERTIES and not .PROPERTIES (lost a R - ?). > Very strange. I renamed the file and everything works fine on Italian > Is it possible to rename the file on OJ PLUS, too. nice catch, fixed in trunk.. could you tell the author (in case he is not reading in) as well so it gets fixed upstream? > 2) ECW on Linux. I work with Ubuntu. All new version of OJ PLUS have ecw > drivers, but they are distributed as a zip file > (ecw-gvsig1.11-linux32.tar.gz) on ./native folder. > So whenever I download a new version of OJ PLUS, and I want to open an ecw > file, I have to unzip these files and copy them on native folder. > Can we distribute OJ PLUS with these files already unzipped, like the Windows > ones? > unfortunately the symbolic links do not survive the zip packaging.. i have a start script looks for tgz and unzips if not already done function in mind for those cases, but haven't come around to implement it so far. so until this happens you will have to stick with the manual unzipping, sorry ;) regards ede -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
[JPP-Devel] a couple of observations about OpenJUMP PLUS
Hi All, 1) CADPLAN PRINTER - Printer used to come out in English even if my computer works in Italian (CadPlan has been internationalized to the Italian language). It works with German or Spanish ( I did the Spanish one, together with the Italian) but not with Italian. So I opened language zip files of Printer JAR and I realized that the IT file is JumpPrinterPlugin_it.POPERTIES and not .PROPERTIES (lost a R - ?). Very strange. I renamed the file and everything works fine on Italian Is it possible to rename the file on OJ PLUS, too. 2) ECW on Linux. I work with Ubuntu. All new version of OJ PLUS have ecw drivers, but they are distributed as a zip file (ecw-gvsig1.11-linux32.tar.gz) on ./native folder. So whenever I download a new version of OJ PLUS, and I want to open an ecw file, I have to unzip these files and copy them on native folder. Can we distribute OJ PLUS with these files already unzipped, like the Windows ones? Regards Giuseppe -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel