Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolejeansmith committed Feb 9, 2022
2 parents 560947c + c11877f commit a7b5970
Show file tree
Hide file tree
Showing 228 changed files with 7,786 additions and 692 deletions.
Binary file modified TestData_0411.gdb/a00000001.TablesByName.atx
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000001.freelist
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000001.gdbtable
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000001.gdbtablx
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000003.gdbtable
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000003.gdbtablx
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000004.CatItemsByPhysicalName.atx
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000004.CatItemsByType.atx
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000004.FDO_UUID.atx
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000004.freelist
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000004.gdbtable
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000004.gdbtablx
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000004.spx
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000006.CatRelsByDestinationID.atx
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000006.CatRelsByOriginID.atx
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000006.CatRelsByType.atx
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000006.FDO_UUID.atx
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000006.freelist
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000006.gdbtable
Binary file not shown.
Binary file modified TestData_0411.gdb/a00000006.gdbtablx
Binary file not shown.
Binary file not shown.
Binary file modified TestData_0411.gdb/a0000000e.gdbindexes
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000020.freelist
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000020.gdbtable
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000027.gdbtable
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000027.gdbtablx
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000027.spx
Binary file not shown.
Binary file removed TestData_0411.gdb/a0000002d.G95Permanent_Ide.atx
Binary file not shown.
Binary file removed TestData_0411.gdb/a0000002d.I95ReachCode.atx
Binary file not shown.
Binary file removed TestData_0411.gdb/a0000002d.gdbindexes
Binary file not shown.
Binary file removed TestData_0411.gdb/a0000002d.gdbtablx
Binary file not shown.
Binary file removed TestData_0411.gdb/a0000002d.spx
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000030.G98Permanent_Ide.atx
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000030.gdbindexes
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000030.gdbtablx
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000030.spx
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000034.gdbtable
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000034.gdbtablx
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000034.spx
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000036.N_1_Desc_0.atx
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000036.gdbtable
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000037.gdbtable
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000039.gdbtable
Binary file not shown.
Binary file removed TestData_0411.gdb/a0000003b.gdbtable
Binary file not shown.
Binary file removed TestData_0411.gdb/a0000003c.gdbtable
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000067.gdbindexes
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000067.gdbtable
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000067.gdbtablx
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000067.spx
Binary file not shown.
Binary file removed TestData_0411.gdb/a0000006b.gdbtable
Binary file not shown.
Binary file removed TestData_0411.gdb/a0000006b.gdbtablx
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000088.gdbindexes
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000088.gdbtable
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000088.gdbtablx
Binary file not shown.
Binary file removed TestData_0411.gdb/a00000088.spx
Binary file not shown.
File renamed without changes.
Binary file added TestData_0411.gdb/a00000089.gdbtable
Binary file not shown.
Binary file added TestData_0411.gdb/a00000089.gdbtablx
Binary file not shown.
Binary file added TestData_0411.gdb/a00000089.spx
Binary file not shown.
File renamed without changes.
Binary file added TestData_0411.gdb/a0000008a.gdbtable
Binary file not shown.
Binary file added TestData_0411.gdb/a0000008a.gdbtablx
Binary file not shown.
Binary file added TestData_0411.gdb/a0000008a.spx
Binary file not shown.
Binary file not shown.
Binary file added TestData_0411.gdb/a0000008c.SourceFC.atx
Binary file not shown.
Binary file added TestData_0411.gdb/a0000008c.freelist
Binary file not shown.
Binary file added TestData_0411.gdb/a0000008c.gdbindexes
Binary file not shown.
Binary file added TestData_0411.gdb/a0000008c.gdbtable
Binary file not shown.
Binary file added TestData_0411.gdb/a0000008c.gdbtablx
Binary file not shown.
Binary file added TestData_0411.gdb/a0000008c.spx
Binary file not shown.
File renamed without changes.
Binary file added TestData_0411.gdb/a00000090.gdbtable
Binary file not shown.
Binary file added TestData_0411.gdb/a00000090.gdbtablx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added TestData_0411.gdb/a00000093.gdbindexes
Binary file not shown.
Binary file added TestData_0411.gdb/a00000093.gdbtable
Binary file not shown.
Binary file added TestData_0411.gdb/a00000093.gdbtablx
Binary file not shown.
Binary file added TestData_0411.gdb/a00000093.spx
Binary file not shown.
Binary file added TestData_0411.gdb/a00000094.G212GNIS_ID.atx
Binary file not shown.
Binary file added TestData_0411.gdb/a00000094.G212Permanent_Id.atx
Binary file not shown.
Binary file added TestData_0411.gdb/a00000094.G212ReachCode.atx
Binary file not shown.
Binary file added TestData_0411.gdb/a00000094.G212WBArea_Perma.atx
Binary file not shown.
Binary file added TestData_0411.gdb/a00000094.gdbindexes
Binary file not shown.
Binary file not shown.
Binary file added TestData_0411.gdb/a00000094.gdbtablx
Binary file not shown.
Binary file added TestData_0411.gdb/a00000094.spx
Binary file not shown.
Binary file added TestData_0411.gdb/a00000095.G213GNIS_ID.atx
Binary file not shown.
Binary file not shown.
Binary file added TestData_0411.gdb/a00000095.gdbindexes
Binary file not shown.
Binary file added TestData_0411.gdb/a00000095.gdbtable
Binary file not shown.
Binary file added TestData_0411.gdb/a00000095.gdbtablx
Binary file not shown.
Binary file added TestData_0411.gdb/a00000095.spx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added TestData_0411.gdb/a00000096.G214ReachCode.atx
Binary file not shown.
Binary file added TestData_0411.gdb/a00000096.gdbindexes
Binary file not shown.
Binary file added TestData_0411.gdb/a00000096.gdbtable
Binary file not shown.
Binary file not shown.
Binary file added TestData_0411.gdb/a00000096.spx
Binary file not shown.
Binary file not shown.
Binary file added TestData_0411.gdb/a00000097.G215Permanent_Id.atx
Binary file not shown.
Binary file added TestData_0411.gdb/a00000097.G215ReachCode.atx
Binary file not shown.
Binary file added TestData_0411.gdb/a00000097.gdbindexes
Binary file not shown.
Binary file not shown.
Binary file added TestData_0411.gdb/a00000097.gdbtablx
Binary file not shown.
Binary file added TestData_0411.gdb/a00000097.spx
Binary file not shown.
File renamed without changes.
Binary file added TestData_0411.gdb/a00000098.gdbtable
Binary file not shown.
Binary file added TestData_0411.gdb/a00000098.gdbtablx
Binary file not shown.
Binary file added TestData_0411.gdb/a00000098.spx
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file added TestData_0411.gdb/a0000009a.N_1_Desc_0.atx
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file added TestData_0411.gdb/a0000009a.gdbtable
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file added TestData_0411.gdb/a0000009b.gdbtable
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added TestData_0411.gdb/a0000009d.gdbtable
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added TestData_0411.gdb/a0000009f.gdbtable
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added TestData_0411.gdb/a000000a0.gdbtable
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file added TestData_0411.gdb/a000000a3.gdbindexes
Binary file not shown.
Binary file added TestData_0411.gdb/a000000a3.gdbtable
Binary file not shown.
Binary file added TestData_0411.gdb/a000000a3.gdbtablx
Binary file not shown.
Binary file added TestData_0411.gdb/a000000a4.gdbindexes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added TestData_0411.gdb/a000000a4.spx
Binary file not shown.
File renamed without changes.
Binary file added TestData_0411.gdb/a000000a5.gdbtable
Binary file not shown.
Binary file added TestData_0411.gdb/a000000a5.gdbtablx
Binary file not shown.
Binary file added TestData_0411.gdb/a000000a5.spx
Binary file not shown.
Binary file added TestData_0411.gdb/a000000a6.gdbindexes
Binary file not shown.
Binary file added TestData_0411.gdb/a000000a6.gdbtable
Binary file not shown.
Binary file added TestData_0411.gdb/a000000a6.gdbtablx
Binary file not shown.
Binary file added TestData_0411.gdb/a000000a6.spx
Binary file not shown.
Binary file modified TestData_0411.gdb/timestamps
Binary file not shown.
6,897 changes: 6,897 additions & 0 deletions geo_job_control.csv

