# GEOFINDER-VT
This is collaboration with Dr. Junghwan Kim (Department of Geography@Virginia Tech) to create a user friendly Python API that uses geographical video files (captured by GoPro) to extract nearest gps location. The extracted metadata is saved in a CSV file and the image frame renamed with the tagged geolocation is available in the specified folder.
## Installation
To install this tool from PyPI, use the following command:
```
pip install geofinder-vt
```
## Usage
### VideoConverter Class
The VideoConverter class is used to extract images from video files in a specified folder.
```
from geofinder_vt import VideoConverter
video_folder = "campus_video_test" # Specify the folder where your video files are stored
converter = VideoConverter(video_folder)
converter.video_extract_folder()
```
#### Methods
`__init__(self, video_folder_prefix)`: Initializes the VideoConverter with the specified folder prefix.
`video_extract(self, video_file)`: Extracts images from a single video file using the extract_video function.
`video_extract_folder(self)`: Extracts images from all video files in the specified folder.
### ImageExtractor Class
The ImageExtractor class is used to process metadata from the extracted images and move relevant files based on geolocation data.
Example Usage
```
from geofinder_vt import ImageExtractor
input_csv = "example.csv" # Path to your CSV file containing geolocation data
directory_prefix = "GH" # Directory prefix to filter relevant folders
extractor = ImageExtractor(input_csv, directory_prefix)
destination_path = extractor.run()
print(f"Processed files moved to: {destination_path}")
```
#### Methods
`__init__(self, input_csv, dir_prefix)`: Initializes the ImageExtractor with the specified input CSV and directory prefix.
`list_relevant_folders(self)`: Lists all relevant folders in the base path that start with the specified directory prefix.
`consolidate_files(self, folders)`: Consolidates all files from the relevant folders.
`prepare_dataframe(self, all_files)`: Prepares a DataFrame from the consolidated files, extracting necessary metadata.
`find_closest_coords(self, row, ref_df)`: Finds the closest coordinates for a given row from the reference DataFrame.
`process_files(self, ref_df)`: Processes the files and finds unique files based on the closest coordinates.
`move_files(self, unique_files)`: Moves the unique files to a new destination directory.
`run(self)`: Runs the entire process of listing folders, consolidating files, preparing the DataFrame, processing files, and moving files.
## Dependencies
This tool requires the following dependencies:
`pandas>=2.0.1`
`geopy>=2.3.0`
`moviepy>=1.0.3`
`numpy>=1.24.3`
`xmltodict>=0.13.0`
`gpmf>=0.1`
`gpxpy>=1.5.0`
These packages are installed along with the installation of the geofinder-vt package
## Contributing
Contributions are welcome! Please fork the repository and submit a pull request with your changes.
## License
This project is licensed under the MIT License. See the LICENSE file for more details.
Raw data
{
"_id": null,
"home_page": "https://github.com/nathan846/geofindervt",
"name": "geofinder-vt",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Your Name",
"author_email": "vaidhyanathan@vt.edu",
"download_url": "https://files.pythonhosted.org/packages/72/7f/b3fcadfb67c04a0fe813fb3aa908757a0ae31f260825b987275474b581c2/geofinder-vt-1.0.0.tar.gz",
"platform": null,
"description": "# GEOFINDER-VT\r\n\r\nThis is collaboration with Dr. Junghwan Kim (Department of Geography@Virginia Tech) to create a user friendly Python API that uses geographical video files (captured by GoPro) to extract nearest gps location. The extracted metadata is saved in a CSV file and the image frame renamed with the tagged geolocation is available in the specified folder. \r\n\r\n## Installation\r\nTo install this tool from PyPI, use the following command:\r\n```\r\npip install geofinder-vt\r\n```\r\n\r\n## Usage\r\n\r\n### VideoConverter Class\r\n\r\nThe VideoConverter class is used to extract images from video files in a specified folder.\r\n\r\n```\r\nfrom geofinder_vt import VideoConverter\r\n\r\nvideo_folder = \"campus_video_test\" # Specify the folder where your video files are stored\r\nconverter = VideoConverter(video_folder)\r\nconverter.video_extract_folder()\r\n```\r\n\r\n#### Methods\r\n\r\n`__init__(self, video_folder_prefix)`: Initializes the VideoConverter with the specified folder prefix.\r\n\r\n`video_extract(self, video_file)`: Extracts images from a single video file using the extract_video function.\r\n\r\n`video_extract_folder(self)`: Extracts images from all video files in the specified folder.\r\n\r\n\r\n### ImageExtractor Class\r\n\r\nThe ImageExtractor class is used to process metadata from the extracted images and move relevant files based on geolocation data.\r\n\r\nExample Usage\r\n```\r\nfrom geofinder_vt import ImageExtractor\r\n\r\ninput_csv = \"example.csv\" # Path to your CSV file containing geolocation data\r\ndirectory_prefix = \"GH\" # Directory prefix to filter relevant folders\r\nextractor = ImageExtractor(input_csv, directory_prefix)\r\ndestination_path = extractor.run()\r\nprint(f\"Processed files moved to: {destination_path}\")\r\n\r\n```\r\n\r\n#### Methods\r\n\r\n`__init__(self, input_csv, dir_prefix)`: Initializes the ImageExtractor with the specified input CSV and directory prefix.\r\n\r\n`list_relevant_folders(self)`: Lists all relevant folders in the base path that start with the specified directory prefix.\r\n\r\n`consolidate_files(self, folders)`: Consolidates all files from the relevant folders.\r\n\r\n`prepare_dataframe(self, all_files)`: Prepares a DataFrame from the consolidated files, extracting necessary metadata.\r\n\r\n`find_closest_coords(self, row, ref_df)`: Finds the closest coordinates for a given row from the reference DataFrame.\r\n\r\n`process_files(self, ref_df)`: Processes the files and finds unique files based on the closest coordinates.\r\n\r\n`move_files(self, unique_files)`: Moves the unique files to a new destination directory.\r\n\r\n`run(self)`: Runs the entire process of listing folders, consolidating files, preparing the DataFrame, processing files, and moving files.\r\n\r\n## Dependencies\r\nThis tool requires the following dependencies:\r\n\r\n`pandas>=2.0.1`\r\n\r\n`geopy>=2.3.0`\r\n\r\n`moviepy>=1.0.3`\r\n\r\n`numpy>=1.24.3`\r\n\r\n`xmltodict>=0.13.0`\r\n\r\n`gpmf>=0.1`\r\n\r\n`gpxpy>=1.5.0`\r\n\r\nThese packages are installed along with the installation of the geofinder-vt package\r\n\r\n## Contributing\r\nContributions are welcome! Please fork the repository and submit a pull request with your changes.\r\n\r\n## License\r\nThis project is licensed under the MIT License. See the LICENSE file for more details.\r\n\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A brief description of your package",
"version": "1.0.0",
"project_urls": {
"Homepage": "https://github.com/nathan846/geofindervt"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "727fb3fcadfb67c04a0fe813fb3aa908757a0ae31f260825b987275474b581c2",
"md5": "17af596fb9ee3f3d781e0625d30c0151",
"sha256": "7aff30493e57d76f6bc3d927e06d9ea29067368d5bfcdd341c5514a675b76cf9"
},
"downloads": -1,
"filename": "geofinder-vt-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "17af596fb9ee3f3d781e0625d30c0151",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7344,
"upload_time": "2024-09-12T17:54:41",
"upload_time_iso_8601": "2024-09-12T17:54:41.092408Z",
"url": "https://files.pythonhosted.org/packages/72/7f/b3fcadfb67c04a0fe813fb3aa908757a0ae31f260825b987275474b581c2/geofinder-vt-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-12 17:54:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "nathan846",
"github_project": "geofindervt",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "geofinder-vt"
}