Mercurial > gemma
view schema/isrs_tests.sql @ 1883:76a6d334e681 dev-pdf-generation
Client: pdf-gen: refactor addScaleBar
* Change positioning from center to left-upper corner for a new
function addRoundedBox() that is now used before addScaleBar().
This is easier to calculate and is more like the model of jsPDF.
* Add more comments to show how this works.
* Move saving of the current vue instance to be the last command
before the callback is set.
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Wed, 16 Jan 2019 20:58:59 +0100 |
parents | 9d51f022b8ee |
children | f9f1babe52ae |
line wrap: on
line source
-- This is Free Software under GNU Affero General Public License v >= 3.0 -- without warranty, see README.md and license for details. -- SPDX-License-Identifier: AGPL-3.0-or-later -- License-Filename: LICENSES/AGPL-3.0.txt -- Copyright (C) 2018 by via donau -- – Österreichische Wasserstraßen-Gesellschaft mbH -- Software engineering by Intevation GmbH -- Author(s): -- * Tom Gottfried <tom@intevation.de> -- -- pgTAP test script for ISRS location code types and functions -- SELECT results_eq($$ SELECT isrs_fromText('DEBON03901G007906548') $$, $$ SELECT CAST(('DE', 'BON', '03901', 'G0079', 6548) AS isrs) $$, 'Correct ISRS text input gives respective ISRS location code'); SELECT throws_ok($$ SELECT isrs_fromText('DEUXXX039000000005023') $$, 22023, NULL, 'ISRS text input needs to have correct length'); SELECT ok( ISRSrange_area(isrsrange( ('AT', 'XXX', '00001', '00000', 0)::isrs, ('AT', 'XXX', '00001', '00000', 1)::isrs), ST_SetSRID('POLYGON((0 1, 0 2, 1 2, 1 1, 0 1))'::geometry, 4326) ) IS NULL, 'ISRSrange_area returns NULL, if given area does not intersect with axis'); SELECT ok( ST_DWithin( (SELECT geom FROM waterway.distance_marks_virtual WHERE location_code = ('AT', 'XXX', '00001', '00000', 0)::isrs), ST_Boundary(ISRSrange_area(isrsrange( ('AT', 'XXX', '00001', '00000', 0)::isrs, ('AT', 'XXX', '00001', '00000', 1)::isrs), ST_SetSRID('POLYGON((-1 1, 2 1, 2 -1, -1 -1, -1 1))'::geometry, 4326)))::geography, 1) AND ST_DWithin( (SELECT geom FROM waterway.distance_marks_virtual WHERE location_code = ('AT', 'XXX', '00001', '00000', 1)::isrs), ST_Boundary(ISRSrange_area(isrsrange( ('AT', 'XXX', '00001', '00000', 0)::isrs, ('AT', 'XXX', '00001', '00000', 1)::isrs), ST_SetSRID('POLYGON((-1 1, 2 1, 2 -1, -1 -1, -1 1))'::geometry, 4326)))::geography, 1), 'Resulting polygon almost ST_Touches points corresponding to stretch');