Skip to main content

A Python based open-source mapping toolkit

Project description

PyMapKit

PyMapKit is a Python based open-source mapping toolkit. It can be used for creating maps, visualizing geospatial data, and developing GIS applications. It is built to be modular: so it can be very simple to use, but also to be integrated into complex mapping applications.

Basic Usage

## Import MapEngine Modules
import PyMapKit
from PyMapKit import CairoPainter as renderer

## Create MapEngine object
m = PyMapKit.MapEngine()

## Set Map Attributes
m.set_size(500, 500)
m.set_location(40.0, -81.0)
m.set_scale(500)

## Add tile layer
tile_layer = TileLayer("https://tileserver.com/tile/{z}/{y}/{x}")

## Create data layers
vect_layer = PyMapKit.VectorLayer("./path/to/file.shp")
rast_layer = PyMapKit.VectorLayer("./path/to/file.tiff")

## Add layers to Map Object
m.add_layer(tile_layer)
m.add_layer(vect_layer)
m.add_layer(rast_layer)

## Using PyCairo for rendering
sf = cairo.ImageSurface(cairo.Format.RGB24, m.width, m.height)
cr = cairo.Context(surface)

## Render onto canvas using CairoPainter as renderer
m.render(renderer, cr)

## Save output file
sf.save_png("./map.png")

Installation

External Dependencies

PyMapKit requires two external libraries that require a non Python component installed. You will need to install these on your system before installing PyMapKit. These dependencies are:

  • GDAL/OGR: for loading geospatial data, and warping raster datasets
  • Cario: For drawing operations

Linux/Ubuntu:

sudo apt install python3-gdal python3-cairo

Windows:

Comming soon

Mac OSx:

Comming soon

Installing PyMapKit

To install PyMapKit from PyPI simply run:

pip install PyMapKit

Or to install from the GitHub repo:

git clone https://github.com/BenKnisley/PyMapKit.git
pip install -r ./PyMapKit/requirements.txt
pip install ./PyMapKit

Developer Extras

If you are contributing to PyMapKit make sure you also install the dev requirements as well.

pip install -r requirements_dev.txt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyMapKit-0.1.1.tar.gz (17.6 kB view hashes)

Uploaded Source

Built Distribution

PyMapKit-0.1.1-py3-none-any.whl (20.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page