Skip to content

phpmyadmin/shapefile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6aab917 · Jan 12, 2025
Jan 12, 2025
Nov 21, 2020
Dec 8, 2024
Oct 10, 2024
Dec 8, 2024
Dec 8, 2024
Sep 19, 2023
Aug 16, 2020
Jul 31, 2024
Dec 8, 2024
Jan 11, 2019
Feb 22, 2020
Jun 14, 2016
Jan 8, 2025
Aug 5, 2016
Dec 1, 2024
Sep 13, 2023
Dec 1, 2024
Nov 20, 2024
Sep 11, 2023
Dec 8, 2024
Sep 14, 2023

shapefile

ShapeFile library for PHP

Test-suite codecov.io Scrutinizer Code Quality Packagist

Features

This library supports the 2D and 3D variants, except MultiPatch, of the ShapeFile format as defined in https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf. It can read and edit 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 the dbase extension:

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

Documentation

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

Usage

To read a shape file:

use PhpMyAdmin\ShapeFile\ShapeFile;
use PhpMyAdmin\ShapeFile\ShapeType;

$shp = new ShapeFile(ShapeType::Null);
$shp->loadFromFile('path/file.*');

History

This library is based on BytesFall ShapeFiles library written by Ovidio (ovidio AT users.sourceforge.net). It 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 when we decided to make it a separate package.

Packages

No packages published

Contributors 10

Languages