Select to view content in your preferred language

Is it possible to create a street grid index map using only ArcGIS Pro?

4723
7
Jump to solution
09-18-2020 08:42 AM
MDB_GIS
Frequent Contributor

Here is an example of what I'm looking to do. The part I am really struggling with is how to associate the streets to the correct location in the grid. I'm not sure how to create the grid itself, and further more, I'm not sure how to create the border letters and numbers for the grid.

I have done something similar before using this tool in ArcMap, however I can't find the equivalent function in ArcGIS Pro. I appreciate any help!

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
LukasFalk
Esri Contributor

Hello Matthew,

There are a couple of tools that come to mind in ArcGIS Pro for creating grids.  The first is the Create Fishnet tool, which creates a fishnet of rectangular cells.  You can find information about this tool at the URLs below.  

Create Fishnet (Data Management)—ArcGIS Pro | Documentation 

How Create Fishnet works—ArcGIS Pro | Documentation 

An alternative to this tool would be the Grid Index Features tool.  This tool has the added benefit of enabling you to only create gird cells where another specified feature class exists.  You can find information on this tool at the URL below.  

https://pro.arcgis.com/en/pro-app/tool-reference/cartography/grid-index-features.htm

I hope this helps!

Lukas 

View solution in original post

0 Kudos
7 Replies
LukasFalk
Esri Contributor

Hello Matthew,

There are a couple of tools that come to mind in ArcGIS Pro for creating grids.  The first is the Create Fishnet tool, which creates a fishnet of rectangular cells.  You can find information about this tool at the URLs below.  

Create Fishnet (Data Management)—ArcGIS Pro | Documentation 

How Create Fishnet works—ArcGIS Pro | Documentation 

An alternative to this tool would be the Grid Index Features tool.  This tool has the added benefit of enabling you to only create gird cells where another specified feature class exists.  You can find information on this tool at the URL below.  

https://pro.arcgis.com/en/pro-app/tool-reference/cartography/grid-index-features.htm

I hope this helps!

Lukas 

0 Kudos
MDB_GIS
Frequent Contributor

Lukas, 

Thank you for sharing this. I was eventually able to get the Create Fishnet tool to do what I wanted. It was very finicky, however. I wanted to set my grid up to completely cover the map layout so that it would line up with the grid index on the layout. The first several variations of running the tool, the grid never perfectly covered map frame. It would always be slightly too big. The trick ended up being to just set the number of rows and columns desired rather than the height and width. That produced the desired results. I miss the ArcMap 'Create Grid Polygon Wizard'. That was much more intuitive! I hope to see a similar workflow return to Pro at some point. 

0 Kudos
JianwuChen
Occasional Contributor

First, I use SQL (specifically SQL Server spatial data type' method) to find street line feature class intersecting grid polygon feature class and save the result (street name and grid index) in a table. Then, I use python to format the result and create a EMF image file. Finally, I insert that EMF file into the layout of a .aprx to create a PDF map with street index table. See attachment Wards.pdf.

BretRowlinson1
New Contributor

What you have explained is exactly what I have been looking to do in order to automate the table updates better.  Doing it manually now.  Are you able to provide any samples of the SQL and/or Python that you are using for this?

Cheers!

Donald_EricPimpler
Emerging Contributor

Would you be willing to share the Python code you used to create the final street index?

MarkGambordella
Regular Contributor

any luck on getting a code or workflow on creating the Street index grid map?

NasosAlexis
Emerging Contributor

I needed to do the same thing at work yesterday and I developed a workflow that seems to work fine and can be updated quite easily if needed (new roads or expanded area of interest etc).

It only requires some Arcade code, which I will include later.

The tricky part is to create a proper grid. So, when you use the Grid index features GT, don't use the feature class containing the streets as input. Here's what I did:

 

1. Create a temporary polygon feature class in the same coordinate system as your datasets. In that feature class, add a rectangle that covers your streets feature class. Draw the rectangle's lower left and upper right corners on round coordinates in your coordinate system (e.g. 380 000, 6 170 000 etc) so that the grid index features also create a grid on round segments based on your prefered settings later.

2. Run the Grid index features GT with your temporary layer from step 1 as input and settings as you see fit. Of course you can omit step 1, by defining the origo for the Grid index features tool if you want.

3. Once your grid feature class is created, make a copy of the outer rows and columns of the grid and place them one place away from the grid. These columns and rows will be labelled later and function as a reference grid when you layout the map. Add two fields, one for vertical label and one for horizontal label and populate with with the field calculator so that they only contain letters or numbers from the field PageName in the grid feature class. This is an easy process, I won't write the steps to do it. Then add two label classes, one for vertical and one for horizontal, write a short SQL-expression to only label the required features and lastly change the symbology, so that the labeled features are invisible and the grid features only have an outline.

And now the fun part:

4. Go back to your streets feature class and add a field that will contain the grid indices for each road.

5. Run "Dissolve" on the feature class, with the field containing the street name as dissolve field.

6. Open field calculator for the new field that will contain the grid indices and use Arcade as parcer.

The Arcade expression is very simple, but it will look different based on each user's datasets etc, so I will break it down with comments (funny that ESRI's forum doesn't have an option to insert an Arcade code sample with syntax highlighting, it would be helpful):

//Declare a variable for the grid feature class. This can be omitted to make the code faster, I will show the alternative later
var griditem=FeatureSetByName($datastore,'grid3_lund') //"grid3_lund" is the name of my grid feature class

//Declare another variable for the geometry function. This line can also be omitted.
var crossing = Intersects($feature,griditem) //Other geometry functions could be used here as well, "Crosses()" I think would work just fine, I am not sure if it would give different results, try it out if you like.

//Create a list where the crossing grid boxes will be appended.
var lst1=[]

//Iterate the items in the feature class while checking which grid boxes each road crosses and append the indices in the list
for (var item in crossing){
  Push(lst1,item.PageName)
}

//Create a string to write the result
var output=''

//Concatenate the grid indices in the string, separated by ", ".
for (var item in lst1){
  output = output +', '+lst1[item]
}

//Populate the field with the string, removing the first ", ".
return Right(output,Count(output)-2)

 

Spoiler
Like I said, the expression can be shortened down a bit if you omit the first two variable declarations:
var lst1=[]
for (var item in Intersects($feature,FeatureSetByName($datastore,'grid3_lund'))){
  Push(lst1,item.PageName)
}
var output=''
for (var item in lst1){
  output = output +', '+lst1[item]
}
return Right(output,Count(output)-2)

So, this should populate the field with the indices of every grid box that each street goes through. From that point on, you should be able to export the attribute table to excel, format it and add it to your layout.

I even attach a very ugly layout export, as proof of concept. I haven't formatted the table and the map is a mess, but I am only showing the result of the above workflow, nothing more.

Hit me up if anything is unclear, I will try to answer as fast as I can.

Best,

Nasos

 

 

0 Kudos