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

```Adjacency is a good question - I don't have an answer for you.

Codes don't overlap - but one code may be contained within another. The way
to check is that the containing code will be a prefix of the contained
code, because (for example) the area of 8FVC contains all codes that start
with 8FVC.```
```
For a long time I've been thinking about a geometry library that does:

- For a polygon of lat/lngs, compute the codes that fill that polygon.
The codes should be normalised (i.e. it might return some 6 digit codes
with some 8 and 10 digit codes to fill the corners)
- This will make "is this code inside the polygon" easy
- For one code, return the 8 adjacent codes
- This will make "are these two codes adjacent"

Are there any other functions that would be useful?

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

On Wed, Nov 8, 2017 at 10:29 PM, seklncknsekjn <dus...@srax.com> wrote:

> Is there a built-in way to determine if two codes are exactly adjacent?
>
> Similarly, is there an easy way to determine if two codes overlap?
>
> Hopefully any solutions exist for dissimilar length codes... that'd be
> super cool!
>
> --
> Public site: http://www.openlocationcode.com/
> 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
> 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/8fc6cc55-fcb6-475c-b242-
> .
> For more options, visit https://groups.google.com/d/optout.
>

--
Public site: http://www.openlocationcode.com/
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