Select to view content in your preferred language

Fishnet with checkerboard symbology

667
5
09-07-2023 09:07 AM
Arsheen
Emerging Contributor

Hi Everyone!

I am to figure out a way to symbolize a fishnet with a black and white checkerboard pattern. As a part of my work, I  develop grids for activity and every other grid has to shaded to limit activity. Every grid I make is of different size and shape. I have been trying to figure out some type of symbology expression to get this done but haven't quite figured it out. 

I got close with numbering the grid cells and using an odd/even function but this doesn't always work. 

Any help would be appreciated!

This is what it should look like:

Arsheen_0-1694102715875.png

This is what I get with my Odd/even approach

Arsheen_1-1694102820070.png

 

0 Kudos
5 Replies
jcarlson
MVP Esteemed Contributor

Consider combining the row and column identifiers to make the color shift per row. I don't know what your layer attributes look like, but if they were both numbers, it could be as simple as:

var x = $feature['column_number']
var y = $feature['row_number']

return Iif(x % 2 == y % 2, 'A', 'B')

If your fishnet has values like "A-32" for the grid ID, do this:

var id = Split($feature.GRID_ID, '-')
var x = ToCharCode(id[0])
var y = Number(id[1])

return iif(x % 2 == y % 2, 'A', 'B')

 

jcarlson_0-1694104444864.png

Offhand, I don't know what fishnet grids do after "Z". Does it start going "AA"? That may add a little kink to things, but maybe your grids aren't that big.

- Josh Carlson
Kendall County GIS
0 Kudos
Arsheen
Emerging Contributor

Thanks for the reply. Unfortunately, I think I need a more detailed explanation since I am a novice! When I use the fishnet function to get my grid, there are no separate column and row identifiers. I can add a grid identifier but it wouldn't be column or row based rather a grid cell number. 

In the example below, I added number and odd/even field. The fishnet functions generated the other fields. 

Arsheen_0-1694108060688.png

 

0 Kudos
jcarlson
MVP Esteemed Contributor

Can you give an example of that that "grid identifier" would look like?

I'm using an Arcade expression to define the symbology categories, but it won't do us any good if the fishnet tool doesn't give you something to indicate row/column position. Try using Generate Tesselation instead.

- Josh Carlson
Kendall County GIS
0 Kudos
Arsheen
Emerging Contributor

Got it. I used the Generate Tessellation tool and have grid IDs. However, my ArcPro version (2.9.5) doesn't recognize ToCharCode function. I see the logic of your function, maybe I can find another function to use instead. 

KAR1580
Emerging Contributor

But this does not represent a fishing net and you can look for another symbol

0 Kudos