Modify

Opened 10 hours ago

Last modified 10 hours ago

#24607 new defect

Needed an easy way to render TMS layer on BufferedImage in a plugin

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).

Attachments (1)

ue3d_bug_report.png (1.5 MB ) - added by zkir 10 hours ago.

Download all attachments as: .zip

Change History (4)

by zkir, 10 hours ago

Attachment: ue3d_bug_report.png added

comment:1 by zkir, 10 hours ago

Description: modified (diff)

comment:2 by zkir, 10 hours ago

Description: modified (diff)

comment:3 by zkir, 10 hours ago

Description: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to zkir.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.