Tuesday, May 3, 2016

Re: manipulate n insert field values

#Z value calculation
#................................
#step1: converting lat and long to int

latitude int = (latitude + 90) × 10^6
longitude int = (latitude + 180) × 10^6

#note 10^6 = 1000000

We compute the Morton value for a spatial point P (x, y)
by interleaving the bits of x and y. For example, when x =
3(011 ) and y = 4(100), the Morton value for P is
100101 = 37

#step2: convert int (base 10) to binary digits (base 2)
..........?
#step3: interleave both values bits and compute z value
#take first bit from y cordinate  (longitude) : 1
#take first bit from x cordinate  (lat) : 0
#take 2nd bit from y cordinate  (longitude) :0
#take 2nd bit from x cordinate  (lat) : 1
#take 3rd bit from y cordinate  (longitude) : 0
#take 3rd bit from x cordinate  (lat) : 1

therefore z binary value is 100101
and z value is 37

#this is the technique used to convert spatial 2D indexing to 1D to improve efficiency.

I do not know the python syntax. Kindly help.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/11aa86cc-0a4d-41be-b759-9a2ac83099cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment