FireSTARR
Loading...
Searching...
No Matches
gis Namespace Reference

Classes

class  Extent
 

Functions

 gdf_from_file (filename, *args, **kwargs)
 
 ensure_geometry_file (path)
 
 load_geometry_file (path)
 
 GetFeatureCount (shp)
 ` Count number of features in a shapefile
 
 FromEPSG (epsg)
 Load spatial reference from epsg value.
 
 Delete (shp)
 Delete the given shapefile.
 
 GetSpatialReference (src)
 Determine spatial reference from a source file.
 
 Project (src, outputShapefile, outSpatialRef)
 Project to given spatial reference.
 
 GetCellSize (raster)
 Determine cell size for a raster and ensure pixels are square.
 
 Rasterize (file_lyr, raster, reference, datatype=gdal.GDT_Byte, creation_options=CREATION_OPTIONS)
 Convert a shapefile into a raster with the given spatial reference.
 
 save_point_file (latitude, longitude, out_dir, name)
 Save a file with a single point having the given coordinates.
 
 sum_raster (raster, band_number=1)
 Sum the value of all cells in a raster.
 
 find_raster_meridians (year=None)
 Find the meridians of input rasters for the given year.
 
 find_best_raster (lon, year=None, only_int_zones=False)
 Find the raster with the closest meridian.
 
 project_raster (filename, output_raster=None, outputBounds=None, nodata=0, options=["COMPRESS=LZW", "TILED=YES"], crs="EPSG:4326", resolution=None, format=None)
 
 save_geojson (df, path)
 
 vector_path (dir, base)
 
 gdf_to_file (df, dir, base=None)
 
 to_gdf (df, crs=CRS_WGS84)
 
 make_point (lat, lon, crs=CRS_WGS84)
 
 find_closest (df, lat, lon, crs=CRS_COMPARISON, fill_missing=False)
 
 area_ha (df)
 
 area_ha_to_radius_m (a)
 
 make_empty_gdf (columns, crs=CRS_WGS84)
 
 make_gdf_from_series (row, crs)
 
 with_gdal_exceptions_off (fct, *args, **kwargs)
 
 is_invalid_tiff (path, bands=[1], test_read=False)
 
 find_invalid_tiffs (paths, bands=[1], test_read=False)
 

Variables

int KM_TO_M = 1000
 
int HA_TO_MSQ = 10000
 
int CRS_LAMBERT_STATSCAN = 3347
 
int CRS_WGS84 = 4326
 
int CRS_LAMBERT_ATLAS = 3978
 
int CRS_COMPARISON = CRS_LAMBERT_ATLAS
 
int CRS_NAD83 = 4269
 
int CRS_SIMINPUT = CRS_NAD83
 
list VALID_GEOMETRY_EXTENSIONS = [f".{x}" for x in sorted(fiona.drvsupport.vector_driver_extensions().keys())]
 
str VECTOR_FILE_EXTENSION = "gpkg"
 
 MERIDIANS = None
 
 LOCK_GDAL_EXCEPTIONS = Lock()
 

Detailed Description

Non-ArcGIS GIS utility code

Function Documentation

◆ Delete()

gis.Delete ( shp)

Delete the given shapefile.

Parameters
shpShapefile to delete
Returns
None

◆ ensure_geometry_file()

gis.ensure_geometry_file ( path)
Derive a single geometry file from given path, downloading and/or
extracting as necessary
Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_best_raster()

gis.find_best_raster ( lon,
year = None,
only_int_zones = False )

Find the raster with the closest meridian.

Parameters
lonLongitude to look for closest raster for
yearYear to find raster for
Returns
Raster with the closest meridian to the desired longitude

◆ find_raster_meridians()

gis.find_raster_meridians ( year = None)

Find the meridians of input rasters for the given year.

Parameters
yearYear to find raster meridians for
Returns
Dictionary of meridians to raster with each meridian

◆ FromEPSG()

gis.FromEPSG ( epsg)

Load spatial reference from epsg value.

Parameters
epsgCode for spatial reference to load
Returns
Spatial reference for given code

◆ GetCellSize()

gis.GetCellSize ( raster)

Determine cell size for a raster and ensure pixels are square.

Parameters
rasterRaster to get cell size from
Returns
Cell size for raster (m)

◆ GetFeatureCount()

gis.GetFeatureCount ( shp)

` Count number of features in a shapefile

Parameters
shpShapefile to count features from
Returns
Number of features in shapefile, or -1 on failure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSpatialReference()

gis.GetSpatialReference ( src)

Determine spatial reference from a source file.

Parameters
srcSource file to determine spatial reference of
Returns
Spatial reference of source file

◆ make_gdf_from_series()

gis.make_gdf_from_series ( row,
crs )
Convert Series into GeoDataFrame

◆ Project()

gis.Project ( src,
outputShapefile,
outSpatialRef )

Project to given spatial reference.

Parameters
srcFile to project
outputShapefileDestination file to save projection to
outSpatialRefSpatial reference to project into
Returns
None

◆ Rasterize()

gis.Rasterize ( file_lyr,
raster,
reference,
datatype = gdal.GDT_Byte,
creation_options = CREATION_OPTIONS )

Convert a shapefile into a raster with the given spatial reference.

autotoc_md3

Parameters
shpShapefile to convert to raster
rasterRaster file path to save result to
referenceReference raster to use for extents and alignment
Returns
None

◆ save_point_file()

gis.save_point_file ( latitude,
longitude,
out_dir,
name )

Save a file with a single point having the given coordinates.

Parameters
latitudeLatitude to use for point
longitudeLongitude to use for point
out_dirDirectory to save shapefile to
nameName of point within file, and file to save to
Returns
None

◆ sum_raster()

gis.sum_raster ( raster,
band_number = 1 )

Sum the value of all cells in a raster.

Parameters
rasterRaster to sum values for
band_numberNumber of band to sum values of
Returns
Result of summing raster