Giter Club home page Giter Club logo

karta's Introduction

Build Status

Karta

Karta is a package for spatial analysis in Python. It streamlines data processing by providing efficient generic geographical types for vector and raster sources as well as a selection of analysis functions.

For example, read or create vector geometries:

point = Point((-130.0, 52.0), crs=LonLatWGS84)
line = read_geojson("linedata.json")
polygon = Polygon([(-515005.78, -1301130.53),
                   (-579174.89, -1282271.94),
                   (-542977.83, -1221147.82),
                   (-437864.05, -1251641.55),
                   (-438160.72, -1252421.48),
                   (-437961.28, -1285314.00)],
                   crs=NSIDCNorth)

Perform simple queries:

point2 = Point((-25.0, 48.0), crs=LonLatWGS84)
point.distance(point2)          # Distance in geographical units
line.intersects(polygon)        # True or False
ch = polygon.convex_hull()      # Returns a new polygon
ch.to_shapefile("poly.shp")

Load and manipulate raster data:

grid = read_gtiff("landsat_scene.tif")  # Leverages GDAL
grid.profile(line)              # Collect data along a line
grid.resample(500.0, 500.0)     # Return a grid resampled at a new resolution

The latest release is on PyPI (see Installation). Suggestions, bug reports, test cases, and pull requests are welcome.

The latest stable release is 0.7. The repository master branch is considered a moderately-unstable development branch.

Documentation

See the online manual, the tutorial, or read the API documentation.

The manual can be built offline using Sphinx. Building the documentation requires numpydoc.

Package Overview

  • karta.crs: framework for coordinate reference systems and geodetic calculations

  • karta.vector.geometry: geometry classes Point, Multipoint, Line, and Polygon with associated methods such as length, area, intersections, membership testing, convex hulls, and affine transformations

  • karta.raster.grid: Grid classes including RegularGrid class (supporting CRS-aware clipping, sampling, profiling along vector tracks), and experimental WarpedGrid

  • tests: unit tests, to be run with python tests/runtests.py

Formats

Karta provides a basic working interface to several of common file formats. Currently implemented are:

  • vector
    • GeoJSON (r,w)
    • ESRI Shapefiles (via GDAL) (r,w)
    • GPS eXchange (GPX) (r,w)
  • raster
    • GeoTiff (via GDAL) (r,w)
    • ESRI ASCII Grid (r,w)

Karta implements the Python __geo_interface__ attribute for vector geometries. This permits data to be exchanged between Karta and external modules that also implement __geo_interface__ (e.g. shapely, fastkml).

Installation

The easiest way to install in production is via pip. Installation requires a recent version of setuptools:

pip install -U setuptools

Then, to install the latest release from PyPI:

pip install karta

Building from source

Building from source requires Cython:

pip install Cython

Then, clone the repository and install:

git clone https://github.com/fortyninemaps/karta.git karta
pip install -r karta/requirements.txt
pip install karta/

Dependencies

  • numpy >= >1.7
  • gdal >= 1.10
  • pyproj >= 1.9
  • blosc >= 1.2
  • C99-compliant compiler

Karta supports Python 2.7 and Python 3.4+.

License

This software is provided under the MIT license.

MIT License:

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

karta's People

Contributors

njwilson23 avatar arkottke avatar

Watchers

James Cloos avatar  avatar

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.