Feature request #10060

Support SVG as WMS image format

Added by Jaak Laineste over 10 years ago. Updated over 10 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Web Services clients/WMS
Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:18538

Description

QGIS seems to have nice SVG support in general, I can select SVG images in map composer for example, and I have set up WMS server which outputs SVG. This gives way better image quality for printouts. It is, well, really scalable. But I cannot select SVG as image format when adding WMS layer. I can select PNG but then the printed output looks almost unusable.

My current workaround is to use Wireshark to intercept WMS requests and then modify URL FORMAT parameter and invoke it in browser, as also web browsers can render SVG nicely.

Here is my scalable SVG WMS sample for http://kaart.maakaart.ee/cgi-bin/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=2973247,8044264,2976707,8049065&CRS=EPSG:3857&WIDTH=600&HEIGHT=1000&LAYERS=default,places18,borders18,aeroways18,roads18,railways18,waterways18,waterarea18,buildings,transport_areas18,landuse18,land18,places17,borders17,aeroways17,roads17,railways17,waterways17,waterarea17,transport_areas17,landuse17,land17,places16,borders16,aeroways16,roads16,railways16,waterways16,waterarea16,transport_areas16,landuse16,land16,places15,borders15,aeroways15,roads15,railways15,waterways15,waterarea15,transport_areas15,landuse15,land15,places14,borders14,aeroways14,roads14,railways14,waterways14,waterarea14,transport_areas14,landuse14,land14,places13,borders13,aeroways13,roads13,railways13,waterways13,waterarea13,transport_areas13,landuse13,land13,places12,borders12,aeroways12,roads12,railways12,waterways12,waterarea12,transport_areas12,landuse12,land12,places11,borders11,aeroways11,roads11,railways11,waterways11,waterarea11,transport_areas11,landuse11,land11,places10,borders10,aeroways10,roads10,railways10,waterways10,waterarea10,transport_areas10,landuse10,land10,places9,borders9,roads9,railways9,waterways9,waterarea9,transport_areas9,landuse9,land9,places8,borders8,roads8,railways8,waterways8,waterarea8,transport_areas8,landuse8,land8,places7,borders7,roads7,waterways7,waterarea7,transport_areas7,landuse7,land7,places6,borders6,roads6,waterways6,waterarea6,transport_areas6,landuse6,land6,places5,borders5,roads5,waterarea5,transport_areas5,landuse5,land5,places4,borders4,waterarea4,transport_areas4,landuse4,land4,places3,borders3,land3,places2,borders2,land2,places1,borders1,land1,places0,borders0,land0&STYLES=&FORMAT=image/svg%2Bxml&DPI=72&MAP_RESOLUTION=72&FORMAT_OPTIONS=dpi:72&TRANSPARENT=TRUE

Associated revisions

Revision b118213d
Added by Jürgen Fischer over 10 years ago

wms: add support for svg getmap requests (implements #10060)

Revision ad1eaf7a
Added by Jürgen Fischer over 10 years ago

wms client: handle + encoding (image/svg+xml) in format parameter also for
other requests (followup b118213d, refs #10060)

History

#1 Updated by Jürgen Fischer over 10 years ago

  • Status changed from Open to Closed

#2 Updated by Jaak Laineste over 10 years ago

Thanks for superfast patch!

However, the + in FORMAT parameter still gets not escaped (even through the patch code tries to do it), so server gets "image/svg xml" as type and gives error response. You can test with my global OSM WMS at http://kaart.maakaart.ee/cgi-bin/wms (pick "default" layer).

Working URL: http://kaart.maakaart.ee/cgi-bin/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&WIDTH=256&HEIGHT=256&LAYERS=default&STYLES=&FORMAT=image/svg%2bxml&CRS=EPSG:3301&TRANSPARENT=TRUE&BBOX=6585981.07862824201583862,520163.22141778469085693,6586353.4256381094455719,520535.56842762231826782

#3 Updated by Jaak Laineste over 10 years ago

After some more usage it looks even more strange - after getting some invalid requests and errors in log, after re-adding layers it eventually started to make working URL queries, and got back SVG as expected. Maybe some capability caching issue?

However, I now got stuck with the next problem - print composer seems to rasterize automatically the map (if I print or save as pdf), or modify it too much (if save as SVG) to be usable. I still cannot get nice vector PDF output. But that's another issue.

Also available in: Atom PDF