Skip to content

Commit 5fc3825

Browse files
committed
Init package
0 parents  commit 5fc3825

8 files changed

+158
-0
lines changed

.editorconfig

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = tab
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_style = space
16+
indent_size = 2
17+
18+
[Makefile]
19+
indent_style = tab

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/vendor
2+
composer.lock
3+
phpunit.result.cache
4+
.php-cs-fixer.cache

.php-cs-fixer.dist.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
return JanaSeta\PhpCs\Fix::in([
4+
'src',
5+
]);

README.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# PHP Simple Features SQL
2+
3+
Build SFA-SQL (SQL/MM) expressions using SFA-CA syntax.
4+
5+
6+
7+
## Terminology and standards
8+
9+
- **SF**[Simple Features](https://en.wikipedia.org/wiki/Simple_Features),
10+
the geometries and the interface to interact with them.
11+
- **SFA** — Simple Feature Access, same thing as Simple Features.
12+
- **WK** — "well known" formats like WKT, WEKT, WKB, EWKB.
13+
14+
The main standards considered in this project ar the OpenGIS ones:
15+
16+
- https://www.ogc.org/standards/sfa
17+
- https://www.ogc.org/standards/sfs
18+
19+
Also see ISO 19125 (SFA) and ISO 19107 (spatial schema).
20+
21+
## Similar projects
22+
23+
### brick/geo
24+
25+
https://github.com/brick/geo
26+
27+
Allows doing GIS stuff inside PHP, using an underlying engine like GEOS ext,
28+
PostGIS and others. Includes SF query engines for various databases.
29+
30+
### GeoPHP
31+
32+
https://geophp.net/
33+
34+
Does GIS stuff inside PHP and allows communicating with DB using WK and other
35+
formats.
36+
37+
### vincjo/spatialite
38+
39+
https://github.com/vincjo/spatialite
40+
41+
PHP interface to SpatiaLite.

composer.json

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "tontonsb/php-sf",
3+
"description": "SFA-SQL expression builder",
4+
"authors": [
5+
{
6+
"name": "Juris Evertovskis",
7+
"email": "[email protected]",
8+
"homepage": "https://github.com/tontonsb"
9+
}
10+
],
11+
"homepage": "https://github.com/tontonsb/php-sf",
12+
"keywords": [
13+
"Simple features", "Simple feature access",
14+
"SFA-SQL", "SQL/MM",
15+
"PostGIS", "SpatiaLite",
16+
"OpenGIS", "ISO 19125", "ISO 19107",
17+
"Geo", "GIS", "Geometry", "Geography"
18+
],
19+
"require": {
20+
"php": "^8.1"
21+
},
22+
"require-dev": {
23+
"janaseta/php-cs": "^1.0",
24+
"phpunit/phpunit": "^9.0"
25+
},
26+
"autoload": {
27+
"psr-4": {
28+
"TontonsB\\SF\\": "src"
29+
}
30+
},
31+
"autoload-dev": {
32+
"psr-4": {
33+
"TontonsB\\SF\\Tests\\": "tests"
34+
}
35+
},
36+
"config": {
37+
"sort-packages": true
38+
},
39+
"scripts": {
40+
"test": "XDEBUG_MODE=coverage phpunit --coverage-text --colors --testdox",
41+
"fix": "php-cs-fixer fix",
42+
"cs": "@fix --dry-run --diff"
43+
},
44+
"scripts-descriptions": {
45+
"test": "Run tests",
46+
"fix": "Fix code style",
47+
"cs": "Dry run CS fixer"
48+
}
49+
}

phpunit.xml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
5+
bootstrap="vendor/autoload.php" >
6+
<coverage>
7+
<include>
8+
<directory suffix=".php">./src</directory>
9+
</include>
10+
</coverage>
11+
<testsuites>
12+
<testsuite name="SF tests">
13+
<directory suffix="Test.php">./tests</directory>
14+
</testsuite>
15+
</testsuites>
16+
</phpunit>

src/Expression.php

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace TontonsB\SF;
4+
5+
class Expression
6+
{
7+
//
8+
}

tests/ExpressionTest.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace TontonsB\SF\Tests;
4+
5+
use PHPUnit\Framework\TestCase;
6+
use TontonsB\SF\Expression;
7+
8+
class ExpressionTest extends TestCase
9+
{
10+
public function testInstantiation()
11+
{
12+
$expression = new Expression;
13+
14+
$this->assertIsObject($expression);
15+
}
16+
}

0 commit comments

Comments
 (0)