Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a world map. I need random point geometry. So, how can I randomly generate point coordinates? Any programming language. Also, I am using SRID 4326.

Any programming language.

share|improve this question
    
Do you just need a single point? –  Nathan W Apr 28 '13 at 8:43
    
Yes, but it should be absolutely random coordinate. –  Bob Apr 28 '13 at 8:45
    
But algorthm for n points will be also a good choice –  Bob Apr 28 '13 at 8:46
add comment

1 Answer 1

up vote 4 down vote accepted

With some Python:

from random import uniform
x, y = uniform(-180,180), uniform(-90, 90)

or for a loop:

def newpoint():
   return uniform(-180,180), uniform(-90, 90)

points = (newpoint() for x in xrange(10))
for point in points:
   print point
share|improve this answer
    
Nice, simple solution. –  Fezter Apr 29 '13 at 1:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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