중요

번역은 여러분이 참여할 수 있는 커뮤니티 활동입니다. 이 페이지는 현재 57.14% 에서 번역되고 있습니다.

8. OGC 적합성 시험

The Open Geospatial Consortium (OGC) provides tests which can be run free of charge to make sure a server is compliant with a certain specification. This chapter provides a quick tutorial to setup the WMS and OGC API Features tests on an Ubuntu system. A detailed documentation can be found at the OGC website.

8.1. pyogctest

pyogctest 는 OGC 테스트를 쉽게 실행하는 데 특화된 파이썬 도구입니다. 가상 환경에서 이 도구를 설치하려면:

git clone https://github.com/pblottiere/pyogctest
virtualenv venv
source venv/bin/activate
pip install -e pyogctest/

8.2. WMS 1.3.0 테스트 스위트

To run the WMS 1.3.0 test suite with success, a specific test dataset is needed. It can be downloaded using pyogctest:

./pyogctest.py -s wms130 --download

다운로드가 완료되면, 새 data 디렉터리 안에서 teamengine_wms_130.qgs 프로젝트를 찾을 수 있습니다. QGIS_SERVER_PROJECT_FILE 환경 변수를 통해 QGIS 서버에 이 프로젝트를 기본 프로젝트로 등록해야 합니다. 이렇게 하면 QGIS 서버의 MAP 판매자 파라미터(vendor-parameter)를 명백히 설정할 필요가 없습니다.

메타데이터 테스트와 호환되려면 특정 환경설정도 설정해야 합니다. 실제로, data/metadata 디렉터리에 있는 일부 메타데이터를 URL을 통해 OGC 테스트 프레임워크가 사용할 수 있도록 해줘야 합니다. 가장 간편한 선택지는 사용자 웹 서버를 http://XXX.XXX.XXX.XXX/metadata/Autos.xml 같은 URL을 통해 액세스할 수 있도록 환경설정하는 것입니다. 프로젝트에서 이런 메타데이터 URL을 정의해서, WMS GetCapabilities 문서에 삽입합니다. 따라서 QGIS 서버가 무결한 XML 문서를 생성하게 하려면 사용자 테스트 환경에 따라 프로젝트를 업데이트해주어야 합니다.

./pyogctest.py -s wms130 -m http://XXX.XXX.XXX.XXX/metadata

이제 모든 것을 적절하게 환경설정했으니, WMS 1.3.0 테스트 스위트를 다음과 같이 실행하면 됩니다:

./pyogctest.py -s wms130 -u http://XXX.XXX.XXX.XXX/qgisserver
========================== OGC test session starts ============================
testsuite: WMS 1.3.0
collected 184 items

data-independent::basic_elements::version-negotiation::negotiate-no-version .
data-independent::basic_elements::version-negotiation::negotiate-basic_elements-version .
data-independent::basic_elements::version-negotiation::negotiate-higher-version .
...
...
...

=========================== 184 passed in 40 seconds ===========================

8.3. OGC API Features test suite

To run the OGC API Features 1.0 test suite, a test dataset is needed. Considering that the underlying QGIS project doesn’t need specific configuration for this test suite, we can use the .qgs file provided in the training repository:

git clone https://github.com/qgis/QGIS-Training-Data
ls QGIS-Training-Data/exercise_data/qgis-server-tutorial-data/world.qgs

After the download, a world.qgs project is available in the qgis-server-tutorial sub directory. This project has to be registered as the default project for QGIS Server thanks to the QGIS_SERVER_PROJECT_FILE environment variable. This way, we don’t need to explicitly set the MAP vendor-parameter of QGIS Server.

Now that everything is properly configured, we can run the OGC API Features 1.0 test suite:

./pyogctest.py -s ogcapif -u http://XXX.XXX.XXX.XXX/qgisserver

=========================== OGC test session starts ============================
collected 56 items

collections::FeatureCollections::retrieveApiModel .
collections::FeatureCollections::noOfCollections .
collections::FeatureCollections::requirementClasses .
...
...
...

=========================== 56 passed in 24 seconds ============================