Opened 8 days ago

Last modified 6 days ago

#24607 closed defect

Needed an easy way to render TMS layer on BufferedImage in a plugin — at Version 3

Reported by: zkir Owned by: team
Priority: normal Milestone:
Component: Core Version: tested
Keywords: Satellite imagery, TMS, plugin Cc:

Description (last modified by zkir)

Hello!

I'm the developer of the UrbanEye3D plugin (https://github.com/Zkir/UrbanEye3D) and I'm currently working on a new feature: displaying satellite imagery in the 3D window (see the attached screenshot).

I've managed to get the imagery to display using some tricks with the MapView and JosmMapViewer classes. However, rendering in the 3D window conflicts with rendering the same imagery in the 2D window: tiles reload multiple times and the 2D window flashes. The reason is pretty obvious — MapView is a descendant of javax.swing.JComponent and is tightly coupled with the GUI.

What I need is just a simple way to render a TMS layer into a BufferedImage, given pixel dimensions and geographical bounds, without it affecting any GUI elements.

public BufferedImage renderLayerToImage(TMSLayer layer, Bounds bounds, int textureWidth, int textureHeight){
    // ...
}

I've already spent several days on this and am completely stuck.
Please advise — maybe I'm missing something obvious.

Best regards,
Kirill (aka Zkir)

Attached:
(https://josm.openstreetmap.de/raw-attachment/ticket/24607/ue3d_bug_report.png).

Change History (4)

by zkir, 8 days ago

Attachment: ue3d_bug_report.png added

comment:1 by zkir, 8 days ago

Description: modified (diff)

comment:2 by zkir, 8 days ago

Description: modified (diff)

comment:3 by zkir, 8 days ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.