1

Is there a way to export shapefile to SVG while keeping attributes?

I tried the mapshaper and QGIS' Mapprinter plugin but with no result, I get the geometry only but I need attributes.

I want when I export to fill the svg id with values from a column so I can join them afterward

Ismail
  • 113
  • 7
  • 2
    SVG doesn't support attributes, so it seems unlikely. – Vince Feb 05 '21 at 14:18
  • I mean I want when I export to fill the svg id with values from a column so I can join them afterward – Ismail Feb 05 '21 at 14:39
  • 1
    What tools/software do you have? – Mapperz Feb 05 '21 at 16:16
  • it will be preferable if I can use qgis or arcgis, but I can try any tool – Ismail Feb 08 '21 at 09:07
  • Thera was an answer ( can't retrieve it..) to create dynamic svg where the text part came from an attribute, you may try look it up – J.R Feb 09 '21 at 19:02
  • 1
    Find it ! this : https://gis.stackexchange.com/questions/379437/use-text-diagram-for-labeling-in-qgis/379578?r=SearchResults#379578 will let you create svg with text from attributes – J.R Feb 09 '21 at 19:08

2 Answers2

1

You may use mapshaper, using command line

# Get data for demo
https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_countries.zip
# Uncompress
unzip ne_10m_admin_0_countries.zip

From mapshaper, add id to svg output

mapshaper ne_10m_admin_0_countries.shp -o format=svg id-field="ADM0_A3" out.svg For more, see https://github.com/mbloch/mapshaper/issues/132#issuecomment-223140958 for more

ThomasG77
  • 30,725
  • 1
  • 53
  • 93
0

To get attribute in your svg just label your feature with that field and export that. It will label the feature in svg too.