@@ -7,44 +7,51 @@ This tests projecting WFS features in different coordinate systems, in particula
7
7
- EPSG:4326
8
8
- CRS:84
9
9
10
- TODO automate this test in the build
10
+ This dataset has only 1 feature to have a reduced size in the Git repository.
11
11
12
12
## Run mapserver
13
13
14
14
### existing 7.6.4-patch5-2-buster-lighttpd
15
15
16
- serving etrs89 source
17
-
18
16
``` docker
19
17
docker run --rm -p 80:80 -v `pwd`/testdata/crs:/srv/data -e MAPSERVER_CONFIG_FILE=/srv/data/natpark.conf -e SERVICE_TYPE=wfs -e MS_MAPFILE=/srv/data/natpark.map pdok/mapserver:7.6.4-patch5-2-buster-lighttpd
20
18
21
19
```
22
20
21
+ The server then can be contact at ` http://localhost:80/mapserver?request=GetCapabilities&service=WFS `
22
+
23
23
### local built 8
24
24
25
25
Warning: This docker build compiles dependencies and will take a long time when running for the first time
26
26
``` docker
27
27
docker build --target NL -t pdok/mapserver:8-local-NL .
28
28
```
29
29
30
- serving natpark source
30
+ Serving Nationale Parken source
31
31
32
32
``` docker
33
33
docker run --rm -p 80:80 -v `pwd`/testdata/crs:/srv/data -e MAPSERVER_CONFIG_FILE=/srv/data/natpark.conf -e SERVICE_TYPE=wfs -e MS_MAPFILE=/srv/data/natpark.map pdok/mapserver:8-local-NL
34
34
```
35
35
36
+ The server then can be contact at ` http://localhost:80/mapserver?request=GetCapabilities&service=WFS `
37
+
36
38
## Verify the output
37
39
38
40
39
41
``` shell
42
+ exit_code=0
43
+ mkdir -p ` pwd` /testdata/crs/actual/;
40
44
IMAGE=pdok/mapserver:8-local-NL && \
41
- SOURCE_NAME=rd && \
45
+ SOURCE_NAME=natpark && \
42
46
OUT_NAME=etrs89 && \
43
47
OUT_EPSG=4258 && \
44
- docker run --rm -p 80:80 -v ` pwd` /ETRS89andRDNAP:/srv/data \
45
- -e MAPSERVER_CONFIG_FILE=/srv/data/${SOURCE_NAME} .conf -e SERVICE_TYPE=wfs -e MS_MAPFILE=/srv/data/${SOURCE_NAME} .map --entrypoint=mapserv \
48
+ docker run --rm -p 80:80 -v ` pwd` /testdata/crs:/srv/data -e MAPSERVER_CONFIG_FILE=/srv/data/natpark.conf -e SERVICE_TYPE=wfs -e MS_MAPFILE=/srv/data/natpark.map --entrypoint=mapserv \
46
49
" ${IMAGE} " \
47
- -nh " QUERY_STRING=service=WFS&version=2.0.0&request=GetFeature&typeName=${SOURCE_NAME} &outputFormat=geojson&srsName=EPSG:${OUT_EPSG} " | \
48
- jq --arg crs " ${OUT_NAME} " ' .features | .[] | { id, x_dev: (.geometry.coordinates[0] - (.properties[$crs+"_x"]|tonumber)), y_dev: (.geometry.coordinates[1] - (.properties[$crs+"_y"]|tonumber)) } | {error: ((.x_dev|abs) > 0.001 or (.y_dev|abs) > 0.001 )} + .' | \
49
- jq -s ' group_by (.error)[] | {error: .[0].error, count: length}'
50
+ -nh " QUERY_STRING=service=WFS&request=GetFeature&count=1&version=2.0.0&outputFormat=application/json&typeName=nationaleparken&srsName=EPSG:${OUT_EPSG} " > ` pwd` /testdata/crs/actual/output.json;
51
+ [ $( cat ` pwd` /testdata/crs/actual/output.json | jq -r ' .crs.properties.name' ) == " urn:ogc:def:crs:EPSG::4258" ] || exit_code=1;
52
+ [ $( cat ` pwd` /testdata/crs/actual/output.json | jq -r ' .bbox[0]' | xargs -I ' {}' echo " scale=5;" " ({}-4.3646379084)/1 == 0" | bc) ] || exit_code=1;
53
+ [ $( cat ` pwd` /testdata/crs/actual/output.json | jq -r ' .bbox[1]' | xargs -I ' {}' echo " scale=5;" " ({}-51.3620482342678)/1 == 0" | bc) ] || exit_code=1;
54
+ [ $( cat ` pwd` /testdata/crs/actual/output.json | jq -r ' .bbox[2]' | xargs -I ' {}' echo " scale=5;" " ({}-4.46528581228022)/1 == 0" | bc) ] || exit_code=1;
55
+ [ $( cat ` pwd` /testdata/crs/actual/output.json | jq -r ' .bbox[3]' | xargs -I ' {}' echo " scale=5;" " ({}-51.4268875774673)/1 == 0" | bc) ] || exit_code=1;
56
+ echo $exit_code
50
57
```
0 commit comments