ESRI ShapeFile library for PHP

Last update: Jun 29, 2022

shapefile

ShapeFile library for PHP

Test-suite codecov.io Scrutinizer Code Quality Packagist

Features

Currently the 2D and 3D variants except MultiPatch of the ShapeFile format as defined in https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf. The library currently supports reading and editing of ShapeFiles and the Associated information (DBF file). There are a lot of things that can be improved in the code, if you are interested in developing, helping with the documentation, making translations or offering new ideas please contact us.

Installation

Please use Composer to install:

composer require phpmyadmin/shapefile

To be able to read and write the associated DBF file, you need dbase extension:

pecl install dbase
echo "extension=dbase.so" > /etc/php7/conf.d/dbase.ini

Documentation

The API documentation is available at https://develdocs.phpmyadmin.net/shapefile/.

Usage

To read shape file:

$shp = new \PhpMyAdmin\ShapeFile\ShapeFile(0);
$shp->loadFromFile('path/file.*');

History

This library is based on BytesFall ShapeFiles library written by Ovidio (ovidio AT users.sourceforge.net). The library has been embedded in phpMyAdmin for years and slowly developed there. At one point people started to use our version rather than the original library and that was the point we decided to make it separate package.

GitHub

https://github.com/phpmyadmin/shapefile
Comments
  • 1. Bug in Polygon/Polyline creation with multiple parts

    _savePolyLineRecord() in src/ShapeRecord.php does not work for geometries that have more than one part to them. Please refer to page 14 of the Shapefile specification for details and an illustration of how the Parts field should be written. I've forked and fixed - 6492274.

    Reviewed by L6SmxP5 at 2016-11-16 06:23
  • 2. Bump minimum version to PHP 7.1

    Drop support for PHP 5.4, PHP 5.5, PHP 5.6, PHP 7.0 and HHVM.

    Since phpMyAdmin requires PHP 7.1, it makes sense to require PHP 7.1 for shapefile as well.

    Reviewed by MauricioFauth at 2019-01-08 18:54
  • 3. Replace apigen with Sami in CI

    This has been already done on our server (see https://github.com/phpmyadmin/scripts/issues/11), so it doesn't make sense to test documentation build with apigen.

    If Sami supports some kind of lint mode, it should be enabled in the CI.

    Reviewed by nijel at 2018-06-01 08:39
  • 4. Scrutinizer Auto-Fixes

    @nijel requested this pull request.

    It consists of patches automatically generated for this project on Scrutinizer: https://scrutinizer-ci.com/g/phpmyadmin/shapefile/

    Reviewed by scrutinizer-auto-fixer at 2016-08-04 14:21
  • 5. Scrutinizer Auto-Fixes

    @nijel requested this pull request.

    It consists of patches automatically generated for this project on Scrutinizer: https://scrutinizer-ci.com/g/phpmyadmin/shapefile/

    Reviewed by scrutinizer-auto-fixer at 2016-06-24 14:38
  • 6. Scrutinizer Auto-Fixes

    @nijel requested this pull request.

    It consists of patches automatically generated for this project on Scrutinizer: https://scrutinizer-ci.com/g/phpmyadmin/shapefile/

    Reviewed by scrutinizer-auto-fixer at 2016-06-24 13:17
  • 7. Scrutinizer Auto-Fixes

    @nijel requested this pull request.

    It consists of patches automatically generated for this project on Scrutinizer: https://scrutinizer-ci.com/g/phpmyadmin/shapefile/

    Reviewed by scrutinizer-auto-fixer at 2016-06-14 12:00
  • 8. Scrutinizer Auto-Fixes

    @nijel requested this pull request.

    It consists of patches automatically generated for this project on Scrutinizer: https://scrutinizer-ci.com/g/phpmyadmin/shapefile/

    Reviewed by scrutinizer-auto-fixer at 2016-06-14 10:58
  • 9. Scrutinizer Auto-Fixes

    @nijel requested this pull request.

    It consists of patches automatically generated for this project on Scrutinizer: https://scrutinizer-ci.com/g/phpmyadmin/shapefile/

    Reviewed by scrutinizer-auto-fixer at 2016-06-14 10:51
Simple Yet Powerful Geo Library for PHP

phpgeo - A Simple Geo Library for PHP phpgeo provides abstractions to geographical coordinates (including support for different ellipsoids) and allows

Jul 29, 2022
Geo-related tools PHP 5.4+ library built atop Geocoder and React libraries

Geotools Geotools is a PHP geo-related library, built atop Geocoder and React libraries. Features Batch geocode & reverse geocoding request(s) in seri

Aug 7, 2022
PHP library to access the OpenCage geocoding API
PHP library to access the OpenCage geocoding API

OpenCage Geocoding API Library for PHP A PHP library to use the OpenCage geocoding API. Build Status / Code Quality Overview This library attempts to

Jun 20, 2022
PHP library for determining the physical location of binaries

Bin Locator Library for searching binary files in the operating system. Requirements PHP >= 7.4 Installation Library is available as composer reposito

Jul 27, 2022
PHP library to easily get static image from French Cadastral Government map with markers and lines.
PHP library to easily get static image from French Cadastral Government map with markers and lines.

PHP French Cadastral Map Static API PHP library to easily get static image from French Cadastral Government map with markers and lines. Map source : c

May 24, 2022
PHP library to easily get static image from OpenStreetMap (OSM) with markers and lines.
PHP library to easily get static image from OpenStreetMap (OSM) with markers and lines.

PHP OpenStreetMap Static API PHP library to easily get static image from OpenStreetMap with markers and lines. ✨ Supporting ⭐ Star this repository to

Jul 28, 2022
Official PHP library for IPinfo (IP geolocation and other types of IP data)

This is the official PHP client library for the IPinfo.io IP address API, allowing you to lookup your own IP address,

Aug 14, 2022
PHP extension for geospatial rendering with Mapnik
PHP extension for geospatial rendering with Mapnik

PHP7 Mapnik Introduction This project is an extension for PHP 7 that enables geospatial rendering with Mapnik. Create tile generation scripts, dynamic

Dec 17, 2021
PHP Extension to handle common geospatial functions.

geospatial - PHP Geospatial Extension PHP Extension to handle common geospatial functions. The extension currently has implementations of the Haversin

Aug 11, 2022
GeoJSON implementation for PHP

GeoJson PHP Library This library implements the GeoJSON format specification. The GeoJson namespace includes classes for each data structure defined i

Aug 4, 2022
PHP Exif Library - library for reading and writing Exif headers in JPEG and TIFF files using PHP.

PEL: PHP Exif Library README file for PEL: PHP Exif Library. A library with support for reading and writing Exif headers in JPEG and TIFF images using

Jun 28, 2022
BeckhoffPLCSoapClient - SoapClient to communicate with BeckHoff PLC. Library made in PHP based on TcAdsWebService JavaScript Library.

BeckhoffPLCSoapClient - SoapClient to communicate with BeckHoff PLC. Library made in PHP based on TcAdsWebService JavaScript Library.

May 18, 2022
EmailReplyParser is a PHP library for parsing plain text email content, based on GitHub's email_reply_parser library written in Ruby

EmailReplyParser EmailReplyParser is a PHP library for parsing plain text email content, based on GitHub's email_reply_parser library written in Ruby.

Jul 27, 2022
ImageWorkshop is a PHP5.3+ library that helps you to manage images based on GD library

================================ ImageWorkshop class ================================ Summary and features Really flexible and easy-to-use PHP class t

Aug 10, 2022
Image optimization / compression library. This library is able to optimize png, jpg and gif files in very easy and handy way. It uses optipng, pngquant, pngcrush, pngout, gifsicle, jpegoptim and jpegtran tools.

Image Optimizer This library is handy and very easy to use optimizer for image files. It uses optipng, pngquant, jpegoptim, svgo and few more librarie

Jul 30, 2022
A PHP string manipulation library with multibyte support. Compatible with PHP 5.4+, PHP 7+, and HHVM.

A PHP string manipulation library with multibyte support. Compatible with PHP 5.4+, PHP 7+, and HHVM. s('string')->toTitleCase()->ensureRight('y') ==

Aug 7, 2022
PHP Integrated Query, a real LINQ library for PHP

PHP Integrated Query - Official site What is PINQ? Based off the .NET's LINQ (Language integrated query), PINQ unifies querying across arrays/iterator

Aug 5, 2022
Easy to use utility functions for everyday PHP projects. This is a port of the Lodash JS library to PHP

Lodash-PHP Lodash-PHP is a port of the Lodash JS library to PHP. It is a set of easy to use utility functions for everyday PHP projects. Lodash-PHP tr

Aug 5, 2022
PHP library for ArCaptcha. This package supports PHP 7.3+.

PHP ArCaptcha Library PHP library for ArCaptcha. This package supports PHP 7.3+. List of contents PHP ArCaptcha Library List of contents Installation

Jun 21, 2022
PHP Text Analysis is a library for performing Information Retrieval (IR) and Natural Language Processing (NLP) tasks using the PHP language

php-text-analysis PHP Text Analysis is a library for performing Information Retrieval (IR) and Natural Language Processing (NLP) tasks using the PHP l

Aug 1, 2022