3

I imported two layers to my Project (one is a shapefile from natural earth, the other is built out of lon/lat Points in a csv-data-file) QGIS fits the two graphics perfect together. Now my goal is to export this as an svg-file. This works fine, too.

Is there a way to store id-names for the paths and objects in the svg-file?

The ids should be based on the underlying attribute-tables of each layer. I have to do this automatically because of the amount of data-points. I read something about layer splitting. But I cannot even find the names of layers in my svg output file so I guess this will not help me. If there is no way to manipulate the svg directly, can it be done with a workaround? (I think about putting shapefiles with all informations together and transforming it to svg in another way?)

I am using QGIS 2.18.17 Las Palmas

I want to identify the polygons in the underlying svg data, like i have a polygon in my Image, and I open the svg-file with a text Editor, I want to have <path id="USA"><\path>. I want to have the Information stored in the metadata of the vector-graphic, but I don't want to see the data in the picture. Afterwards I want to adjust the file to fit into html and therefore I have to be able to identify single parts of the picture.

  • Are you exporting directly from the map canvas, or from the print composer? If you use the print composer you can add an attribute table to the exported image. – csk Feb 14 at 22:45
  • Hi! I use the use the print composer. your suggestion is helpful to see the Information in the picture, but i want to identify the polygons in the underlying svg data, like i have a polygon in my Image, and i open the svg-file with a text Editor, i want to have <path id="USA"><\path>. I want to have the Information stored in the metadata of the vector-graphic, but I dont want to see the data in the picture. Afterwards I want to adjust the file to fit into html and therefore I have to be able to identify single parts of the picture… hope my description works. Thanks in advance – Lukas Feb 15 at 11:10
  • I've never heard of any feature like that in QGIS. – csk Feb 15 at 18:14
  • Oh thats sad. Perhaps it is possible to change the color of the single polygons in the picture by a matching in the attribute table. Then I can identify the polygons by the color used in hfill. Do you know if this works? – Lukas Feb 16 at 12:00
  • That's called a categorized style, it's explained in the QGIS manual as well as in many tutorials, for example: qgistutorials.com/en/docs/basic_vector_styling.html – csk Feb 19 at 17:01
1

So I found a solution for my problem:

  1. import the layers you need as usual
  2. split the layers by the attribute you want to have as an id
  3. re-import the splitted layers (so layer names will be ids)
  4. use add-in simple svg to export as svg
  5. be happy :)

Best regards to all readers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.