Large diffs are not rendered by default.

Binary file modified lagosGIS/LAGOS_GIS_Toolbox.tbx
Binary file not shown.
4 changes: 2 additions & 2 deletions lagosGIS/NHDNetwork.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# filename: NHDNetwork.py
# author: Nicole J Smith
# version: 2.0 Beta
# version: 2.0
# LAGOS module(s): LOCUS
# tool type: re-usable (NOT IN ArcGIS Toolbox)

Expand Down Expand Up @@ -108,7 +108,7 @@ def __init__(self, nhd_gdb):
# the following should have no effect on other users besides LAGOS use,
# but will be used to modify .define_lakes so that it includes any permanent_id
# found in the LAGOS population, regardless of its size or FType in NHDPlus Plus HR
self.lagos_pop_path = r'D:\Continental_Limnology\Data_Working\LAGOS_US_GIS_Data_v0.8.gdb\Lakes\LAGOS_US_All_Lakes_1ha'
self.lagos_pop_path = r'F:\Continental_Limnology\Data_Working\LAGOS_US_GIS_Data_v0.9.gdb\Lakes\LAGOS_US_All_Lakes_1ha'

# ---UTILITIES FOR HIGHER METHODS-----------------------------------------------------------------------------------
def prepare_upstream(self, force_refresh=False):
Expand Down
20 changes: 5 additions & 15 deletions lagosGIS/NHD_merge_utility.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
#-------------------------------------------------------------------------------
# Name: NHD_merge_utility
# Purpose: Merges features from pre-staged NHD subregion downloads, deletes ID
# duplicates by saving only the one with the latest FDate, and deletes geographic
# duplicates (different IDs) by saving the one with the latest FDate).
#
# Requirements: 1) nhdDir = Directory containing all the NHD subregions you want to merge
# 2) fcName = Feature class name for features you want to merge
# 3) outputDir = Output directory
#
# Author: nicolejeansmith
#
# Created: 2016-12-20

