[Qgis-user] Small maths problem!

Neumann, Andreas a.neumann at carto.net
Thu Jul 23 02:01:40 PDT 2015


 

Hi Richard, 

It would be interesting to have this as a built-in feature of the "line
pattern fill" renderer in QGIS: being able to specify an angle relative
to the longest line segment of a polygon. 

I have the same issue for our black and white base map - see
http://webgis.uster.ch/wsgi/webgisLauncher.wsgi?uuid=a6634a18-d37f-4997-b3d8-d4c3aed51716
[4] 

There we would like the line pattern fill angle to be 30 or 45 degrees
relative to the longest side of a building. Currently all of these
hatch-pattern fills are manually rotated ;-( 

Meanwhile - until such a feature is available in QGIS - you could
preprocess your data with a Python script be decomposing your polygon
data to individual line segments, find the longest ones and get their
angles. I would probably save this in a data-column to speed up
rendering. But you said you can't do this - so maybe you really have to
calculate this on the fly. 

For data in Postgis one could write a plsql function to calculate these
angles. 

Sorry that I can't be of better help here. Just showing that I also have
in interest in such a feature. 

Andreas 

On 2015-07-23 10:10, Richard McDonnell wrote: 

> Hi,
> I am in need of some guidance, I am trying to create an "active hatch/Fill" as part of a style im working on. What I want is for a hatch to rotate depending on the orientation of a Polygon.
> For example, here is the same entity rotated, with the hatch rotating.
> 
> The issue is I am working on a database, onto which I cant add any data (additional columns) to the tables, I would like to do this from within the styling.
> You can use an expression to denote the angle, so I was hoping to do it that way.
> I was looking to utilize the geometry of a bounding box, and calculate the angle of the diagonal, using something like
> 
> 180*atan((ymax - ymin)/(xmax - xmin))/$pi + 90
> 
> But I am not having any luck....If there is no way at present to do this, Might I put it forward as a possible new feature?
> 
> Regards,
> 
> Richard.
> 
> OPW - Ag féachaint don am atá le teacht - Ag caomhnú ón am atá thart
> OPW - Looking to the future - Caring for the past
> [1]
> Email Disclaimer: http://www.opw.ie/en/disclaimer/ [2] 
> 
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user [3]

 

Links:
------
[1] http://www.opw.ie/
[2] http://www.opw.ie/en/disclaimer/
[3] http://lists.osgeo.org/mailman/listinfo/qgis-user
[4]
http://webgis.uster.ch/wsgi/webgisLauncher.wsgi?uuid=a6634a18-d37f-4997-b3d8-d4c3aed51716
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150723/7618bb9e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iagichcc.png
Type: image/png
Size: 6095 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150723/7618bb9e/attachment.png>


More information about the Qgis-user mailing list