All Projects → garrettrayj → Php7 Mapnik

garrettrayj / Php7 Mapnik

Licence: mit
PHP extension for geospatial rendering with Mapnik

Projects that are alternatives of or similar to Php7 Mapnik

Pyproj
Python interface to PROJ (cartographic projections and coordinate transformations library)
Stars: ✭ 582 (+3780%)
Mutual labels:  geospatial
Ofbiz
Apache OFBiz - Main development has moved to the ofbiz-frameworks repository.
Stars: ✭ 719 (+4693.33%)
Mutual labels:  geospatial
Postgis
PostGIS spatial database extension to PostgreSQL [mirror]
Stars: ✭ 925 (+6066.67%)
Mutual labels:  geospatial
Webworldwind
The NASA WorldWind Javascript SDK (WebWW) includes the library and examples for creating geo-browser web applications and for embedding a 3D globe in HTML5 web pages.
Stars: ✭ 628 (+4086.67%)
Mutual labels:  geospatial
Leaflet Dvf
Leaflet Data Visualization Framework
Stars: ✭ 678 (+4420%)
Mutual labels:  geospatial
Agentmaps
Make social simulations on interactive maps with Javascript! Agent-based modeling for the web.
Stars: ✭ 822 (+5380%)
Mutual labels:  geospatial
Magellan
Geo Spatial Data Analytics on Spark
Stars: ✭ 507 (+3280%)
Mutual labels:  geospatial
Incubator Sedona
A cluster computing framework for processing large-scale geospatial data
Stars: ✭ 860 (+5633.33%)
Mutual labels:  geospatial
Mapserver
Source code of the MapServer project. Please submit pull requests to the 'main' branch.
Stars: ✭ 693 (+4520%)
Mutual labels:  geospatial
Proj4.jl
Julia wrapper for the PROJ cartographic projections library
Stars: ✭ 23 (+53.33%)
Mutual labels:  geospatial
Geo
Geospatial primitives and algorithms for Rust
Stars: ✭ 655 (+4266.67%)
Mutual labels:  geospatial
Awesome Open Geoscience
Curated from repositories that make our lives as geoscientists, hackers and data wranglers easier or just more awesome
Stars: ✭ 668 (+4353.33%)
Mutual labels:  geospatial
Lpfmpoints
Evolution of LPFM Stations
Stars: ✭ 19 (+26.67%)
Mutual labels:  geospatial
Cassandra Lucene Index
Lucene based secondary indexes for Cassandra
Stars: ✭ 584 (+3793.33%)
Mutual labels:  geospatial
Rlur
Shiny dashboard for Land Use Regression modelling
Stars: ✭ 8 (-46.67%)
Mutual labels:  geospatial
Worldwindjava
The NASA WorldWind Java SDK (WWJ) is for building cross-platform 3D geospatial desktop applications in Java.
Stars: ✭ 526 (+3406.67%)
Mutual labels:  geospatial
Earthengine Py Notebooks
A collection of 360+ Jupyter Python notebook examples for using Google Earth Engine with interactive mapping
Stars: ✭ 807 (+5280%)
Mutual labels:  geospatial
Lycheepy
LycheePy is a distributed processing server of geospatial data
Stars: ✭ 15 (+0%)
Mutual labels:  geospatial
Cesium
An open-source JavaScript library for world-class 3D globes and maps 🌎
Stars: ✭ 8,095 (+53866.67%)
Mutual labels:  geospatial
Gmtmex
GMT API for MATLAB
Stars: ✭ 23 (+53.33%)
Mutual labels:  geospatial

PHP7 Mapnik

PHP7 Mapnik

Introduction

This project is an extension for PHP 7 that enables geospatial rendering with Mapnik. Create tile generation scripts, dynamic tile services, or static maps with Mapnik XML and PHP.

Build Status

Requirements

  • PHP >= 7.0
    • Available through brew intall php on MacOS with Homebrew.
    • Available through sudo apt-get install php-dev php-gd on Ubuntu 16.04 Xenial.
  • Mapnik 3.0.x
    • Available through brew install mapnik on MacOS with Homebrew.
    • Available through sudo apt-get install libmapnik-dev on Ubuntu 16.04 Xenial.

Installation

git clone https://github.com/garrettrayj/php7-mapnik.git && cd php7-mapnik
phpize
./configure --with-mapnik
make test
make install
echo "extension=mapnik.so" > /etc/php.d/mapnik.ini

Notes:

  • The PHP configuration directory may differ from above. Run php -i | grep "Scan this dir" to find your system's location.
  • The ICU library path may need to be exported before building on MacOS. export LDFLAGS="-L/usr/local/opt/icu4c/lib"

Tile Server Example

Run the example...

./example/run.sh

...then visit http://localhost:8000/

Usage

<?php

// Register datasource plugins
// Use `mapnik-config --input-plugins` to get input plugin directory
\Mapnik\DatasourceCache::registerDatasources('/usr/local/lib/mapnik/input');

// Create map
$map = new \Mapnik\Map(640, 480);

// Register fonts
// Use `mapnik-config --fonts` to get Mapnik fonts directory
$map->registerFonts('/usr/local/lib/mapnik/fonts');

// Load Mapnik XML
$map->loadXmlFile('my_awesome_map.xml', false, $basePath);

// Situate map content within canvas
$map->zoomAll();

// Create image
$image = new \Mapnik\Image(640, 480);

// Render
$renderer = new \Mapnik\AggRenderer($map, $image);
$renderer->apply();

// Save PNG image file
$image->saveToFile('my_awesome_map.png');

See the API Documentation for a complete list of available objects and methods.

Dev Container

The included Dockerfile builds an image with all the dependencies needed for extension development and testing, including testing for memory leaks.

docker build -t php7-mapnik-dev .
docker run -it --mount type=bind,source=$(pwd),target=/opt/php7-mapnik php7-mapnik-dev:latest
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].