#-------------------------------------------------------------------------------
# filename: NHD_merge_utility.py
# author: Nicole J Smith
# version: 2.0
# LAGOS module(s): LOCUS, GEO
# tool type: re-usable (ArcGIS Toolbox)

# Merge any of the NHD-based layers into a seamless layer and apply a selection if desired
# do not delete any duplicates
Expand Down
6 changes: 4 additions & 2 deletions lagosGIS/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
"zonal_summary_of_classed_polygons",
"point_attribution_of_raster_data",
"summarize_raster_for_all_zones",
"preprocess_padus",

"spatialize_lakes",
"georeference_lakes",

"export_to_csv",
"zone_prep"
"spatial_divisions_processing"
]

import os
Expand All @@ -47,6 +48,7 @@
from rasterize_zones import rasterize as rasterize_zones
from zonal_summary_of_raster_data import calc as zonal_summary_of_raster_data
from summarize_raster_for_all_zones import summarize as summarize_raster_for_all_zones
from preprocess_padus import preprocess as preprocess_padus

from zonal_summary_of_classed_polygons import summarize as zonal_summary_of_classed_polygons
from point_attribution_of_raster_data import attribution as point_attribution_of_raster_data
Expand All @@ -55,7 +57,7 @@
from georeference import georeference_lakes

from export_to_csv import export as export_to_csv
import zone_prep
import spatial_divisions_processing


LAGOS_FCODE_LIST = (39000,39004,39009,39010,39011,39012,43600,43613,43615,43617,43618,43619,43621)
Expand Down
6 changes: 6 additions & 0 deletions lagosGIS/calc_glaciation.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# filename: calc_glaciation.py
# author: Nicole J Smith
# version: 2.0
# LAGOS module(s): LOCUS, GEO
# tool type: re-usable (NOT in ArcGIS Toolbox)

import os

import arcpy
Expand Down
6 changes: 6 additions & 0 deletions lagosGIS/calc_relief_ratio.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# filename: calc_relief_ratio.py
# author: Nicole J Smith
# version: 2.0
# LAGOS module(s): GEO
# tool type: re-usable (NOT in ArcGIS Toolbox)

import os
import arcpy

Expand Down
2 changes: 1 addition & 1 deletion lagosGIS/deprecated/burn_dems.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# filename: burn_dems.py
# author: Scott Stopyak, Nicole J Smith
# version: 2.0 Beta
# version: 2.0
# LAGOS module(s): LOCUS
# tool type: re-usable (ArcGIS Toolbox)

