Image position changes whenever project is opened

23 views
Skip to first unread message

Tekena Amah

unread,
Apr 5, 2016, 3:15:52 AM4/5/16
to Openjump-users
Hi everyone,

Whenever I want to trace a map, I import the map image in an image layer and save in .jml format. Why does the position of the image change whenever I re-open the project?

#Original position:
0 9216,
0 0,
17408 0,
17408 9216,
0 9216

#New position after re-opening the project
0 -9216,
0 -0,
17408 -0,
17408 -9216,
0 -9216

Any ideas on how to solve this problem?


Sincerely,
Tekena

edgar....@web.de

unread,
Apr 5, 2016, 5:00:19 AM4/5/16
to openjum...@googlegroups.com
afaik this is a bug
https://sourceforge.net/p/jump-pilot/bugs/414/

could you add your issue to the tracker and i'll tackle it when i find time. you might try the different loaders we sport for png, maybe the bug does not appear w/ all of them.

what happens if you load the gml and zoom in the layerview? is the image then placed correctly.

..ede
> --
> -- You received this message because you are subscribed to the Google Groups openjump-users group. To post to this group, send email to openjum...@googlegroups.com. To unsubscribe from this group, send email to openjump-user...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/openjump-users?hl=en
> ---
> You received this message because you are subscribed to the Google Groups "openjump-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to openjump-user...@googlegroups.com <mailto:openjump-user...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

edgar....@web.de

unread,
Apr 5, 2016, 11:22:02 AM4/5/16
to openjum...@googlegroups.com
please try snapshot rev4882 or later
https://sourceforge.net/projects/jump-pilot/files/OpenJUMP_snapshots/

thx ..ede

Amatek Teekay

unread,
Apr 11, 2016, 9:43:23 PM4/11/16
to openjump-users
Hi Ede,

I have tried rev4882 and later, but the issue persists. I also tried other import options. Do you experience this issue when you try to open projects with a reference .png image?
>> To unsubscribe from this group and stop receiving emails from it, send an email to openjump-user...@googlegroups.com <mailto:openjump-users+unsub...@googlegroups.com>.

edgar....@web.de

unread,
Apr 12, 2016, 5:07:52 AM4/12/16
to openjum...@googlegroups.com
Amatek,

can you give a short step by step, starting with loading the image?

what i fixed and verified is saving the image layer as jmp file and reopening it.

..ede/OJ

On 12.04.2016 03:43, 'Amatek Teekay' via openjump-users wrote:
> Hi Ede,
>
> I have tried rev4882 and later, but the issue persists. I also tried other import options. Do you experience this issue when you try to open projects with a reference .png image?
>
> On Tuesday, April 5, 2016 at 11:22:02 PM UTC+8, ede wrote:
>
> please try snapshot rev4882 or later
> https://sourceforge.net/projects/jump-pilot/files/OpenJUMP_snapshots/ <https://sourceforge.net/projects/jump-pilot/files/OpenJUMP_snapshots/>
>
> thx ..ede
>
> On 05.04.2016 10:59, edgar....@web.de wrote:
> > afaik this is a bug
> > https://sourceforge.net/p/jump-pilot/bugs/414/ <https://sourceforge.net/p/jump-pilot/bugs/414/>
> >
> > could you add your issue to the tracker and i'll tackle it when i find time. you might try the different loaders we sport for png, maybe the bug does not appear w/ all of them.
> >
> > what happens if you load the gml and zoom in the layerview? is the image then placed correctly.
> >
> > ..ede
> >
> >
> > On 05.04.2016 09:15, 'Tekena Amah' via openjump-users wrote:
> >> Hi everyone,
> >>
> >> Whenever I want to trace a map, I import the map image in an image layer and save in .jml format. Why does the position of the image change whenever I re-open the project?
> >>
> >> #Original position:
> >> 0 9216,
> >> 0 0,
> >> 17408 0,
> >> 17408 9216,
> >> 0 9216
> >>
> >> #New position after re-opening the project
> >> 0 -9216,
> >> 0 -0,
> >> 17408 -0,
> >> 17408 -9216,
> >> 0 -9216
> >>
> >>
> >> Any ideas on how to solve this problem?
> >>
> >>
> >> Sincerely,
> >> Tekena
> >>
> >> --
> >> -- You received this message because you are subscribed to the Google Groups openjump-users group. To post to this group, send email to openjum...@googlegroups.com. To unsubscribe from this group, send email to openjump-user...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/openjump-users?hl=en <https://groups.google.com/d/forum/openjump-users?hl=en>
> >> ---
> >> You received this message because you are subscribed to the Google Groups "openjump-users" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an email to openjump-user...@googlegroups.com <mailto:openjump-user...@googlegroups.com>.
> >> For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
> >
>
> --
> -- You received this message because you are subscribed to the Google Groups openjump-users group. To post to this group, send email to openjum...@googlegroups.com. To unsubscribe from this group, send email to openjump-user...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/openjump-users?hl=en
> ---
> You received this message because you are subscribed to the Google Groups "openjump-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to openjump-user...@googlegroups.com <mailto:openjump-user...@googlegroups.com>.

