melowntech / vts-mapproxy

VTS Mapproxy
BSD 2-Clause "Simplified" License
30 stars 5 forks source link

mapproxy-tiling (tilling.cpp) generates a GDAL 1 ERROR #22

Open gyenyame400 opened 2 years ago

gyenyame400 commented 2 years ago

Hi, I'm trying to see if VTS could fit into my project. However when I try to execute the command listed on this tutorial (https://vts-geospatial.org/tutorials/mars-peaks-and-valleys.html), I get a GDAL ERROR 1. More precisely the command is this:

/opt/vts/bin/mapproxy-tiling --registry /opt/vts/etc/registry --input mars-mola-dem --referenceFrame mars-qsc --lodRange 2,10 --tileRange 0,0:3,2

The error I get is this: 2022-08-22 13:40:24 E2 [16819(tile:3-0-3)]: gdal error 1: Invalid dfSouthLatitudeDeg {geodataset.cpp:GDALErrorHandler():77} 2022-08-22 13:40:24 E2 [16819(tile:3-0-3)]: gdal error 1: Invalid dfSouthLatitudeDeg {geodataset.cpp:GDALErrorHandler():77} 2022-08-22 13:40:24 E2 [16819(tile:3-1-2)]: gdal error 1: Invalid dfSouthLatitudeDeg {geodataset.cpp:GDALErrorHandler():77} 2022-08-22 13:40:24 E2 [16819(tile:3-1-2)]: gdal error 1: Invalid dfSouthLatitudeDeg {geodataset.cpp:GDALErrorHandler():77} 2022-08-22 13:40:24 E2 [16819(tile:3-1-3)]: gdal error 1: Invalid dfSouthLatitudeDeg {geodataset.cpp:GDALErrorHandler():77} 2022-08-22 13:40:24 E2 [16819(tile:3-1-3)]: gdal error 1: Invalid dfSouthLatitudeDeg {geodataset.cpp:GDALErrorHandler():77} 2022-08-22 13:40:24 E2 [16819(tile:3-2-2)]: gdal error 1: Invalid dfSouthLatitudeDeg {geodataset.cpp:GDALErrorHandler():77} 2022-08-22 13:40:24 E2 [16819(tile:3-2-2)]: gdal error 1: Invalid dfSouthLatitudeDeg {geodataset.cpp:GDALErrorHandler():77} 2022-08-22 13:40:24 I3 [16819(tile:3-1-2)]: Processed tile 3-1-2 (extents: 0.000000,0.000000:3396190.000000,3396190.000000, srs: qsc-left-dmars2000) [watertight]. {tiling.cpp:process():339}

Any idea will be welcome. Thanks

gyenyame400 commented 2 years ago

Sorry, the DEM file DID NOT match the original checksum. So I guess VTS must have a way to check the validity of files. ANYWAY, GREAT PROJECT!

gyenyame400 commented 2 years ago

UPDATE: I re-downloaded the DEM file. The checksums DO match. However, I still get the SAME GDAL error. This must mean that I may have the WRONG gdal version (GDAL 3.0.4, released 2020/01/28). Any idea of what I'm doing wrong? Thanks

vaclavblazek commented 2 years ago

We have not checked this partifular dataset with gdal3. Will test later and see if it is a problem.

vaclavblazek commented 2 years ago

I do not have gdal 3.0.4 (we have 3.2.1 for Ubuntu focal and 3.4.1 for debian Bullseye), however these errors are errors logged common log handler that happen when input dataset is tried to warp into tile's bounds. If it fails then input dataset does not cover given tile.

gyenyame400 commented 2 years ago

Thanks for your response. I've tried to update my gdal version to 3.3.2. Now, I get this error:

SQLite error on SELECT name, ellipsoid_auth_name, ellipsoid_code, prime_meridian_auth_name, prime_meridian_code, area_of_use_auth_name, area_of_use_code, publication_date, deprecated FROM geodetic_datum WHERE auth_name = ? AND code = ?: no such column: area_of_use_auth_name {geodataset.cpp:GDALErrorHandler():77}

It seems I've a SQLite database version problem. Please, where can I upgrade the geodetic_datum TABLE?

vaclavblazek commented 2 years ago

This seems like an installation problem. These are gdal's internals.

gyenyame400 commented 2 years ago

Hi, please can you tell us what versions of PROJ & GDAL works well with VTS-MAPPROXY? We are currently trying to use VTS-MAPPROXY with GDAL (version 3.5.1) and PROJ (7.2.1). Will it be OK? Thanks a lot!

vaclavblazek commented 2 years ago

It should work.

gyenyame400 commented 2 years ago

I didn't work. I still got the unknown table column error when executing the generatevrtwo program on the TIF file. However, when I downgraded PROJ to 6.3.1, the error disappeared, but the tilling error re-appeared (gdal error 1: Invalid dfSouthLatitudeDeg from geodataset.cpp). So now, I'm going to downgrade GDAL too to 3.4 and try again. Thanks again.

gyenyame400 commented 2 years ago

Hi, again, Just ONE more question: is it possible that the fact that I'm trying to run PROJ on a Mars tif be the ISSUE. Maybe PROJ cannot find the metadata for Mars. Is there a way to import Mars metadata into PROJ?

vaclavblazek commented 2 years ago

Proj handles coordinate transformations. GDAL handles georeferenced raster (and vector) datasets. GDAL used proj for coordinate transformations.

gyenyame400 commented 2 years ago

Thanks for the answer. However, I don't seem to see where the problem lies. I see that VTS (geodataset.cpp) only report the first GDAL error line. Is it possible to print out the full STACKTRACE each time? Thanks

vaclavblazek commented 2 years ago

This is C++, no stacktrace. But what is the actual problem?

If you try to solve this "sql lite column" error then its problem with gdal/proj installation (wrong on-disk database for given library) , not our program. The original reported error (in your first message) should be OK, because mapproxy-tiling tries to convert given dataset into all tiles configured on the command line and some may fail -- they are skipped.

gyenyame400 commented 2 years ago

Thanks for asking. The problem is that (because of these errors?) the tile-index file is not generated. And in this case, the mapproxy http endpoint cannot serve the map and throws an error (tile index not found).

gyenyame400 commented 2 years ago

UPDATE: I built the vts-mapproxy project from source, and things seem to be going on well. I don't know why the pre-packaged version of the mapproxy-tiling program doesn't work. But that's not my job. BTW, the building using the make command (make -j4), as instructed by the README, doesn't work. I did the build using cmake instead. Thanks for everything!

vaclavblazek commented 2 years ago

The package probably did not work for you because you probaly had different gdal/proj version than it was compiled against. It's strange you were able to install it, tho. make works, can you paste the error here, pls?

gyenyame400 commented 2 years ago

Hi, The errors where about missing dependencies (libgeo, etc). Apparently make doesn't see the embedded (recursive) dependencies provided by the git checkout. But cmake does. Again thanks a lot for your work!

vaclavblazek commented 2 years ago

No, provided Makefile prepares buildsys (cmake) and then compiles. You have something broken.