Download the PHP package vincjo/spatialite without Composer

On this page you can find all versions of the php package vincjo/spatialite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package spatialite

Install

Note that you have to install first sqlite3 / mod_spatialite and spatialite to run this library.

Tests

Basic usage

Create a new empty DB :

use Spatialite\SPL;

$db = new SPL( SPL::CreateNewEmptyDB('test.sqlite') );

// Or connect an existing Spatialite DB :
$db = new SPL( 'path/to/mydb.sqlite' );

Load shapfile :

$db->loadShapefile('path/to/shapefile/commune', 'commune', [
    'srid' => 2154, 
    'charset' => 'UTF-8'
]);

Query :

$result = $db->query("
    SELECT numero, nom_acc, statut, AsText( ST_Centroid(geom) ) AS centroid
    FROM commune 
    LIMIT 3
")->fetchAll(SPL::FETCH_OBJ);

// output :
Array
(
    [0] => stdClass Object
        (
            [numero] => 71176
            [nom_acc] => Digoin
            [statut] => Chef-lieu de canton
            [centroid] => POINT(778668.545898 6599300.563594)
        )

    [1] => stdClass Object
        (
            [numero] => 71590
            [nom_acc] => Volesvres
            [statut] => Commune simple
            [centroid] => POINT(789596.3737 6597690.519251)
        )

    [2] => stdClass Object
        (
            [numero] => 71325
            [nom_acc] => La Motte-Saint-Jean
            [statut] => Commune simple
            [centroid] => POINT(773591.803208 6602067.726544)
        )

)

Dump shapefile :

$db->dumpShapefile('./shapefile', 'commune', [
    'charset' => 'UTF-8',
    'geomcolumn' => 'geom'
]);

About Spatialite

SpatiaLite implements spatial extensions following the specification of the Open Geospatial Consortium (OGC).
At a very basic level, a DBMS that supports Spatial Data offers an SQL environment that has been extended with a set of geometry types, and thus may be usefully employed i.e. by some GIS application.
A geometry-valued SQL column is implemented as a column that has a geometry type. The OGC specification describe a set of SQL geometry types, as well as functions on those types to create and analyze geometry values.

SpatiaLite 4.2.0 - SQL functions reference list


All versions of spatialite with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
symfony/process Version >=4.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vincjo/spatialite contains the following files

Loading the files please wait ....