Expand Down
2 changes: 1 addition & 1 deletion lagosGIS/deprecated/lake_from_to.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# filename: lake_from_to.py
# author: Nicole J Smith
# version: 2.0 Beta
# version: 2.0
# LAGOS module(s): CONN
# tool type: re-usable (not ArcGIS Toolbox)
# status: This code was a PROTOTYPE and was replaced with alternate Python code for the CONN database. It produces
Expand Down
2 changes: 1 addition & 1 deletion lagosGIS/deprecated/make_catseed.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# filename: make_catseed.py
# author: Scott Stopyak, Nicole J Smith
# version: 2.0 Beta
# version: 2.0
# LAGOS module(s): LOCUS
# tool type: re-usable (ArcGIS Toolbox)

Expand Down
2 changes: 1 addition & 1 deletion lagosGIS/deprecated/make_gridcode.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# filename: make_gridcode.py
# author: Nicole J Smith
# version: 2.0 Beta
# version: 2.0
# LAGOS module(s): LOCUS
# tool type: re-usable (ArcGIS Toolbox)

Expand Down
2 changes: 1 addition & 1 deletion lagosGIS/deprecated/mosaic_dems.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# filename: mosaic_dems.py
# author: Ed Bissell, Nicole J Smith
# version: 2.0 Beta
# version: 2.0
# LAGOS module(s): LOCUS
# tool type: re-usable (ArcGIS Toolbox)
# purpose: The purpose of this script is to create a directory of NED tiles for a NHD subregion and
Expand Down
2 changes: 1 addition & 1 deletion lagosGIS/deprecated/watersheds_toolchain.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# filename: watersheds_toolchain.py
# author: Nicole J Smith
# version: 2.0 Beta
# version: 2.0
# LAGOS module(s): LOCUS
# tool type: code journal (no ArcGIS Toolbox, workstation-specific paths)
# purpose: This code was used to string together the watersheds tools in the correct order for LAGOS, as well as
Expand Down
4 changes: 2 additions & 2 deletions lagosGIS/export_gis_and_info_tables.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# filename: export_gis_and_info_tables.py
# author: Nicole J Smith
# version: 2.0 Beta
# LAGOS module(s): LOCUS
# version: 2.0
# LAGOS module(s): LOCUS, GEO
# tool type: code journal, internal use only

import os
Expand Down
2 changes: 1 addition & 1 deletion lagosGIS/export_to_csv.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# filename: export_to_csv.py
# author: Nicole J Smith
# version: 2.0 Beta
# version: 2.0
# LAGOS module(s): LOCUS, GEO, CONN
# tool type: re-usable (ArcGIS Toolbox)

Expand Down
3 changes: 1 addition & 2 deletions lagosGIS/flatten_overlapping_zones.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# filename: flatten_overlapping_zones.py
# author: Nicole J Smith
# version: 2.0 Beta
# version: 2.0
# LAGOS module(s): GEO
# tool type: re-usable (ArcGIS Toolbox)
# status: working, tested in Beta

import os
import arcpy
Expand Down
2 changes: 1 addition & 1 deletion lagosGIS/georeference.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# filename: georeference.py
# author: Nicole J Smith
# version: 2.0 Beta
# version: 2.0
# LAGOS module(s): LIMNO
# tool type: limited re-usability as code (change constants by hand for your computer)

Expand Down
2 changes: 1 addition & 1 deletion lagosGIS/lake_connectivity_classification.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# filename: lake_connectivity_classification.py
# author: Nicole J Smith
# version: 2.0 Beta
# version: 2.0
# LAGOS module(s): LOCUS
# tool type: re-usable (ArcGIS Toolbox)

Expand Down
8 changes: 6 additions & 2 deletions lagosGIS/lake_density.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Lakes in Zones, the new one
# this does all the lake stuff at once for a given extent
# filename: lake_density.py
# author: Nicole J Smith
# version: 2.0
# LAGOS module(s): GEO
# tool type: re-usable (ArcGIS Toolbox)

import os
import arcpy
import polygon_density_in_zones
Expand Down
2 changes: 1 addition & 1 deletion lagosGIS/lake_processing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# filename: lake_processing.py
# author: Nicole J Smith
# version: 2.0 Beta
# version: 2.0
# LAGOS module(s): LOCUS, GEO
# tool type: code journal (no ArcGIS Toolbox)

