Has anyone else looked for an implementation of Open Location Code technology in ArcGIS Pro?
I would like to create Plus Codes for all our city buildings, and I'll be able to do it with a Google API, or with code from GitHub - google/open-location-code: Open Location Code is a library to generate short codes that can... but hey, anyone doing this within GIS? (partial credit for success via QGIS ;^)
I note that Daniel Diaz has generated them for all building footprints in Puerto Rico.
Also, the GitHub site appears to support seven languages' worth of implementations.
Seems like ArcGIS is just not central to OLC quite yet.
I was able to use the OLC Python code directly in Pro to calculate the 10 digit plus code for some building points in Africa. It took a little over an hour to do 18 million points. After that is was easy to pull out the local 6 digit + code and to an overlay with regions to get an address combination. I notice that OSMAnd now supports plus codes.
Any work on this or anyone want to post detail on how to use the python code in PRO to generate pluscodes. QGIS now has a plugin that will do this but native support in ArcGIS Pro would be great.
Can you be more specific on how you did the calculate, please? Did you use the "def encode..." part of the python code like the following:
def encode(latitude, longitude, codeLength=PAIR_CODE_LENGTH_): if codeLength < 2 or (codeLength < PAIR_CODE_LENGTH_ and codeLength % 2 == 1): raise ValueError('Invalid Open Location Code length - ' + str(codeLength)) # Ensure that latitude and longitude are valid. latitude = clipLatitude(latitude) longitude = normalizeLongitude(longitude) # Latitude 90 needs to be adjusted to be just less, so the returned code # can also be decoded. if latitude == 90: latitude = latitude - computeLatitudePrecision(codeLength) code = encodePairs(latitude, longitude, min(codeLength, PAIR_CODE_LENGTH_)) # If the requested length indicates we want grid refined codes. if codeLength > PAIR_CODE_LENGTH_: code = code + encodeGrid(latitude, longitude, codeLength - PAIR_CODE_LENGTH_) return code
in the Code Block? And what did you put in the <fieldname> = box?
We've worked with Plus Codes / Open Location codes for some of our clients, and along with a workmate, we've created an open source geoprocessing tool to work with Plus Code in ArcGIS Pro. The tool is open source, and an help and tutorial about Plus Code and ArcGIS can be found on the tool's repo: https://github.com/fabanc/arcgis-plus-code-generator. I hope that helps.