<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>I would use it only for performance tests, e.g. execute a spatial query (filters, routing etc.) 100 time with randomly changing input geometries to see how fast my database is.</div>

<div>I also wanted to use it to produce linestrings. I generated points, expanded them to a polygon, just to create three random points inside the boxes for creating a simple linestring. With the current behavior each linestring has the same shape (that's ok, I can live with that).</div>

<div> </div>

<div>I can also understand that the current behaviour makes sense for your use cases. Thus, I like the idea of having two functions.</div>

<div> </div>

<div>lg Felix</div>

<div> 
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Freitag, 18. Januar 2019 um 14:51 Uhr<br/>
<b>Von:</b> "Darafei "Komяpa" Praliaskouski" <me@komzpa.net><br/>
<b>An:</b> "PostGIS Development Discussion" <postgis-devel@lists.osgeo.org><br/>
<b>Betreff:</b> Re: [postgis-devel] ST_GeneratePoints randomness</div>

<div name="quoted-content">
<div>Hi Felix,
<div> </div>

<div>would you prefer the function to always return the same set of random points, or get the fact that it can return different set of points on invocations in different transactions documented?<br/>
<br/>
I'm not sure treating it same as random() is a great idea, I use it more like "give me a point cloud that fills this polygon" converting it for usage in point-accepting functions, like calculating the median of the polygon. I'd prefer it cached like it is now for such cases. <br/>
<br/>
What are you using your random geodata for? </div>
</div>
 

<div class="gmail_quote">
<div>On Wed, Jan 16, 2019 at 1:11 AM Felix Kunde <<a href="mailto:felix-kunde@gmx.de" onclick="parent.window.location.href='mailto:felix-kunde@gmx.de'; return false;" target="_blank">felix-kunde@gmx.de</a>> wrote:</div>

<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div>Hi list,</div>

<div> </div>

<div>I thought that this topic better belongs on this list.</div>

<div>I'm trying to create some random spatial data using the ST_GeneratePoints functions. I wanted to reuse it also for lines and polygons but stumbled over the issue that multiple calls of the function in one transaction produce the same result. I tested different query constructs - even looping over a PL/pgSQL function - but no luck. So whereas:</div>

<div> </div>

<div>SELECT</div>

<div>  random() AS random_a,</div>

<div>  random() AS random_b;</div>

<div> </div>

<div>creates different results, this:</div>

<div> </div>

<div>SELECT<br/>
  ST_AsText(ST_GeneratePoints('POLYGON((0 0,1 0,1 1,0 1,0 0))'::geometry, 2)) AS random_a,<br/>
  ST_AsText(ST_GeneratePoints('POLYGON((0 0,1 0,1 1,0 1,0 0))'::geometry, 2)) AS random_b;</div>

<div> </div>

<div>will produce the same. There are workaround to generate random geodata, of course.</div>

<div>Just wanted to point it out here and see, if you are aware of this. I couldn't found any ticket regarding this behaviour.</div>

<div> </div>

<div>Best, Felix</div>
</div>
</div>
_______________________________________________<br/>
postgis-devel mailing list<br/>
<a href="mailto:postgis-devel@lists.osgeo.org" onclick="parent.window.location.href='mailto:postgis-devel@lists.osgeo.org'; return false;" target="_blank">postgis-devel@lists.osgeo.org</a><br/>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-devel" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-devel</a></blockquote>
</div>
 

<div> </div>
--

<div class="gmail_signature">
<div>
<div>
<div>Darafei Praliaskouski</div>

<div>Support me: <a href="http://patreon.com/komzpa" target="_blank">http://patreon.com/komzpa</a></div>
</div>
</div>
</div>
_______________________________________________ postgis-devel mailing list postgis-devel@lists.osgeo.org <a href="https://lists.osgeo.org/mailman/listinfo/postgis-devel" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-devel</a></div>
</div>
</div></div></body></html>