Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zeitreihen print contains data that is not officially released #1628

Closed
gjn opened this issue Aug 26, 2015 · 4 comments
Closed

Zeitreihen print contains data that is not officially released #1628

gjn opened this issue Aug 26, 2015 · 4 comments
Assignees
Labels

Comments

@gjn
Copy link
Contributor

gjn commented Aug 26, 2015

When printing 1:25'000 with https://map.geo.admin.ch/?X=288058.07&Y=682938.66&zoom=7&topic=ech&lang=de&bgLayer=ch.swisstopo.pixelkarte-farbe&layers=ch.swisstopo.zeitreihen&time=2013&layers_timestamp=20131231 and do a multipage, the multipage pdf is containg the last lk25'000 of 2006. But in the application, we have the last lk25'000 of 2013.

The print request json is in [1].

My assumption is that the releases service used ([2] in this case) is delivering the wrong timestamps. In fact, as can be seen by [2], which was triggered by [1], it doesn't contain 2006 but not 2013. It seems like our metadata and the data we should in the application don't match.

@ltclm @daguer Could it be that on the last updates, we forgot to update the meta data? Or what could be wrong?

[1] http://api3.geo.admin.ch/rest/services/ech/MapServer/ch.swisstopo.zeitreihen/releases?imageDisplay=1%2C1%2C96&mapExtent=682969.245278%2C287928.662778%2C682978.064722%2C287937.482222
[2]

{"layout":"1 A4 landscape","srs":"EPSG:21781","units":"m","rotation":0,"app":"config","lang":"de","dpi":"150","layers":[{"layer":"ch.swisstopo.pixelkarte-farbe","opacity":1,"type":"WMTS","baseURL":"https://wmts.geo.admin.ch","maxExtent":[420000,30000,900000,350000],"tileOrigin":[420000,350000],"tileSize":[256,256],"resolutions":[4000,3750,3500,3250,3000,2750,2500,2250,2000,1750,1500,1250,1000,750,650,500,250,100,50,20,10,5,2.5,2,1.5,1,0.5],"zoomOffset":0,"version":"1.0.0","requestEncoding":"REST","formatSuffix":"jpeg","style":"default","dimensions":["TIME"],"params":{"TIME":"20151231"},"matrixSet":"21781"},{"layer":"ch.swisstopo.zeitreihen","opacity":1,"type":"WMTS","baseURL":"https://wmts.geo.admin.ch","maxExtent":[420000,30000,900000,350000],"tileOrigin":[420000,350000],"tileSize":[256,256],"resolutions":[4000,3750,3500,3250,3000,2750,2500,2250,2000,1750,1500,1250,1000,750,650,500,250,100,50,20,10,5,2.5,2],"zoomOffset":0,"version":"1.0.0","requestEncoding":"REST","formatSuffix":"pngjpeg","style":"default","dimensions":["TIME"],"params":{"TIME":"20061231"},"matrixSet":"21781"},{"type":"Vector","styles":{"1":{"externalGraphic":"https://map.geo.admin.ch/1439987023/img/marker.png","graphicWidth":20,"graphicHeight":30,"graphicXOffset":-12,"graphicYOffset":-30},"2":{"externalGraphic":"https://map.geo.admin.ch/1439987023/img/bubble.png","graphicWidth":97,"graphicHeight":27,"graphicXOffset":-46,"graphicYOffset":-27,"label":"","labelXOffset":0,"labelYOffset":18,"fontColor":"#ffffff","fontSize":12,"fontWeight":"bold"}},"styleProperty":"_gx_style","geoJson":{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"_gx_style":1},"geometry":{"type":"Point","coordinates":[682544.625,291179.6875,0]}}]},"name":"drawing","opacity":1}],"qrcodeurl":"https://api3.geo.admin.ch/qrcodegenerator?url=https%3A%2F%2Fmap.geo.admin.ch%2F%3FX%3D290390.57%26Y%3D681768.66%26zoom%3D6%26topic%3Dech%26lang%3Dde%26bgLayer%3Dch.swisstopo.pixelkarte-farbe%26layers%3Dch.swisstopo.zeitreihen%26time%3D2006%26layers_timestamp%3D20061231","movie":true,"pages":[{"center":[681768.6550000015,290390.5725],"bbox":[678232.0577777793,292727.72527777776,685305.2522222238,288053.41972222226],"display":[802,530],"scale":"25000.0","dataOwner":"© swisstopo","thirdPartyDataOwner":false,"shortLink":"https://s.geo.admin.ch/669524c234","rotation":0,"langde":true,"timestamp":"2006"}]}
@gjn gjn added the 2nd prio label Aug 26, 2015
@ltclm
Copy link
Contributor

ltclm commented Aug 26, 2015

