Creating a Quarter Quarter Section Grid with Python

Share Button

Updated – 7/15/2015
Fixed line movement from setting Overflow value, now based on slope
Updated – 2/27/2015
Fixed compatibility with Python 3 for ArcGIS Pro

(If you’re using Firefox, then right click and Save Link As)
Download the Custom Grid Toolbox – works with ArcGIS 10.1+
(contains 5 tools, 4 to make quarter and quarter quarter section grids with labels and 1 to make a custom grid)

(any donations go towards hosting costs)

View the Source Code:
Create Custom Grid
Create Q Sections script
Create QQ Sections script
Create Q Labels script
Create QQ Labels script

Watch how to use the Custom Grid Tools — Video Updated on 7-16-2015

I was tasked with creating a quarter quarter section grid for a few Nebraska counties because the BLM didn’t have one available. They did have a section grid though. So I needed to split each section grid into 16 parts and also add an attribute that will be used as a label for each quarter quarter section grid. Also, I know this isn’t a substitute for an actual survey grade quarter quarter section grid, but sometimes you’re required to work with what you have. And in this case, the quarter quarter section grid will be used by an electric utility to name their facilities and customers. It all depends on what you need.

Section To QQ

I had to create quarter quarter sections for about 3000 sections in Nebraska, so doing it manually was out of the question. Using Python was the solution.

To do this, I created a da.SearchCursor on the Nebraska section grid which looped through each polygon and used its SHAPE (geometry) field to record the coordinates of each vertex in the polygon. It also recorded the coordinates of each corner for the extent of the polygon.

After finding the coordinates of each vertex, I then found the distance of each vertex from each corner of the polygon extent. This allowed me to find which vertex corresponded to which corner. A little math was then performed to determine the coordinates of each quarter quarter section along the outside of the section grid, as show below.

Quarter Quarter Sides

Next, I created a Polyline geometry object, and had it connect each point to the one directly across from it. An da.InsertCursor was then used to insert each Polyline object into a new polyline feature class.

I then manually used the Split Polygons tool in the Advanced Editing toolbar in ArcMap to split the sections based on the polylines previously created. It was necessary to use an Overflow value of about 30 feet, but this will vary based on the section grid used. This is because if a polygon had more than just one vertex at each corner, there could possibly be a gap between the polylines and the polygon border. After getting the Overflow correct, I was left with exactly what I needed, but I still needed labels.

Part II

I also needed to attribute each quarter quarter section a specific number to be used as a label. The good news is that the numbers were the same for each qq-section.

Quarter Quarter Numbers

While thinking of how to do this, I realized I already had what I needed. I just needed to do a little more math in order to find the centroid of each quarter quarter section. This script was similar to the first one. I used a da.SearchCursor on the SHAPE field to loop through each qq-section and find the coordinates of each corner. From there I was able to find the centroid coordinates for each qq-section. This allowed me to record which label was linked to which quarter quarter section as shown above.

As the centroid was calculated for each qq-section, I also created a Point geometry object for each one. I then used an InsertCursor to insert each point object along with its appropriate label attribute into a new point feature class.

Lastly, I did a spatial join on the newly created point feature class and the previously created qq-section grid. This outputted a new quarter quarter section grid with the appropriate label joined to it.

______________________________________________________________

I decided to get rid of the hardcoding and make these tools available through an ArcMap Toolbox, so others can utilize them. I’ve also made two similar scripts for creating a quarter section grid and labels. If you didn’t notice, the Custom Grid Toolbox is available for download at the top of this page.

I hope someone finds these scripts useful. If there are any questions or problems, please leave a comment and I’ll try to help.

