This is more of a JS question, but interesting nonetheless.

To convert such a string to a unique number is easiest using a hash.  Given
N strings/polygons, you want a hash function that produces a number with
2lgN + 10 bits, in which case the N polygons/strings map to unique numbers
with probability 99.9%.  For example if you have 1000000 polygons, you need
2x30 + 10 = 70 bits or 12 bytes in base 64.

Why do you need a number though?  If you just want to index your polygons in
JS, use the string as a key into a JS Object where the value is the polygon
Object.

On 24 Sep 2010 15:13, "Niklasro" <[email protected]> wrote:
> Hi
> I can match longitude+latitude+radius matching stuff at arbitrary
> coordinates. Now next step is match inside a polygon. Can you
> recommend a way represent a polygon with a number? Ie input is
> longitude + latitude + number and the number represents a polygon.
> It's sure doable but too difficult? I'm considering something like
>
> ?lat=20&lon=40&p=2304985725
>
> and then the parameter p should represent a polygon using logical
> combination that the value p only matches one polygon function. Gödel
> numbering works something similar expressing prime powers with just
> one number.
>
> Thanks
> Niklas R
>
> --
> You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
> To post to this group, send email to
[email protected].
> To unsubscribe from this group, send email to
[email protected]<google-maps-js-api-v3%[email protected]>
.
> For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to