the print request json is executing the following query in the database:

SELECT gid AS public_meta_20_gid, ST_AsEWKB(the_geom) AS public_meta_20_the_geom, release_year AS public_meta_20_release_year, bgdi_order AS public_meta_20_bgdi_order
        FROM public.meta_20
        WHERE ST_DWITHIN(the_geom, ST_GeomFromWKB('\x01030000000100000005000000f913957db2d72441aa46afa6e2921141f913957db2d724419e9acbed05931141f33d2321c4d724419e9acbed05931141f33d2321c4d72441aa46afa6e2921141f913957db2d72441aa46afa6e2921141'::bytea, 21781), 0.0) ORDER BY bgdi_order

psql -x -c "SELECT gid AS public_meta_20_gid, ST_AsEWKB(the_geom) AS public_meta_20_the_geom, release_year AS public_meta_20_release_year, bgdi_order AS public_meta_20_bgdi_order
        FROM public.meta_20
        WHERE ST_DWITHIN(the_geom, ST_GeomFromWKB('\x01030000000100000005000000f913957db2d72441aa46afa6e2921141f913957db2d724419e9acbed05931141f33d2321c4d724419e9acbed05931141f33d2321c4d72441aa46afa6e2921141f913957db2d72441aa46afa6e2921141'::bytea, 21781), 0.0) ORDER BY bgdi_order
" -d zeitreihen_prod
-[ RECORD 1 ]---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
public_meta_20_gid          | 18868
public_meta_20_the_geom     | \x010600002015550000010000000103000000010000000500000000000000c0eb22410000000080010f4100000000a00e25410000000080010f4100000000a00e254100000000c06e124100000000c0eb224100000000c06e124100000000c0eb22410000000080010f41
public_meta_20_release_year | {2006,2000,1994,1988,1982,1976,1970,1959}
public_meta_20_bgdi_order   | 1
-[ RECORD 2 ]---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
public_meta_20_gid          | 32371
public_meta_20_the_geom     | \x010600002015550000010000000103000000010000000500000000000000c0eb22410000000080010f4100000000a00e25410000000080010f4100000000a00e254100000000c06e124100000000c0eb224100000000c06e124100000000c0eb22410000000080010f41
public_meta_20_release_year | {1934,1916,1912,1909,1906,1904,1899,1893,1889,1884,1879,1875,1869,1866,1863,1859,1849}
public_meta_20_bgdi_order   | 2

This table contains lk100 and tk100.
So the service is choosing the years from lk100 release to print lk25...

@gjn
Copy link
Contributor Author

gjn commented Aug 26, 2015

Can you verify that the correct meta model (lk25) contains the correct data?

Seems like we are choosing the wrong model. It's either caused by wrong parameters passed to releases service or wrong calculation of the resolution from those parameters. I'll have a look tomorrow.

@ltclm
Copy link
Contributor

ltclm commented Aug 26, 2015

yes the good table would be meta_22

$ psql -x -c "SELECT gid AS public_meta_20_gid, ST_AsEWKB(the_geom) AS public_meta_20_the_geom, release_year AS public_meta_20_release_year, bgdi_order AS public_meta_20_bgdi_order
        FROM public.meta_22
        WHERE ST_DWITHIN(the_geom, ST_GeomFromWKB('\x01030000000100000005000000f913957db2d72441aa46afa6e2921141f913957db2d724419e9acbed05931141f33d2321c4d724419e9acbed05931141f33d2321c4d72441aa46afa6e2921141f913957db2d72441aa46afa6e2921141'::bytea, 21781), 0.0) ORDER BY bgdi_order
" -d zeitreihen_prod
-[ RECORD 1 ]---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
public_meta_20_gid          | 573
public_meta_20_the_geom     | \x010600002015550000010000000103000000010000000500000000000000e885244100000000c0f7104100000000a00e254100000000c0f7104100000000a00e25410000000040b3114100000000e88524410000000040b3114100000000e885244100000000c0f71041
public_meta_20_release_year | {2013,2007,2000,1994,1988,1982,1976,1971,1966,1957,1955}
public_meta_20_bgdi_order   | 1
-[ RECORD 2 ]---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
public_meta_20_gid          | 5417
public_meta_20_the_geom     | \x01060000201555000001000000010300000001000000050000000000000044ca2441000000008055114100000000a00e2541000000008055114100000000a00e25410000000040b311410000000044ca24410000000040b311410000000044ca24410000000080551141
public_meta_20_release_year | {1943,1932,1922,1915,1895,1882}
public_meta_20_bgdi_order   | 2

@gjn
Copy link
Contributor Author

gjn commented Aug 26, 2015

Thanks alot for verifying.

We ignore the passed scale and try to calculate it based on passed Bbox, center, etc..., which is probably wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants