https://github.com/phpmyadmin/shapefile
ESRI ShapeFile library for PHP
https://github.com/phpmyadmin/shapefile
dbf esri php shapefile
Last synced: 8 months ago
JSON representation
ESRI ShapeFile library for PHP
- Host: GitHub
- URL: https://github.com/phpmyadmin/shapefile
- Owner: phpmyadmin
- License: gpl-2.0
- Created: 2016-06-14T07:45:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-09-19T14:24:55.000Z (about 2 years ago)
- Last Synced: 2024-05-17T22:38:55.195Z (over 1 year ago)
- Topics: dbf, esri, php, shapefile
- Language: PHP
- Homepage: https://packagist.org/packages/phpmyadmin/shapefile
- Size: 1.41 MB
- Stars: 27
- Watchers: 7
- Forks: 11
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- Awesome-Geospatial - shapefile - ESRI ShapeFile library for PHP. (PHP)
- awesome-gis - shapefile - ESRI ShapeFile library for PHP. (Geospatial Library / PHP)
README
# shapefile
ShapeFile library for PHP
[](https://github.com/phpmyadmin/shapefile/actions/workflows/tests.yml?query=branch%3Amaster)
[](https://codecov.io/github/phpmyadmin/shapefile?branch=master)
[](https://scrutinizer-ci.com/g/phpmyadmin/shapefile/?branch=master)
[](https://packagist.org/packages/phpmyadmin/shapefile)
## 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][1] to install:
```sh
composer require phpmyadmin/shapefile
```
To be able to read and write the associated DBF file you need the ``dbase``
extension:
```sh
pecl install dbase
echo "extension=dbase.so" > /etc/php8/conf.d/dbase.ini
```
## Documentation
API documentation is available at
.
## Usage
To read a shape file:
```php
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.
[1]:https://getcomposer.org/