Jukka Rahkonen

unread,
Apr 12, 2016, 5:40:58 AM4/12/16
to openjum...@googlegroups.com
Hi,

Screenshots from the steps would be also useful.

-Jukka-

Amatek Teekay

unread,
Apr 15, 2016, 5:33:40 PM4/15/16
to openjump-users, amat...@yahoo.com
Hi,

I have attached screenshots of the process.
Thanks.


Sincerely,
Tekena
OpenJUMP Image Issue.pdf

Tekena Amah

unread,
Apr 16, 2016, 8:26:35 AM4/16/16
to Giuseppe Aruta, openjump-users
Hi Giuseppe,

Thanks a lot. That did the trick! The image quality even looks higher.


Sincerely,
Tekena


On Saturday, April 16, 2016 5:27 PM, Giuseppe Aruta <giusepp...@gmail.com> wrote:


Hi Tekena,
as I can see the problem is related to the usage of layer.class to load an image (Open>Layer). This method currently doesn't support saving resizing/rectify/reprojection of image files.
You should use RasterImageLayer.class instead (Open>Sextante Raster Image). It support some image types file (TIT, JPG, PNG and from newer OJ night build BMP and JP2) and you can do some modification of the image (resize and move). There are 2 ways to do it.

A)

a) open the image via Sextante Raster
b) select the image and click the plugin "Layer>Export Envelope as geometry". The envelope of the image will be created as a square/rectangle yellow geometry in a new vector layer (name Geometry_multiple_source, I think). You probably won't see the geometry as this layer is below the image  (sextante) layer
c) make this vector layer editable and select the yellow geometry
d) move (or resize this geometry) in the place you need
e) Rename the vector layer as "Fence". In this way OpenJUMP recognize this vector layer bas an auxiliary fence layer.
f) select again the image (sextante) layer and click "Warp image to Fence".
g) a new image raster layer is create in the corresponding fence geometry position.
You can save it as a TIF image with its worldfile (Layer menu>Save Raster Image as Image). Eventually you can reload this new file as a Layer.class (Open>Layer).
Note that in this way you can only do the fundamental 2 affine modification of an image (move and resize)

B)
This procedure allows also to rotate the image

a) open the image via Sextante Raster
b) Open warp toolbox (Tools>warp>warping)
c) select the tool "draw warping vector"
d) draw from 1 to 3 vectors:
  • 1 vector = move the image
  • 2 vectors = move/resize/rotate the image
  • 3 vectors = move/resize/rotate/shear the image (be aware that shear will deform the quality of the image - there are still some problems on re-sampling raster)
e) click on tool>warp>Affine transform (from warping vectors)
f )a new image raster layer is create and rotate, eventually moved/resized.
You can save it as a TIF image with its worldfile (Layer menu>Save Raster Image as Image). Eventually you can reload this new file as a Layer.class (Open>Layer).

I hope this information are useful for you.

Giuseppe

@Ede. whenever an image layer is loaded via Layer.class, the image is located into the workbench using the its "natural" geographic reference (worldfile or geotiff tag) -  then  a  corresponding geometry is created.
I wonder if we can use this geometry position (4 corner of the  image envelope) as geographic reference to locate the image.

To explain better, this is the process I image
a) users load and image. OpenJUMP creates a rectangle geometry, locates this image into the workbench according to a worldfile or image geographic tags and paint the image inside it.
b) users move the image on the workbench ((OpenJUMP records the new position of the geometry and repaints the image inside it)
c) the project is saved. Openjump records that the geometry associate to the image  has changed position
d) the project is opened. OpenJUMP, in this case, instead to read again the original geographic reference (worldfile or geotiff), it reads the saved geometry position (4 corner of the envelope) and repaints the image inside it - it basically bypass wordfiles or tags.
e) if  users want to restore the original position, they could delete the geometry and save the image layer - OpenJUMP records that there is no geometry associated to the image and loads geographic position according to wordfiles, etc.
I wonder if it worth to do it and what is the (time) cost
Best regards

Giuseppe Aruta

unread,
Apr 16, 2016, 11:22:07 AM4/16/16
to openjump-users, amat...@yahoo.com, openjum...@googlegroups.com

edgar....@web.de

unread,
Apr 17, 2016, 9:11:02 AM4/17/16
to openjum...@googlegroups.com
hey Tekana,

using the raster image framework might be an option here, but also an overkill. it uses more memory than necessary for simply displaying an image.

