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 )
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)
Change History (4)
by , 10 hours ago
| Attachment: | ue3d_bug_report.png added |
|---|
comment:1 by , 10 hours ago
| Description: | modified (diff) |
|---|
comment:2 by , 10 hours ago
| Description: | modified (diff) |
|---|
comment:3 by , 10 hours ago
| Description: | modified (diff) |
|---|


