[Qgis-user] SVG Fill

Andreas Neumann a.neumann at carto.net
Fri Aug 17 06:07:45 PDT 2012


 Hi Jonathan,

 no - QGIS cannot embed SVG files in QML files. And it's not very likely 
 that this will get implemented - unless you pay someone to implement it.

 But the solution with the SVG paths isn't bad/complicated anyway. It is 
 not a lot of work to copy a bunch of SVG files to a central place and 
 set it in the global options, is it?

 Just my opinion,
 Andreas

 On Fri, 17 Aug 2012 12:57:18 +0100, Jonathan Moules wrote:
> Hi Andreas,
> Unfortunately "relative" doesn't seem to work for QML files (you did
> say relative to .qgs files, but I don't actually have a project - I'm
> trying to create stand-alone QML files I can distribute both
> internally and to the community). My project is set to use relative
> paths, I then set up my styling and saved my style to a QML file.
>  
> I have this data structure:
>  
> /qml/this_style.qml
> /symbols/[lots of SVG symbols]
>  
> When I then started a new QGIS project, loaded the data then applied
> the this_style.qml, it didn't load the SVG symbols.
>  
> Looking in the saved QML file, it is saving the *absolute* path:
>  
>          
>
> Even if I then search-and-replace this with the relative path:
>          
> It still doesn't load the SVG files.
>  
> Even moving the directory structure to: /qml/symbols/ and then
> changing the relative term to "./symbols/" doesn't resolve it.
>
> Would this be considered a bug or desired behaviour?
>  
>  
> The only way I've found to get it working is to change the QML file 
> to
> only point at the file name itself, then make that directory a
> "SVG path". This works and seems a fairly decent solution, though
> personally I'd still feel better if they were included in the QML 
> file
> itself, it'd make distribution easier and importing easier.
>  
> Jonathan
>
>  
> On 17 August 2012 12:22, Andreas Neumann  wrote:
>
>> Hi Jonathan,
>>
>> SVG symbols are always just referenced.
>>
>> It is generally good advice to use relative paths in the project
>> settings. This influences paths to spatial data files (e.g. shape
>> files, tiff files, spatialite), but also the SVG files. Relative
>> means relative to the .qgs project file.
>>
>> I generally create a directory per GIS project and put the .qgis in
>> the root of this directory and svg Files in a subdirectory.
>>
>> Alternatively, you can use the central storage of SVG files. This
>> can be anywhere in your file system and you can define it in the
>> Global Options --> Rendering --> SVG Paths
>>
>> Hope this helps.
>>
>> Andreas
>>
>> On Fri, 17 Aug 2012 11:03:53 +0100, Jonathan Moules wrote:
>>
>>> Hi Andreas,
>>> I've used this to style up my data, and it was looking excellent
>>> good.
>>> However I then moved the SVG files that were being used as the SVG
>>> Markers for the point fill (they were in a temporary directory on
>>> my
>>> desktop). Unfortunately this seems to have resulted in all of the
>>> point filled stylings now not working!
>>>
>>> Is this desired behaviour?
>>> I expected the SVG styling information to be stored in the QML
>>> file,
>>> that way I could just share the QML files and they'd work. This
>>> way it
>>> basically renders QML files useless for sharing - everyone will
>>> want
>>> to put the SVG files somewhere different because everyone has a
>>> different directory structure.
>>>  
>>> If I look into the styling as loaded, the SVG maker is pointing
>>> at:
>>> "C:/PROGRA~1/Quantum GIS Lisboa/apps/qgis/svg"
>>> If I move the SVG files into there, they still aren't loaded if I
>>> reload the style.
>>> Any thoughts? Hows this supposed to work?
>>>  
>>> Jonathan
>>>
>>>  
>>> On 16 August 2012 16:13, Jonathan Moules  wrote:
>>>
>>>> Thats exactly what I want, works great, thanks!
>>>>
>>>> On 16 August 2012 15:25, Andreas Neumann wrote:
>>>>
>>>>>> supplied symbols, I'm not convinced QGIS could symbolise
>>>>>> them neatly
>>>>>> anyway without tweaking the SVG itself (i.e. there's no way
>>>>>> to
>>>>>> specify
>>>>>> distance between symbols for instance).
>>>>>
>>>>> The patterns, by definition, don't have spacing between the
>>>>> tiles,
>>>>> because patterns should provide seamless tiling. However, you
>>>>> can
>>>>> specify the tile size.
>>>>>
>>>>> If you want spacing between symbols, you could use the point
>>>>> pattern fill editor where you can also use SVG point markers
>>>>> and
>>>>> provide spacing and displacement. This requires QGIS 1.8, I
>>>>> believe.
>>>>>
>>>>> Andreas
>>>>>
>>>>> --
>>>>> Andreas Neumann
>>>>> Böschacherstrasse 10A
>>>>> 8624 Grüt (Gossau ZH)
>>>>> Switzerland
>>>>>
>>>>> _______________________________________________
>>>>> Qgis-user mailing list
>>>>> Qgis-user at lists.osgeo.org [1] [1]
>>>>> http://lists.osgeo.org/mailman/listinfo/qgis-user [2] [2]
>>>
>>>  This transmission is intended for the named addressee(s) only
>>> and may
>>> contain sensitive or protectively marked material up to RESTRICTED
>>> and
>>> should be handled accordingly. Unless you are the named addressee
>>> (or
>>> authorised to receive it for the addressee) you may not copy or
>>> use
>>> it, or disclose it to anyone else. If you have received this
>>> transmission in error please notify the sender immediately. All
>>> email
>>> traffic sent to or from us, including without limitation all GCSX
>>> traffic, may be subject to recording and/or monitoring in
>>> accordance
>>> with relevant legislation.
>>>
>>> Links:
>>> ------
>>> [1] mailto:Qgis-user at lists.osgeo.org [3]
>>> [2] http://lists.osgeo.org/mailman/listinfo/qgis-user [4]
>>> [3] mailto:a.neumann at carto.net [5]
>>> [4] mailto:jonathanmoules at warwickshire.gov.uk [6]
>>
>> --
>>
>> --
>> Andreas Neumann
>> Böschacherstrasse 10A
>> 8624 Grüt (Gossau ZH)
>> Switzerland
>
>  This transmission is intended for the named addressee(s) only and 
> may
> contain sensitive or protectively marked material up to RESTRICTED 
> and
> should be handled accordingly. Unless you are the named addressee (or
> authorised to receive it for the addressee) you may not copy or use
> it, or disclose it to anyone else. If you have received this
> transmission in error please notify the sender immediately. All email
> traffic sent to or from us, including without limitation all GCSX
> traffic, may be subject to recording and/or monitoring in accordance
> with relevant legislation.
>
>
> Links:
> ------
> [1] mailto:Qgis-user at lists.osgeo.org
> [2] http://lists.osgeo.org/mailman/listinfo/qgis-user
> [3] mailto:Qgis-user at lists.osgeo.org
> [4] http://lists.osgeo.org/mailman/listinfo/qgis-user
> [5] mailto:a.neumann at carto.net
> [6] mailto:jonathanmoules at warwickshire.gov.uk
> [7] mailto:a.neumann at carto.net

-- 
 --
 Andreas Neumann
 Böschacherstrasse 10A
 8624 Grüt (Gossau ZH)
 Switzerland



More information about the Qgis-user mailing list