53 thoughts on “Creating a Quarter Quarter Section Grid with Python

  1. This is fantastic! After searching for a long time for a tool to break up sections and finding nothing but disappointment, I found this. This tool does exactly what I was hoping to do and will make it so much easier to find and plot approximate property boundaries. Kudos to you for not only figuring it out, but also posting the code and even the toolbox. The graphical interface makes it remarkably easy. I processed the entire state of Missouri (several million quarter-quarter sections) and it only took a few hours to run.

  2. Hi Ian,

    First off, wow. It looks like you put a lot of time into these tools; thanks a lot! I am currently being faced with a similar task. I need to create 3 lat/long grids with varying resolution: 1/4 degree, 1/20 degree, and 1/100 degree. I have already created just a 1 degree shapefile using the CreateFishnet tool, which I had to do 16 separate times then merge due to the size limit the tool has. I can only imagine how much of a pain it would be to do the same process for the higher res grids. It looks like the quarter tool would be applicable to the 1/4 degree res, but I’m wondering, could we modify the tool to divide each cell into 1/20ths, then 1/100ths? Or possibly make that another variable? Looking at the two create sections python scripts, it doesn’t look like the latter would be a viable option as it stands, but honestly it’s a little bit over my head so I’m not sure I’d know how to modify the code myself. I’m not even sure this is the best way to go about this at all because the number of cells is so large, but maybe you could help me out.

    Thanks a bunch!

    PS: Clicking the link to download the toolbox doesn’t seem to be working, it just opens in the browser…am I missing something?

    1. Hi Maggie,

      The toolbox downloads fine for me. You might try right clicking on the link and doing a Save As or Save Link As.

      As for your question, creating higher resolution grids from the code I posted would definitely be possible. It would just require some more division. Creating a function to do this would be the way to go. I’m not sure if you are creating your lat/long grids based on an existing grid or a feature though. If I find some time, I’ll shoot you an email to get some more information.

      1. Yes duh, that worked, I can’t believe I didn’t try that.

        That would be so helpful! I would need some guidance, but I think it would be useful to do for people who need to split grids into various higher resolutions (I can’t be the only one, right?).

        Anyways, I have a shapefile of lat/long 1 degree, in which each cell is represented as a polygon. (180 * 360 total polygons). I need to split all of the polygons in this shapefile such that each cell is divided into 16ths (so I guess using your quarter quarter script). I’m not sure if this answers your question, but if you get the chance I would love to hear from you.

        Thanks!

      2. Ian,

        Just wanted to let you know that I’m going to go about my task in a different way, so no need to spend time helping me modify the algorithm. I’m sure this tool will still be very useful to me in the future however, and I’m glad to have discovered your webpage! Thanks again for sharing your ideas.

        1. I’m glad you got something figured out! I just want to let you know that I added a new tool to the toolbox called Create Custom Grid and I’ve renamed the toolbox from Section Grid Tools to Custom Grid Tools. The new tool allows you to choose a vertical and horizontal division. So you could create a 1/20 by entering either 5×4 or 4×5 in the tool parameters. I hope you find the tool useful in the future and thank you for your comments and having input on the additional functionality. The new toolbox can be downloaded at the top of this page.

    1. Grant, sorry about that. I updated the scripts recently and forgot to post them again. I’ve added them to the top the page. Thanks for reminding me and I hope you find them useful.

  3. I am having to split STR into QQ as part of an assignment for class, and ran across this website. I guess i’m missing a step or doing something wrong though cause once I get to the point of editing the lines after creating them, using the create QQ sections I get stuck. my advanced edit toolbar will not allow me to click on the split poly tool.

  4. Thanks for creating these scripts. I have a question. I tried running the Create QQ Sections and I get an error saying “The table was not found. [GDB_DataChanges]”. Do you know off hand what the problem is? Thanks for any help you can give.

    1. Hi, Peter! I’m not familiar with that error, and Google didn’t provide much help. Where is your data being stored? File, personal, or SDE geodatabase? You could try exporting the polygon feature class that you’re inputting into the Create QQ Section tool into a new file or personal geodatabase, and run it from there.

      Also, if you want, you can go to the Contact tab at the top of my site and email me the data, and I will try to create the QQ sections. Please let me know if you can’t get it to work. Thanks!

  5. Hey Ian,

    Thank you for making this very useful tool. I really appreciate it. I was quite tired of having to eyeball quarters of quarters, and you’ve made that a thing of the past with your python tool.

    I’m having a little issue with the Q Label maker and I wanted to know if you might have any idea on a fix.

    Here is an image to what my labels look like upon completion.

    http://postimg.org/image/6oogi5rqf/

    Image of the full extent of the map in case it has to do with some of the irregularities.
    http://postimg.org/image/uadmdub5h/

    Geographic Coordinate System: GCS_North_American_1983
    Datum: D_North_American_1983

    I’m a little new to GIS, so I’m sure what specifications will help you.

    Anyways, if you can help I appreciate it. If not, you’ve already given me a great tool.

    Thanks Ian.

  6. Ian…great tool. I’m tasked with using survey-grade section polygons to sub-divide into both quarters, and quarter-quarters. I wanted to test your tool but need a little assistance with the parameter allocations. Also, I am trying it out on (1) section poly…will it still work? Is there any specific edits to the script needed? Thanks for any help.

  7. Hi Ian,

    I love your tool. I’m wondering if you can explain how the ‘Create QQ Sections’ lines created for subdividing get shifted as their lenght changes.
    Example: If the Overflow is set to 0 the first run and than the overflow is set to 50ft on the second running, The line will shift several degrees on an axis point rather than just extending off the current line.

    I hope this question makes sense. I appreciate your time and your tool. I love it.

    R,
    Chris

    1. Hey Chris- this was due to me being on a deadline when I first created the tool. The way I did it was not the best, but it worked for me at the time. I simply added the Overflow value to the XY values of the points, which is not the correct way to do it. It’s always bugged me, and I’ve finally taken the time to fix this problem. Thanks for the comment!

  8. Hey Ian,

    Thanks so much for the toolbox and scripts. The toolbox works perfectly for me, but I’m wanting to use python scripts to run the function (for the sake of creating a more documented, reproducible process). I’m using CreateQSections.py, and I’m having trouble understanding how the inputs/outputs are structured, especially with the use of arcpy.GetParameterAsText(). Any help would be greatly appreciated.

    Matt

  9. Hi Ian, This sounds like a great tool, however, I’ve downloaded the CustomGridTools and when attempting to use the CreateQQSections the Input and Outputs are different than the video and the generated lines are not closed as they should be by the inputed poly sections; any chance you have an update toolbox?

    1. Hey Jerry- I’ve just updated the video. I’ve been meaning to update it for awhile, but couldn’t find time. Hopefully it makes more sense! I’ve also updated the toolbox, so you’ll need to download the new one. Let me know if you have any problems!

  10. Great tool. However, I am having difficulties trying to get the quarter labels to work.

    Most of the Gridlabels are null, though some are populated. And those that are populated are done correctly too. It is maybe 75% null. Running the script produced no errors. Also, I am working from a gdb on 10.3.

    I am really scratching my head here.

  11. Hi Ian, thank you so much for this tools ,it is very useful . the tools do not working on ARCGIS ! I have ARCGIS 10 . how can I download tools ? how can I make it working ?
    I looking forward to your reply
    thanks again

  12. dear Ian ,
    thanks for reply , is there any solution for this problem ? I think you can find solution , you are smart .
    I need ask you about fishnet tool . how can I make grid polygon by fishnet with GCS(Decimal Degrees)? as you know that tool working with UTM (Meters).
    do you have facebook ?
    warm regard

  13. Wow. Man that toolbox helped me a LOT. I had a Texas OTLS (original Texas Land Survey) grid which is not 640-acre sections in MOST places (but in my area, it is) and there was no “ladesc” (or “quarter-quarter”) grid like there is for most of the rest of the USA. I needed something to snap to when creating polygons for oil and gas leases covering, for instance, the NENW or the N2SE and these tools worked brilliantly! Thanks again and Cheers!

    1. Hi Daniel, thanks for the nice comment, and I’m glad you’re finding the tools useful! It sounds like they’d work great for what you’re using them for. Take care!

  14. This tool is amazing! Unfortunately, I only have an ArcDesktop Basic License, so am unable to use the split polygons tool. Do you have any ideas for a workaround to this issue?

  15. This has been a life saver! Thanks so much for making the tool and video! One question, would you know why some quarter section labels don’t label? I have three quarter sections out of ~530 that didn’t want to label and I can’t figure out why. Thanks again!

  16. Ian,

    Let me just reiterate the “thanks” that many other folks are offering. Great tool that does exactly what I was hoping it would do. I’m working in a section of Illinois and have been unable to locate any quarter sections for this state. Now, I am able to plot some line work as outlined on a deed that I’m using.

    Excellent work, Ian.

  17. This is awesome! It worked like a charm! You are amazing for making these tools available!!
    I’m digitizing historical land records (using PLSS cadastral descriptions) as part of a historical archaeology project, and being able to snap my polygons to my new quarter-quarter grid will save me SO MUCH time!!

  18. Good afternoon Ian. I am attempting to split polygons with the tool in advanced editing, however, this operation fails. The message delivered says “Ensure the selected features form continuous rings and overlap the polygons. I have attempted to create quarter section lines with 0 overflow and 800 overflow with my parameter, but without luck.

  19. Hi Ian,
    This tool is brilliant and I found your tool and I am using it to create a custom quarter section grid. When I used the Create Q Labels tool setup as default the quarter labels only returned N, N, S, S not NW, NE, SE, SW. Any idea why that would occur?
    thank for your help,
    Nate

Leave a Reply