smindel/silverstripe-gis
Composer 安装命令:
composer require smindel/silverstripe-gis
包简介
Geographic types for SilverStripe
README 文档
README
GIS developer toolkit for SilverStripe, turns SilverStripe into a GeoCMS and map service.
Features
- New field types: geo field types Geometry and Geography (Postgres only) for DataObjects
- New form fields: edit the new geo types using the MapField or add maps to GridFields in ModelAdmin
- Configurable projections: support for multiple projections through proj4
- Primitive and multipart geometries: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon
- Developer tools: heaps of useful helpers, e.g. for re-projecting, distance measuring, EWKT
- MySQL, Postgres and Sqlite3: supports Postgres with PostGIS, MySQL 5.7+, partial support for MariaDB and Sqlite3 with SpatiaLite
- ORM integration: DataList filters, e.g. to find intersecting DataObjects or within distance
- GeoJSON imorter: import a GeoJSON source as DataObjects
- GeoJSON web service: GeoJSON API for DataObjects
- WFS: WFS for DataObjects (experimental)
- WMTS: render DataObjects to ZXY tiles e.g. for a leaflet frontend
- Rasters: (Postgres only) import GeoTIFFs, access values, generate stats and render map tiles
Requirements
- MySQL 5.7+ or Postgres with PostGIS extension or Sqlite3 with SpatiaLite
- SilverStripe framework 4
- GDAL for raster support
Installation
It's recommended to use composer to install the module
$ composer require smindel/silverstripe-gis
$ vendor/bin/sake dev/build flush=all
MySQL natively supports geometries since version 5.7.6 but not geographies or raster data.
When using Postgres you have to install PostGIS and composer require silverstripe/postgresql. On Ubuntu and Debian run the following commands:
$ sudo apt-get install postgis
$ sudo apt-get install postgresql-9.5-postgis-scripts
$ sudo apt-get install postgresql-9.5-postgis-2.2
$ sudo -u postgres psql SS_gis -c "create extension postgis;"
(replace 'SS_gis' with your db name)
Steps two and three may not be necessary, so you might want to try one and four first and if four fails, do two, three and four.
In order to install Sqlite3 you have to install SpatiaLite and composer require silverstripe/sqlite3. On Ubuntu and Debian run the following commands:
$ sudo apt install sqlite3 php-sqlite3 libsqlite3-mod-spatialite
$ sudo updatedb & locate mod_spatialite.so
> /usr/lib/x86_64-linux-gnu/mod_spatialite.so
update php.ini, set:
sqlite3.extension_dir = /usr/lib/x86_64-linux-gnu
Configuration
silverstripe-gis, like any other SilverStripe module, can be configured using YAML files, the Config class or private static properties of Configurables. Check out the following sections to see what can be configured.
Examples and how tos:
- Why would you bother? - And if you should, what should you bother about?
- DataObject Example - How to set up your own DataObjects
- GridFieldMap - How create a spatially aware admin interface
- MapField - How to edit geo types
- ORM Filters - How to retrieve DataObjects from the db using spatial filters
API:
- GIS - Spatial utility class with all sorts of useful helpers
- GeoJSONImporter - Import GeoJSON files into the db
- GridFieldMap - GridField component to browse DataObjects by map
- MapField - Form field to edit geo types
- GeoJsonService - Expose your DataObjects dynamically in GeoJSON format though an API
- WebMapTileService - Generate map tiles for Leaflet or Openlayers from your DataObjects
- WebFeatureService - Generate WFS for Leaflet or Openlayers from your DataObjects (experimental)
- Rasters - Import raster files, access values and stats, render WMTS tiles
Note
The module is incompatible with the framework versions 4.3.1 and 4.3.2, which disallowed parameterised field assignments. The issue has been fixed, so that all versions of the framework before 4.3.1 and after 4.3.2 are working.
smindel/silverstripe-gis 适用场景与选型建议
smindel/silverstripe-gis 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 736 次下载、GitHub Stars 达 9, 最近一次更新时间为 2018 年 02 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「geometry」 「maps」 「silverstripe」 「gis」 「geospatial」 「geojson」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 smindel/silverstripe-gis 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 smindel/silverstripe-gis 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 smindel/silverstripe-gis 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova Google Maps Field.
Google Maps PHP SDK.
Analytics chooser extensions for site settings.
Geo-related tools PHP 7.3+ library
PHP Countries and Currencies
统计信息
- 总下载量: 736
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 22
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-02-19
