Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 12768

Having no specific pattern, purpose, or objective

6 votes
1 answer
2k views

Is there any random data generator supporting geometry in PostGIS?

I found few random data generators for PostgreSQL (such as this one), but none supporting PostGIS geometry type, other than point. … I have some idea how to do it (random starting direction or random angle from previous node + random distance from quasi-centroid). …
Pavel V.'s user avatar
  • 1,517
8 votes

Is there any random data generator supporting geometry in PostGIS?

()*(x_max - x_min) + x_min, random()*(y_max - y_min) + y_min ), srid ) ); END $func$ LANGUAGE plpgsql VOLATILE; I don't need the position to be extra accurate, so I use approximate … , but now we are safe from endless loop dist := random() * max_dist; SELECT array_append( nodes, ST_Translate( qcen, sin(angle)*dist, cos(angle)*dist ) ) INTO nodes; angle := angle + random
Pavel V.'s user avatar
  • 1,517