Skip to content

Commit c646f3a

Browse files
committed
Updated information to contain more information about levels, precisions, and the number of characters used to encode coordinates at each level.
1 parent ba48225 commit c646f3a

File tree

1 file changed

+72
-7
lines changed

1 file changed

+72
-7
lines changed

README.md

Lines changed: 72 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# arcgis-plus-code-generator
1+
# ArcGIS Pro Plus Code Generator
22

33

44
# Description
@@ -11,25 +11,90 @@ This tool is a side effect of a project I have done for work. I have explored di
1111

1212
# System Requirements
1313

14-
This tool is developed and tested for ArcGIS Pro. I have tested for ArcGIS Pro 2.7.
14+
This tool is developed and tested for ArcGIS Pro. I have tested for ArcGIS Pro 2.7. Your python environment must be of 3.x (tested with 3.7, but I assume it works with 3.6 too).
1515

16-
Your python environment must be of 3.x (tested with 3.7, but I assume it works with 3.6 too).
16+
The open location code library for Python must be installed in your python environment. The next section will explain how to do that.
1717

18-
The open location code library for Python must be installed in your python environment. In short
19-
`pip install openlocationcode`. For detailed instructions: https://github.com/google/open-location-code/tree/master/python
18+
# How to install
19+
20+
## Clone your Python Environment
21+
22+
Open ArcGIS Pro, and bring up the menu. That will let you access your Python options, and create a new Python environment. We need that since we need to install the open location code API, and that won't be allowed in ArcGIS Pro's default environment.
23+
- Open ArcGIS Pro
24+
- Open the menu on the left ribbon
25+
- Go to the Python section of the menu.
26+
- Click on manage environment
27+
- Clone your default environment. Give it a meaningful name and location. In my case, I am storing my custom ArcGIS Pro environment on `D:\arcgis-pro-envs`. The name of my environment is : `arcgispro-py3-plus-code`
28+
29+
![Cloning](images/clone-environment.png)
30+
31+
Once cloning is over, select your new environment as your default environment when you want to use our tool. You will need to restart ArcGIS Pro.
32+
33+
![SelectEnvironemnt](images/select-python-environment.png)
34+
35+
36+
## Install the open location code API
37+
38+
Open a command line prompt, and use the `cd` command to navigate in the subdirectory of your newly created environment. In my case: `D:\arcgis-pro-envs\arcgispro-py3-plus-code\Scripts`. Then run the following command line:
39+
40+
`pip install openlocationcode`.
41+
42+
Once it is done, the command line should look like that.
43+
44+
![pip](images/pip-install.png)
45+
46+
For more instructions about the open location code API, go to: https://github.com/google/open-location-code/tree/master/python
47+
48+
# Creating a folder connection to the tool:
49+
50+
Create a folder connection, as per the screenshot below, and navigate where you have downloaded and extracted the tool.
51+
52+
![pip](images/folder-connection.png)
53+
54+
You will then be able to access the tool
55+
56+
![pip](images/folder-connection-2.png)
2057

2158
# How to use
2259

2360
Use the tool box in ArcGIS Pro. There is built-in help in the tool metadata, and the tool is configured to guide you and minimize input errors.
2461

62+
In order to use the tool, double click on the tool `Get Plus Code`
63+
64+
![pip](images/use-tools.png)
65+
66+
The tool with then guide you through the list of parameters to provide:
67+
68+
![pip](images/parameters.png)
69+
70+
71+
2572
# How to contribute
2673

27-
This tool has been done in rush. Though is works, it does not match my standards or the industry standards in terms of unit testing or documentation.
2874
If you want to help, or have any suggestion, log an issue, and a pull request if you feel bold enough. Just remember to be nice.
2975

3076
# Data Considerations
3177

78+
## Spatial Reference
79+
3280
Your input feature class must be using Lat / Long, on the spheroid WGS84. The wkid associated with that spatial reference system is 4326. The tool will send you a friendly error message otherwise.
3381

34-
The tool expects a field to populate in your input feature class. That field must be of type string. Its length must be longer than the number of characters request for the plus length + 1. This is because Plus Code will add an extra character '+' after the 8th character. The minimum field length must be 9. This is because even if you ask for a Plus Code encoded on 4 characters, the API still returns 9 characters: for example `86JW0000+`. I have not figured out if that's good or bad yet.
82+
## Field constraints
83+
84+
The tool expects a field to populate in your input feature class. That field must be of type string.
85+
86+
Its length must be longer than the number of characters request for the plus length + 1. This is because Plus Code will add an extra character '+' after the 8th character.
87+
88+
The minimum field length must be 9. This is because even if you ask for a Plus Code encoded on 4 characters, the API still returns 9 characters (the 4 characters you aked 4 and four characters 0): for example `86JW0000+`. I have not figured out if that's good or bad yet.
89+
90+
Feel free to check out this link if you want to know about plus code levels: https://grid.plus.codes/. From there we can learn:
3591

92+
```
93+
level=0 will force the grid precision to be two digit OLC codes (20° x 20°);
94+
level=1 will force the grid precision to be four digit OLC codes (1° x 1°);
95+
level=2 will force the grid precision to be six digit OLC codes (.05° x .05°);
96+
level=3 will force the grid precision to be eight digit OLC codes (.0025° x .0025°);
97+
level=4 will force the grid precision to be ten digit OLC codes (.000125° x .000125°). This is the default house level precision;
98+
level=5 will force the grid precision to be eleven digit OLC codes (.000025° x .00003125°);
99+
level=6 will force the grid precision to be twelve digit OLC codes (.000005° x 0.0000078125°);
100+
```

0 commit comments

Comments
 (0)