get all global codes of Manhattan

51 views
Skip to first unread message

One Galaxy

unread,
Jan 31, 2022, 2:25:49 AM1/31/22
to Plus Codes Community Forum
Hi all,
i'm trying to get all global codes (Plus Codes) of New York Manhattan. So i created a kml file and used the https://grid.plus.codes/kml?BBOX= request. The response message was that i only can use four coordinates for the box. Is there any other way i can get all global codes of this kml box?


2022-01-31 08_25_07-New York.png
New York.kml

Andreas B

unread,
Jan 31, 2022, 5:23:15 AM1/31/22
to Plus Codes Community Forum
Hi,

as far as I can tell, there's no built-in functionality to get a full plus code list for an arbitrary area. However, I implemented something like this a while ago, using a scanline algorithm typically used in computer graphics. I haven't looked at that code for years, there might still be one-off errors around the edges, but it generally works.

I just generated this list of full plus codes from the coordinate list in your KML file, I hope it helps.

manhattan_full_plus_codes

One Galaxy

unread,
Feb 1, 2022, 4:42:02 AM2/1/22
to Plus Codes Community Forum
Thank you, that is what i needed. Is it also possible to get the global codes (87G8R3H3+XX).

Andreas B

unread,
Feb 1, 2022, 4:45:28 AM2/1/22
to Plus Codes Community Forum
Hi,

this will probably be a duplicate, because I already replied to the PM, but in case that didn't go through, or anyone else is interested in the output at some point, here's the full list containing a mix of 8-digit and 10-digit plus codes. For the 8-digit codes, you can assume that ALL 400 possible 10-digit codes with that prefix (for example, 87G8P2XJ+22 .. 87G8P2XJ+XX for the entry 87G8P2XJ+) are located within your original polygon. Hope this helps. :)

out_merged.txt
Reply all
Reply to author
Forward
0 new messages