定制 vincjo/spatialite 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vincjo/spatialite

最新稳定版本:0.0.7

Composer 安装命令:

composer require vincjo/spatialite

包简介

PHP + Spatialite

README 文档

README

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

composer require vincjo/spatialite

Tests

./vendor/bin/phpunit 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

统计信息

  • 总下载量: 779
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-2.1
  • 更新时间: 2019-10-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固