This repository has been archived by the owner on Jun 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from Oslandia/qgis2to3
Migrate plugin from QGIS2 to QGIS3
- Loading branch information
Showing
33 changed files
with
641 additions
and
639 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,10 @@ | ||
dist: trusty | ||
language: ruby | ||
|
||
services: | ||
- postgresql | ||
|
||
addons: | ||
postgresql: "9.6" | ||
apt: | ||
packages: | ||
- postgresql-9.6-postgis-2.3 | ||
- docker | ||
|
||
before_install: | ||
- sudo apt search gdal libspatialite | ||
- sudo apt-get install -y gdal-bin python-pyspatialite python-psycopg2 python-pip libspatialite5 | ||
- docker build . -t qgis-versioning-test | ||
|
||
script: | ||
- python --version | ||
- cd test | ||
- python ./tests.py 127.0.0.1 postgres -v | ||
- docker run qgis-versioning-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM debian:buster | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y postgresql-11-postgis-2.5 libsqlite3-mod-spatialite python3-psycopg2 gdal-bin | ||
|
||
# to be able to connect locally | ||
RUN echo "host all all 127.0.0.1/32 trust" > /etc/postgresql/11/main/pg_hba.conf | ||
|
||
COPY . qgis-versioning | ||
WORKDIR qgis-versioning/test | ||
|
||
CMD service postgresql start && python3 tests.py 127.0.0.1 postgres -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
SCRIPT_DIR=$(dirname $(readlink -f $0)) | ||
|
||
for db in epanet_test_db epanet_test_db_copy; | ||
do | ||
dropdb --if-exists -h 127.0.01 -U postgres $db | ||
createdb -h 127.0.01 -U postgres $db | ||
psql -h 127.0.01 -U postgres $db -c 'CREATE EXTENSION postgis' | ||
psql -h 127.0.01 -U postgres $db -f $SCRIPT_DIR/epanet_test_db_wo_versioning.sql | ||
done | ||
|
||
EMPTY_DB="qgis_versioning_empty_db" | ||
dropdb --if-exists -h 127.0.01 -U postgres $EMPTY_DB | ||
createdb -h 127.0.01 -U postgres $EMPTY_DB | ||
psql -h 127.0.01 -U postgres $EMPTY_DB -c 'CREATE EXTENSION postgis' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
CREATE EXTENSION IF NOT EXISTS postgis; | ||
CREATE SCHEMA epanet; | ||
|
||
CREATE TABLE epanet.junctions ( | ||
jid serial PRIMARY KEY, | ||
id varchar, | ||
elevation float, | ||
base_demand_flow float, | ||
demand_pattern_id varchar, | ||
geom geometry('POINT',2154) | ||
); | ||
|
||
INSERT INTO epanet.junctions | ||
(id, elevation, geom) | ||
VALUES | ||
('0',0,ST_GeometryFromText('POINT(1 0)',2154)); | ||
|
||
INSERT INTO epanet.junctions | ||
(id, elevation, geom) | ||
VALUES | ||
('1',1,ST_GeometryFromText('POINT(0 1)',2154)); | ||
|
||
CREATE TABLE epanet.pipes ( | ||
pid serial PRIMARY KEY, | ||
id varchar, | ||
start_node varchar, | ||
end_node varchar, | ||
length float, | ||
diameter float, | ||
roughness float, | ||
minor_loss_coefficient float, | ||
status varchar, | ||
geom geometry('LINESTRING',2154) | ||
); | ||
|
||
INSERT INTO epanet.pipes | ||
(id, start_node, end_node, length, diameter, geom) | ||
VALUES | ||
('0','0','1',1,2,ST_GeometryFromText('LINESTRING(1 0,0 1)',2154)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.