Expand Down
6 changes: 6 additions & 0 deletions lagosGIS/line_density_in_zones.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# filename: line_density_in_zones.py
# author: Nicole J Smith
# version: 2.0
# LAGOS module(s): GEO
# tool type: re-usable (ArcGIS Toolbox)

import os
import arcpy
import lagosGIS
Expand Down
2 changes: 1 addition & 1 deletion lagosGIS/locate_lake_inlets.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# filename: locate_lake_inlets.py
# author: Nicole J Smith
# version: 2.0 Beta
# version: 2.0
# LAGOS module(s): CONN
# tool type: re-usable (not in ArcGIS Toolbox)

Expand Down
2 changes: 1 addition & 1 deletion lagosGIS/locate_lake_outlets.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# filename: locate_lake_outlets.py
# author: Nicole J Smith
# version: 2.0 Beta
# version: 2.0
# LAGOS module(s): CONN
# tool type: re-usable (ArcGIS Toolbox)

Expand Down
2 changes: 1 addition & 1 deletion lagosGIS/merge_subregion_outputs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# filename: merge_subregion_outputs.py
# author: Nicole J Smith
# version: 2.0 Beta
# version: 2.0
# LAGOS module(s): LOCUS
# tool type: re-usable (not in ArcGIS Toolbox)
# purpose: These functions assist with merging and deduplicating GIS outputs for analyses that had to be run at the
Expand Down
7 changes: 6 additions & 1 deletion lagosGIS/mosaic_dem_and_tri.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# filename: mosaic_dem_and_tri.py
# author: Nicole J Smith
# version: 2.0
# LAGOS module(s): GEO
# tool type: code journal, modify paths by hand

import os
import re
import subprocess
import zipfile
import arcpy
Expand Down
2 changes: 1 addition & 1 deletion lagosGIS/nhd_merge_helpers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# filename: nhd_merge_helpers.py
# author: Nicole J Smith
# version: 2.0 Beta
# version: 2.0
# LAGOS module(s): LOCUS
# tool type: re-usable (NO ArcGIS Toolbox)

Expand Down
6 changes: 6 additions & 0 deletions lagosGIS/point_attribution_of_raster_data.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# filename: point_attribution_of_raster_data.py
# author: Nicole J Smith
# version: 2.0
# LAGOS module(s): GEO
# tool type: re-usable (ArcGIS Toolbox)

import arcpy
import lagosGIS

Expand Down
8 changes: 6 additions & 2 deletions lagosGIS/point_density_in_zones.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Filename: PointDensityInPolygon.py
# Purpose: Gives the density of points in polygons by point/hectare and point/sqkm.
# filename: point_density_in_zones.py
# author: Nicole J Smith
# version: 2.0
# LAGOS module(s): GEO
# tool type: re-usable (ArcGIS Toolbox)

import os
import arcpy

Expand Down
19 changes: 6 additions & 13 deletions lagosGIS/polygon_density_in_zones.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: smithn78
#
# Created: 21/05/2014
# Copyright: (c) smithn78 2014
# Licence: <your licence>
#-------------------------------------------------------------------------------
# filename: polygon_density_in_zones.py
# author: Nicole J Smith
# version: 2.0
# LAGOS module(s): GEO
# tool type: re-usable (ArcGIS Toolbox)

import arcpy