can you tell me the OJ version you tried your step-by-step list with? the repositioning reset issue w/ the referenced image loader should have been fixed in the latest snapshots avail here
https://sourceforge.net/projects/jump-pilot/files/OpenJUMP_snapshots/

..ede


On 16.04.2016 14:26, 'Tekena Amah' via openjump-users wrote:
> Hi Giuseppe,
>
> Thanks a lot. That did the trick! The image quality even looks higher.
>
>
> Sincerely,
> Tekena
>
>
> On Saturday, April 16, 2016 5:27 PM, Giuseppe Aruta <giusepp...@gmail.com> wrote:
>
>
> Hi Tekena,
> as I can see the problem is related to the usage of layer.class to load an image (/Open>Layer/). This method currently doesn't support saving resizing/rectify/reprojection of image files.
> You should use RasterImageLayer.class instead (/Open>Sextante Raster Image/). It support some image types file (TIT, JPG, PNG and from newer OJ night build BMP and JP2) and you can do some modification of the image (resize and move). There are 2 ways to do it.
>
> A)
>
> a) open the image via Sextante Raster
> b) select the image and click the plugin "*Layer>Export Envelope as geometry*". The envelope of the image will be created as a square/rectangle yellow geometry in a new _vector laye_r (name Geometry_multiple_source, I think). You probably won't see the geometry as this layer is _below_ the image (sextante) layer
> c) make this vector layer _editable_ and select the yellow geometry
> d) move (or resize this geometry) in the place you need
> e) Rename the _vector layer_ as "*Fence*". In this way OpenJUMP recognize this vector layer bas an auxiliary fence layer.
> f) select again the image (sextante) layer and click "*Warp image to Fence*".
> g) a new image raster layer is create in the corresponding fence geometry position.
> You can save it as a TIF image with its worldfile (*Layer menu>Save Raster Image as Image*). Eventually you can reload this new file as a Layer.class (Open>Layer).
> Note that in this way you can only do the fundamental 2 affine modification of an image (_move _and _resize_)
>
> B)
> This procedure allows also to _rotate_ the image
>
> a) open the image via Sextante Raster
> b) Open warp toolbox (*Tools>warp>warping*)
> c) select the tool "*draw warping vector*"
> d) draw from 1 to 3 vectors:
>
> * 1 vector = move the image
> * 2 vectors = move/resize/rotate the image
> * 3 vectors = move/resize/rotate/shear the image (be aware that shear will deform the quality of the image - there are still some problems on re-sampling raster)
>
> e) click on*tool>warp>Affine transform (from warping vectors)*
> f )a new image raster layer is create and rotate, eventually moved/resized.
> You can save it as a TIF image with its worldfile (*Layer menu>Save Raster Image as Image*). Eventually you can reload this new file as a Layer.class (Open>Layer).

Agustin

unread,
May 2, 2016, 9:27:37 AM5/2/16
to openjum...@googlegroups.com
Hi,
Somebody knows why Open Jump is not listed IEEE list?
To the best of my knowledge OpenJump belongs there.

http://www.grss-ieee.org/open-source-software-related-to-geoscience-and-remote-sensing/
Best

edgar....@web.de

unread,
May 2, 2016, 9:44:14 AM5/2/16
to openjum...@googlegroups.com
Kosmo is missing as well.. so the list seems to be a w.i.p.

why dontcha send them an email w/ appropriate description. they seem to listed the email address on top exactly for this purpose.

..ede

Agustin

unread,
May 2, 2016, 9:48:56 AM5/2/16
to openjum...@googlegroups.com

El 2May, 2016, a las 3:44 PM, edgar....@web.de escribió:

> Kosmo is missing as well.. so the list seems to be a w.i.p.
>
> why dontcha send them an email w/ appropriate description. they seem to listed the email address on top exactly for this purpose.
Done, sorry for the noise.
>
> ..ede
>
> On May 2, 2016 3:27:32 PM GMT+02:00, Agustin <gvsi...@gmail.com> wrote:
>> Hi,
>> Somebody knows why Open Jump is not listed IEEE list?
>> To the best of my knowledge OpenJump belongs there.
>>
>> http://www.grss-ieee.org/open-source-software-related-to-geoscience-and-remote-sensing/
>> Best
>
> --
> -- You received this message because you are subscribed to the Google Groups openjump-users group. To post to this group, send email to openjum...@googlegroups.com. To unsubscribe from this group, send email to openjump-user...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/openjump-users?hl=en
> ---
> You received this message because you are subscribed to the Google Groups "openjump-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to openjump-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

edgar....@web.de

unread,
May 2, 2016, 10:34:42 AM5/2/16
to openjum...@googlegroups.com
no problem :). and thank you!.. ede
Reply all
Reply to author
Forward
0 new messages