Find all the plus codes within an area of the map

1,192 views
Skip to first unread message

himans...@urbanclap.com

unread,
Jan 18, 2019, 10:04:46 AM1/18/19
to Plus Codes Community Forum
Hi,

I have created some areas on google maps with the maps editor - I want to find the plus codes that are within this area. Is there a quick way to do it?

Thanks,
Himanshu

Barry Hunter

unread,
Jan 18, 2019, 10:35:48 AM1/18/19
to himans...@urbanclap.com, Plus Codes Community Forum
Plus codes of what?

A plus code is a representation of a coordinate, or point. In a given area there are effectively infinite points. Although depending on precision of quoting location there can be less effective 'usable points'. Eg in lat/long if quote locations to 6 decimal places, then there are only a certain number of points at that precision. 

Same with Plus codes. For example may quote codes as 10 digit, which means lots of the points have the same plus code. Another way of thinking of it a given plus code presents an area (roughly rectangular) 

... so you could be looking for all the unique plus codes that intersect the 'drawn' area. ie the rectangles overlap your area. 
... or could be thinking of areas 'wholly enclosed' by. ie plus codes wholey within the area, no part of the rectangle outside it. 

Or maybe are you thinking of just plus-codes that represent specific features within the area? ie you have a list of addresses. First find which of the addresses are in the area (Eg using lat/long coordinate), then can just compute the plus codes for those matching. 

... the exact algorithm, will depend on what trying to get. 


 





 

Himanshu Arora

unread,
Jan 18, 2019, 11:15:21 AM1/18/19
to Barry Hunter, Plus Codes Community Forum
Thanks a lot Barry! 

Apologies, I did not clarify too well initially. It is closed to the first comment you made.

I have an area carved out like below.

image.png

I want to see what all 8 digit plus code grids lie within this area. There are infinite location points but only a finite number of 8 digit plus code grids possible within this area (that are completely within this area).

image.png

Thanks a lot,
Himanshu
--

Himanshu Arora
AVP - Business Development
M: +91 958201 3353


    
Book services on the go, Download the app now!
 

DISCLAIMER This e-mail message may contain confidential or legally privileged information and is intended only for the use of the intended recipient(s). Any unauthorized disclosure, dissemination, distribution, copying or the taking of any action in reliance on the information herein is prohibited. UrbanClap is not responsible for errors or omissions in this message and denies any responsibility for any damage arising from the use of e-mail. Any opinion and other statement contained in this message and any attachment are solely those of the author and do not necessarily represent those of the company.

Barry Hunter

unread,
Jan 18, 2019, 11:40:29 AM1/18/19
to Himanshu Arora, Plus Codes Community Forum
Hmm, ok, so yes, you are basically wanting the 'grid' of codes that intersert the area. 

If you dont need them in 'list' form, then could perhaps add the plus-code grid to your map



But actually the grid service, basically just plots all the plus codes in the area. Which is very close to what you want to do. 

So you perhaps could 'abuse' the grid service for your list. The above page, has details of making a 'manual' request. 

It seems it can only get the codes withing a rectangular area defined by a BBOX. So could compute the BBOX of your drawn area, make a request from the API, then check which of the returned plus codes are in the area. 

Lots of algorithms for that. 

The Maps API also have a containsLocation which would do it

Message has been deleted

Andreas B

unread,
Jan 22, 2019, 8:30:41 AM1/22/19
to Plus Codes Community Forum
I'm not sure why my previous message here has been deleted. Any info about that?

Rasťo Šrámek

unread,
Jan 25, 2019, 3:34:46 AM1/25/19
to Andreas B, Plus Codes Community Forum
Andreas: for some reason the last one was marked as spam and I had to manually approved it. Hopefully the filter learned from that. Very sorry about that!

On Fri, 25 Jan 2019, 09:32 Andreas B <and...@bocops.de wrote:
Himanshu Arora,

I haven't done much with it lately, but this might be of help to you. Basically, starting from a list of coordinates (which will be interpreted as vertices of a well-formed polygon - no error checking yet), you can output a list of plus codes that correspond to the polygon's area, in any precision you like:


This is currently just available in a branch because I haven't found time to test for all sorts of bugs. It should be mostly OK, though.

--
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 "Plus Codes Community Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-c...@googlegroups.com.
To post to this group, send email to open-loca...@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/c79a0f9d-c1fd-40c9-9814-e37348d7ab3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Doug Rinckes

unread,
Apr 8, 2019, 6:48:59 AM4/8/19
to he...@instinctive.io, Plus Codes Community Forum
Hi - sorry - but there's an error on the documentation page, but thanks for helping find it!

The URL should be (using 'kml' instead of 'grid'):


I'll update the documentation now, apologies again.

Ngā mihi,
Doug Rinckes, Technical Program Manager, Google Switzerland GmbH; 9G8F+6W Zürich


On Fri, 5 Apr 2019 at 06:03, <he...@instinctive.io> wrote:
Doesn't seem like the BBOX endpoint works properly. I keep getting a bad tile request error when trying this:

--
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 "Plus Codes Community Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-c...@googlegroups.com.
To post to this group, send email to open-loca...@googlegroups.com.
Visit this group at https://groups.google.com/group/open-location-code.

Andrey Panin

unread,
Jun 24, 2019, 12:06:09 AM6/24/19
to Plus Codes Community Forum


On Friday, January 18, 2019 at 10:35:48 PM UTC+7, Barry Hunter wrote:
A plus code is a representation of a coordinate, or point. In a given area there are effectively infinite points.

This is not so. The specification explicitly tells that it is the representation of an area, not a point. 
Reply all
Reply to author
Forward
0 new messages