Expand All @@ -25,7 +21,6 @@ def calc(zone_fc, zone_field, polygons_of_interest, output_table, interest_selec
if arcpy.Exists(selected_polys):
arcpy.env.overwriteOutput = True

arcpy.AddMessage('Copying/selecting polygon features...')
if interest_selection_expr:
arcpy.Select_analysis(polygons_of_interest, selected_polys, interest_selection_expr)
else:
Expand Down Expand Up @@ -66,7 +61,6 @@ def calc(zone_fc, zone_field, polygons_of_interest, output_table, interest_selec
arcpy.AddField_management(spjoin_fc, 'Poly_nperha', 'DOUBLE')
arcpy.CalculateField_management(spjoin_fc, 'Poly_nperha', '!Poly_n!/!shape.area@hectares!', 'PYTHON')

arcpy.AddMessage('Refining output...')
arcpy.JoinField_management(tab_table, zone_field, spjoin_fc, zone_field, ["Poly_n", 'Poly_nperha'])
final_fields = ['Poly_ha', 'Poly_pct', 'Poly_n', 'Poly_nperha']

Expand All @@ -82,7 +76,6 @@ def calc(zone_fc, zone_field, polygons_of_interest, output_table, interest_selec
arcpy.Delete_management(item)
arcpy.env.workspace = old_workspace

arcpy.AddMessage('Polygons in zones tool complete.')
arcpy.SetLogHistory(True)

def main():
Expand Down
22 changes: 13 additions & 9 deletions lagosGIS/preprocess_padus.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import os
# filename: preprocess_padus.py
# author: Nicole J Smith
# version: 2.0
# LAGOS module(s): GEO
# tool type: re-usable (ArcGIS Toolbox)


import time
import arcpy
from arcpy import management as DM
from lagosGIS import select_fields
import lagosGIS


def preprocess(padus_combined_fc, output_fc):
Expand All @@ -11,7 +17,7 @@ def preprocess(padus_combined_fc, output_fc):
protection types. This tool "flattens" the PADUS2_0Combined_Marined_Fee_Designation_Easement dataset so that the
Own_Type, GAP_Sts, and IUCN_Cat fields are values are retained, renamed, and filtered for one primary value per
region according to the following rules:
Own_Type -> "agency". "Fee" type > "Easement" > "Marine" > "Designation
Own_Type -> "agency" variable in LAGOS-US. Rule is FeatClass "Fee" > "Easement" > "Marine" > "Designation"
GAP_Sts -> "gap" . Highest GAP status preferentially retained.
IUCN_Cat -> "iucn". Lowest number codes preferentially retained, then "Other", last "Unassigned".
:param padus_combined_fc:
Expand All @@ -24,8 +30,7 @@ def preprocess(padus_combined_fc, output_fc):
# Prep: Select only the fields needed, remove curves (densify) which prevents problems with geometry
# that prevents DeleteIdentical based on Shape
padus_fields = ['FeatClass', 'Own_Type', 'GAP_Sts', 'IUCN_Cat']
arcpy.AddMessage('{} select...'.format(time.ctime()))
padus_select = select_fields(padus_combined_fc, 'padus_select', padus_fields, convert_to_table=False)
padus_select = lagosGIS.select_fields(padus_combined_fc, 'padus_select', padus_fields, convert_to_table=False)
arcpy.Densify_edit(padus_select, 'OFFSET', max_deviation = '1 Meters')
arcpy.AddMessage('{} union...'.format(time.ctime()))

Expand Down Expand Up @@ -60,7 +65,6 @@ def preprocess(padus_combined_fc, output_fc):
'Other Conservation Area': 8,
'Unassigned': 9}

arcpy.AddMessage('{} calculate...'.format(time.ctime()))
with arcpy.da.UpdateCursor(union, cursor_fields) as cursor:
for row in cursor:
id1, id2, fc1, fc2, gap1, gap2, iucn1, iucn2, own1, own2, agency, gap, iucn, flag, areacalc, areashp = row
Expand Down Expand Up @@ -97,13 +101,13 @@ def preprocess(padus_combined_fc, output_fc):

# Sort so that merged polygons are retained in DeleteIdentical, and delete identical shapes to end
# up with just the merged polygons and non-overlapping polygons
arcpy.AddMessage('{} sort...'.format(time.ctime()))
arcpy.AddMessage('{} sort...'.format(time.ctime()))
sorted_fc = DM.Sort(large_enough, 'sorted_fc', [['merge_flag', 'DESCENDING']])

arcpy.AddMessage('{} delete identical shape...'.format(time.ctime()))
arcpy.AddMessage('{} delete identical shape...'.format(time.ctime()))
DM.DeleteIdentical(sorted_fc, "Shape")
output_fields = [fid1, fid2] + new_fields
output_fc = select_fields(sorted_fc, output_fc, output_fields)
output_fc = lagosGIS.select_fields(sorted_fc, output_fc, output_fields)

# cleanup
for item in [padus_select, union, sorted_fc, large_enough]:
Expand Down
6 changes: 6 additions & 0 deletions lagosGIS/rasterize_zones.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# filename: rasterize_zones.py
# author: Nicole J Smith
# version: 2.0
# LAGOS module(s): GEO
# tool type: re-usable (ArcGIS Toolbox)

# Converts multiple polygon feature classes to "zone" rasters using a common grid
import math
import os
Expand Down
Loading

0 comments on commit a7b5970

Please sign in to comment.