Coder Social home page Coder Social logo

cayetanobv / daynight2geojson Goto Github PK

View Code? Open in Web Editor NEW

This project forked from geographicags/daynight2geojson

0.0 2.0 0.0 1.18 MB

Get day and night world geometry and dumps to a GeoJSON file.

License: GNU General Public License v2.0

Python 89.77% Shell 10.23%

daynight2geojson's Introduction

##Description

Build Status PyPI version

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

More about it:

[Link to Geographica Blog] (http://www.blog-geographica.com/2015/03/15/mapping-the-worldwide-night-and-dump-it-to-geojson-2/)

##Requirements

See requirements of above libraries (Numpy, Matplotlib, GEOS, etc.).

Installing

You can install this package from PYPI: https://pypi.python.org/pypi/daynight2geojson

$ pip install daynight2geojson

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:

Open GeoJSON day_night 2015/01/15 12:00 day_night_20150115_1200 day_night_20150115_1200_globe

Open GeoJSON day_night 2015/01/15 18:00 day_night_20150115_1800 day_night_20150115_1800_globe

Open GeoJSON day_night UTC now day_night_2015_utc_now

##About author Developed by Cayetano Benavent (2015).

GIS Analyst at Geographica.

http://www.geographica.gs/

##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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.