Re: [open-location-code] Best way to determine adjacency and overlap?

2018-01-09 Thread Наташа Савенкова
среда, 15 ноября 2017 г., 15:53:03 UTC+3 пользователь Andreas B написал:
> Doug,
> 
> 
> those are exactly the functions I'm already using:
> 
> 
> getNeighbors(olc) - returns 8 codes of the same length as the input for 
> "tiles" that are adjacent to it
> isNeighbor(olcA, olcB) - returns true iff the "tiles" of olcA and olcB share 
> a "side", independent of their code length
> contains(olcA, olcB) - returns true iff the "tile" of olcA is contained in 
> olcB (= if olcB is a prefix of olcA)
> 
> 
> I also played around with distance functions, like
> 
> 
> getDistance(olcA, olcB) - which, for codes of the same length returns the 
> number of same-sized "tiles" inbetween, either as Chebyshev or Manhatten 
> distance. This can be useful as an approximation of travel distance from one 
> location to another
> getDirection(olcA, olcB) - which returns an approximate direction, for 
> example in degrees, to get from olcA to olcB
> 
> 
> and something like "areas", a structure to hold an arbitrary number of 
> "tiles" identified by their OLC, with functionality like
> 
> 
> Area.contains(olc)
> Area.contains(otherArea)
> Area.getSize()
> Area.closestTileTo(olcNotInArea)
> 
> 
> In the context of making locations without street addresses addressable, the 
> latter could be useful to answer questions like "Which of the (potentially 
> many) subsidiary/branches of a store is closest to my current location, how 
> far away is it, and how do I get there?" Obviously, distance and direction 
> can also be calculated by using the center lat/lng of a tile, so might not be 
> that useful an addition.



среда, 15 ноября 2017 г., 15:53:03 UTC+3 пользователь Andreas B написал:
> Doug,
> 
> 
> those are exactly the functions I'm already using:
> 
> 
> getNeighbors(olc) - returns 8 codes of the same length as the input for 
> "tiles" that are adjacent to it
> isNeighbor(olcA, olcB) - returns true iff the "tiles" of olcA and olcB share 
> a "side", independent of their code length
> contains(olcA, olcB) - returns true iff the "tile" of olcA is contained in 
> olcB (= if olcB is a prefix of olcA)
> 
> 
> I also played around with distance functions, like
> 
> 
> getDistance(olcA, olcB) - which, for codes of the same length returns the 
> number of same-sized "tiles" inbetween, either as Chebyshev or Manhatten 
> distance. This can be useful as an approximation of travel distance from one 
> location to another
> getDirection(olcA, olcB) - which returns an approximate direction, for 
> example in degrees, to get from olcA to olcB
> 
> 
> and something like "areas", a structure to hold an arbitrary number of 
> "tiles" identified by their OLC, with functionality like
> 
> 
> Area.contains(olc)
> Area.contains(otherArea)
> Area.getSize()
> Area.closestTileTo(olcNotInArea)
> 
> 
> In the context of making locations without street addresses addressable, the 
> latter could be useful to answer questions like "Which of the (potentially 
> many) subsidiary/branches of a store is closest to my current location, how 
> far away is it, and how do I get there?" Obviously, distance and direction 
> can also be calculated by using the center lat/lng of a tile, so might not be 
> that useful an addition.

-- 
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
--- 
You received this message because you are subscribed to the Google Groups 
"open-location-code" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-location-code+unsubscr...@googlegroups.com.
To post to this group, send an email to open-location-code@googlegroups.com.
Visit this group at https://groups.google.com/group/open-location-code.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/open-location-code/7aa9727d-be19-4df6-b4e1-589c057565c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [open-location-code] Best way to determine adjacency and overlap?

2017-11-17 Thread 'Doug Rinckes' via open-location-code
That's fine - I think a separate library makes sense, and I really like the
functions you've implemented.

I'll add a wiki page and add a pointer to your project if that's ok?


Doug Rinckes, Technical Program Manager, Google Switzerland GmbH; 9GHJ+P88 Z
ürich 

On Wed, Nov 15, 2017 at 10:35 PM, Andreas B  wrote:

> Hi Doug,
>
> I just did - although currently just for the mentioned functions, not yet
> the "Area" implementation (which is still somewhat messy and all over the
> place). I would add that to the same repository when done. I wasn't
> completely sure how to best integrate this additional functionality with
> OLC, so my current approach is to have a separate class wrapping an
> OpenLocationCode object.
>
> https://github.com/bocops/open-geotiling
>
> --
> Public site: http://www.openlocationcode.com/
> Github project: https://github.com/google/open-location-code
> Demo site: http://plus.codes/
> ---
> You received this message because you are subscribed to the Google Groups
> "open-location-code" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to open-location-code+unsubscr...@googlegroups.com.
> To post to this group, send email to open-location-code@googlegroups.com.
> Visit this group at https://groups.google.com/group/open-location-code.
> To view this discussion on the web, visit https://groups.google.com/d/
> msgid/open-location-code/c21e3154-4781-4705-941f-
> 685df3ae0932%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
--- 
You received this message because you are subscribed to the Google Groups 
"open-location-code" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-location-code+unsubscr...@googlegroups.com.
To post to this group, send an email to open-location-code@googlegroups.com.
Visit this group at https://groups.google.com/group/open-location-code.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/open-location-code/CAGFr2LKUHU3gcjotF%2BsSiz1X_V5dyzCBoJNNf_FM5EX6YJcvUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [open-location-code] Best way to determine adjacency and overlap?

2017-11-15 Thread Andreas B
Hi Doug,

I just did - although currently just for the mentioned functions, not yet 
the "Area" implementation (which is still somewhat messy and all over the 
place). I would add that to the same repository when done. I wasn't 
completely sure how to best integrate this additional functionality with 
OLC, so my current approach is to have a separate class wrapping an 
OpenLocationCode object.

https://github.com/bocops/open-geotiling

-- 
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
--- 
You received this message because you are subscribed to the Google Groups 
"open-location-code" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-location-code+unsubscr...@googlegroups.com.
To post to this group, send an email to open-location-code@googlegroups.com.
Visit this group at https://groups.google.com/group/open-location-code.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/open-location-code/c21e3154-4781-4705-941f-685df3ae0932%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.