Skip to content

Commit 849dd36

Browse files
authored
Merge pull request #8 from fabanc/issue-7
issue-7
2 parents a46ca36 + 21e1da6 commit 849dd36

File tree

7 files changed

+49
-9
lines changed

7 files changed

+49
-9
lines changed

README.md

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
11
# ArcGIS Pro Plus Code Generator
22

3+
## Table of content
34

4-
# Description
5+
* [Description](#description)
6+
* [System Requirements](#sys-requirements)
7+
* [How to Install](#install)
8+
* [How to use](#how-to)
9+
* [Tutorial: Generating a grid and its Plus Codes](#tutorial)
10+
11+
## <a name="description"></a>Description
512

613
This tool exposes the open location code API create by google and uses it to generate Plus Codes on ArcGIS feature classes. The API documentation is there: https://github.com/google/open-location-code
714

815
Detailed information about Plus Codes and the KML Service that Google Provides can be found there: https://grid.plus.codes/
916

1017
This tool is a side effect of a project I have done for work. I have explored different solutions with FME and QGIS, but this was by far the fastest solution. It can generate plus code on points, and polygon feature classes.
1118

12-
# System Requirements
19+
## <a name="sys-requirements"></a>System Requirements
1320

1421
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).
1522

1623
The open location code library for Python must be installed in your python environment. The next section will explain how to do that.
1724

18-
# How to install
25+
## <a name="install"></a>How to Install
1926

20-
## Clone your Python Environment
27+
### Clone your Python Environment
2128

2229
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.
2330
- Open ArcGIS Pro
@@ -33,7 +40,7 @@ Once cloning is over, select your new environment as your default environment wh
3340
![SelectEnvironemnt](images/select-python-environment.png)
3441

3542

36-
## Install the open location code API
43+
### Install the open location code API
3744

3845
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:
3946

@@ -45,7 +52,7 @@ Once it is done, the command line should look like that.
4552

4653
For more instructions about the open location code API, go to: https://github.com/google/open-location-code/tree/master/python
4754

48-
# Creating a folder connection to the tool:
55+
### Creating a folder connection to the tool:
4956

5057
Create a folder connection, as per the screenshot below, and navigate where you have downloaded and extracted the tool.
5158

@@ -55,7 +62,7 @@ You will then be able to access the tool
5562

5663
![pip](images/folder-connection-2.png)
5764

58-
# How to use
65+
## <a name="how-to"></a>How to use
5966

6067
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.
6168

@@ -65,7 +72,7 @@ In order to use the tool, double click on the tool `Get Plus Code`
6572

6673
The tool with then guide you through the list of parameters to provide:
6774

68-
![pip](images/parameters.png)
75+
![params](images/parameters.png)
6976

7077

7178

@@ -97,4 +104,37 @@ level=3 will force the grid precision to be eight digit OLC codes (.0025° x .00
97104
level=4 will force the grid precision to be ten digit OLC codes (.000125° x .000125°). This is the default house level precision;
98105
level=5 will force the grid precision to be eleven digit OLC codes (.000025° x .00003125°);
99106
level=6 will force the grid precision to be twelve digit OLC codes (.000005° x 0.0000078125°);
100-
```
107+
```
108+
109+
## <a name="tutorial"></a>Tutorial - Generate a Grid at level 3 and compute the Plus Codes of the polygons
110+
111+
ArcGIS Pro is a powerful piece of software. You can use some built-in tools to generate a grid representing plus codes areas and compute the plus code for the centroid of each polygon using the tool we provide.
112+
113+
We're going to use the tool `Create Fishnet`. The full documentation can be found here: https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/create-fishnet.htm
114+
115+
In our tutorial, let's generate a level 3 grid for Ottawa, ON, Canada.
116+
117+
![fishnet-input](images/create-fishnet.png)
118+
119+
Be sure in the section `Environments` to search your spheroid to be WGS84 (you can search by wkid, using the code 4326)
120+
121+
![gcs](images/fishnet-gcs.png)
122+
123+
This will generate our grid for Ottawa:
124+
125+
![fishnet-output](images/fishnet-output.png)
126+
127+
Use the Add Field tool. Here we have level 3 polygon, so the encoding requires 8 characters, and an additional character `+`. So our field length is 9:
128+
129+
![add-field](images/add-field.png)
130+
131+
Then use our tool to populate the new field named `PLUS_CODE`:
132+
133+
![run-tool](images/run-tool.png)
134+
135+
Then turn on labelling to admire the results:
136+
137+
![tool-result-labels](images/tool-result-labels.png)
138+
139+
140+

images/add-field.png

903 KB
Loading

images/create-fishnet.png

1.16 MB
Loading

images/fishnet-gcs.png

18.6 KB
Loading

images/fishnet-output.png

876 KB
Loading

images/run-tool.png

897 KB
Loading

images/tool-result-labels.png

550 KB
Loading

0 commit comments

Comments
 (0)