Get day and night global geometry and dumps to a GeoJSON file. Builded on top of Matplotlib Basemap Toolkit Library.
Project description
Description
Get day and night global geometry and dumps to a GeoJSON file.
Builded on top of Matplotlib Basemap Toolkit Library. Geojson and Shapely libraries are used to deal with geometries.
Output Coordinate Reference System (CRS): EPSG 4326
Requirements
Geojson Python library (>= 1.0.9). https://github.com/frewsxcv/python-geojson
Shapely Python library (>= 1.4). https://github.com/Toblerity/Shapely
Matplotlib Basemap Toolkit Python library (>= 1.0.7). https://github.com/matplotlib/basemap
See requirements of above libraries (Numpy, Matplotlib, GEOS, etc.).
Installing
If you want to install from pip and you do not have installed Basemap:
pip install daynight2geojson –allow-external basemap –allow-unverified basemap
Usage
Basic usage:
from datetime import datetime
from daynight2geojson import DayNight2Geojson
# Filepath to output GeoJSON
filepath = '/tmp/day_night.geojson'
# input_date = None is for UTC now date
# For others input date: datetime object must be passed
# datetime(year, month, day, hour, minute)
input_date = datetime(2015, 1, 15, 00, 00)
dn = DayNight2Geojson(filepath, input_date=input_date)
dn.getDayNight()
Test script: - test/daynighttesting.py
Examples:
License
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file daynight2geojson-0.1.tar.gz.
File metadata
- Download URL: daynight2geojson-0.1.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a539ba2923f249b4e7222b175bc1bc0ce16a8421291c85de546854d21dca0bb0
|
|
| MD5 |
0d3c2d091a38c433d592135deeacf2af
|
|
| BLAKE2b-256 |
b694143d2b4fe3a526ba7d909af767a9559c0887525fefc4b5b70992fb9caefe
|