Opened 4 years ago

Closed 4 years ago

#2240 closed defect (fixed)

export tiling as svg

Reported by: Dimitar Misev Owned by: apercov
Priority: major Milestone: 10.0
Component: qlparser Version: 9.8
Keywords: Cc: Vlad Merticariu, Bang Pham Huu, Peter Baumann
Complexity: Medium

Description

With a query like this we can print the sdoms of tiles in an array:

rasql -q 'select dbinfo(c, "printtiles=1") from test_grey as c' --out string

resulting in a json array of sdom strings like this:

        "tileDomains":
        [
                "[100:149,210:210]"
                "[150:199,0:29]",
                "[150:199,30:59]",
                "[150:199,60:89]",
                ...

The code handling this is in qlparser/qtinfo.cc

It would be very useful to export the tiles as svg that can be visualized, e.g.

rasql -q 'select dbinfo(c, "printtiles=svg") from test_grey as c' --out string

would produce similar to below output (id would contain the tile id)

<svg width="array width" height="array height">
  <rect x="100" y="210" width="50" height="1" id="1232"></rect>
  <rect x="150" y="0" width="50" height="30" id="3223"></rect>
  ...
</svg>

It would also be useful to set various fill colors for each tile, e.g. choose 10-20 colors and rotate them over the rectangles.

This would work only on 2D arrays. 3D and higher dimension would require to generate something like webgl probably.

Attachments (2)

vistiles.sh (1.2 KB ) - added by Dimitar Misev 4 years ago.
tiling_test_grey.png (3.2 KB ) - added by Dimitar Misev 4 years ago.

Download all attachments as: .zip

Change History (5)

by Dimitar Misev, 4 years ago

Attachment: vistiles.sh added

comment:1 by Dimitar Misev, 4 years ago

I made a small script which converts the output of dbinfo to svg; execute with vistiles.sh collName.

E.g. for test_grey it produces something like this if you open the svg in inkscape:

by Dimitar Misev, 4 years ago

Attachment: tiling_test_grey.png added

comment:2 by apercov, 4 years ago

Status: assignedaccepted

comment:3 by apercov, 4 years ago

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.