-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
95 changed files
with
1,140 additions
and
1,035 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,55 @@ | ||
# rsgis-toolbox | ||
# geo-bhumi | ||
|
||
Geospatial utilities for Remote Sensing and GIS application. | ||
|
||
# Description | ||
Geospatial Utilities for Remote Sensing and GIS Application. | ||
|
||
This repository has several scripts written in Python for Remote Sensing and GIS data analysis and workflow automation. This is an early development toolset, and is suitable for geospatial data analysis. Features and implementation are subject to change. | ||
|
||
# Introduction | ||
|
||
The `geo-bhumi` Python package aims to simplify geospatial tasks and automate geospatial application development. This library provides a comprehensive set of tools for Remote Sensing and GIS. By addressing the gaps in geospatial data processing tools and offering automation capabilities, this package proves to be an essential resource. Many of the tools are derived from scientific research articles, while others consist of efficient algorithms that enable streamlined processing with minimal code. With these tools, users or researchers can focus on analyzing their application results rather than spending time on coding or starting from scratch. | ||
|
||
# Features | ||
|
||
### Raster Functionalities | ||
|
||
| Functions or Classes | Descriptions | | ||
| :------------------------------------- | :---------------------------------------------- | | ||
| clip_raster_by_extent() | Clip Raster by Extent | | ||
| raster_to_point() | Convert Rater Pixel to Point Shapefile | | ||
| dn_to_radiance() | Convert Pixel DN Values to Radiance | | ||
| extract_lulc_class() | Export Individual LULC Class | | ||
| get_border_pixel_values() | Extract Border Pixel Values | | ||
| group_raster_pixels() | Group Homogeneous Pixel Values | | ||
| find_sinknflat_dem() | Identify Sink/Flat Pixels in DEM | | ||
| radiance2degree_celsious_temperature() | Convert Radiance to Degree-Celsious Temperature | | ||
| regular_shift_raster() | Shift Raster in Different Direction | | ||
| mosaic_raster() | Mosaic GeoTIFF Tiles | | ||
|
||
### Vector Functionalities | ||
|
||
| Functions or Classes | Descriptions | | ||
| :----------------------------- | :------------------------------------------------- | | ||
| get_cumulative_drainage_area() | Calculate Cumulative Drainage Area | | ||
| generate_river_xscl() | Create Cross-Section Line of River | | ||
| generate_grid_boundary() | Generate Grid Boundary from Point | | ||
| get_nearest_point() | Find Closest Point | | ||
| LineDirectionError() | Check River Network's Line Direction | | ||
| GenerateHydroID() | Generate HydroID of River Network | | ||
| CreateGroupID() | Generate GroupID of River Network | | ||
| CreateObjectID() | Generate ObjectID of River Network | | ||
| FnTnodeID() | Generate From-Node and To-Node ID of River Network | | ||
| wkt_to_gdf() | Convert WKT to Geo-DataFrame | | ||
| extract_overlap_polygon() | Extract Overlap Polygon Geometry | | ||
| merge_shapefiles() | Merge Vector Files | | ||
|
||
### Tools for Application | ||
|
||
| Functions or Classes | Descriptions | | ||
| :-------------------------- | :------------------- | | ||
| generate_shoreline_raster() | Shoreline Extraction | | ||
|
||
# Installation | ||
|
||
pip install git+https://github.com/dghorai/geo-bhumi | ||
|
||
# Acknowledgment |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
""" | ||
Top-level package for geo-bhumi. | ||
""" | ||
|
||
__version__ = '0.0.3' | ||
__author__ = 'Dr. Debabrata Ghorai' | ||
__email__ = '[email protected]' | ||
|
||
import os | ||
import sys | ||
import logging | ||
import datetime | ||
|
||
|
||
class CustomException(Exception): | ||
|
||
def __init__(self, err, sys_err: sys): | ||
super().__init__(err) | ||
self.err_msg = error_handling(err, sys_err=sys_err) | ||
|
||
def __str__(self): | ||
return self.err_msg | ||
|
||
|
||
def error_handling(err, sys_err: sys): | ||
# using the sys module to access more of the exception's information with sys.exc_info | ||
_, _, exp_trace_back = sys_err.exc_info() | ||
file_name = exp_trace_back.tb_frame.f_code.co_filename | ||
err_msg = f"Error occured in python script name [{file_name}] line number [{exp_trace_back.tb_lineno}] error message [{str(err)}]" | ||
return err_msg | ||
|
||
|
||
# create log folder and file | ||
project_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | ||
log_dir = os.path.join(project_dir, "logs") | ||
log_file_name = f"{datetime.datetime.now().strftime('%m_%d_%Y_%H_%M_%S')}.log" | ||
log_file = os.path.join(log_dir, log_file_name) | ||
os.makedirs(log_dir, exist_ok=True) | ||
|
||
# setup logging | ||
logging_str = "[%(asctime)s: %(levelname)s: %(module)s]: %(message)s" | ||
|
||
# add basic config | ||
logging.basicConfig( | ||
level=logging.INFO, | ||
format=logging_str, | ||
handlers=[ | ||
logging.FileHandler(log_file), | ||
logging.StreamHandler(sys.stdout) | ||
] | ||
) | ||
|
||
logger = logging.getLogger("GeoBhumiLogger") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.