<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr">Another example of difference in the regression tests between PostGIS 2.5.5 and 3.1.3 is as follows<div><br><div>SELECT disjoint(geometry 'Point(1 1)', tgeompoint '{[Point(1 1)@2000-01-01, Point(2 2)@2000-01-02, Point(1 1)@2000-01-03],[Point(3 3)@2000-01-04, Point(3 3)@2000-01-05]}');<br>- disjoint <br>-----------<br>- f<br>-(1 row)<br>-<br>+ERROR<br>+HINT:  Change argument 2: 'GEOMETRYCOLLECTION(LINESTRING(1 1,2 2,1 1),POINT(3 3))'<br>+CONTEXT:  SQL function "disjoint" statement 1<br></div><div><br></div><div>As can be seen, the function raises an error in PostGIS 2.5.5 and works fine in PostGIS 3.1.3. </div><div><br></div><div>This kind of problem is managed in the regression tests by putting these queries in a file whose name ends with the suffix '_pgis3'. CMake will not run such tests if the installed PostGIS version is less than the major version 3. We had similar issues for the SP-GiST indexes since they were not usable before PostgreSQL version 11. Therefore, many files in the regression tests end with the suffix '_pg11'. The CMake code for taking care of this is as follows</div><div><br></div><div>foreach(file ${testfiles})<br>  get_filename_component(TESTNAME ${file} NAME_WE)<br>  set(DOTEST TRUE)<br>  if(${TESTNAME} MATCHES "_pg([0-9]+)")<br>    if(${POSTGRESQL_VERSION_MAYOR} LESS ${CMAKE_MATCH_1})<br>      message("Disabling test ${TESTNAME}")<br>      set(DOTEST FALSE)<br>    endif()<br>  endif()<br>  if(${TESTNAME} MATCHES "_pgis([0-9]+)")<br>    if(${POSTGIS_VERSION_MAYOR} LESS ${CMAKE_MATCH_1})<br>      message("Disabling test ${TESTNAME}")<br>      set(DOTEST FALSE)<br>    endif()<br>  endif()<br>  if(DOTEST)<br>    add_test(<br>      NAME ${TESTNAME}<br>      WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/test/scripts<br>      COMMAND test.sh run_compare ${TESTNAME} ${file}<br>      )<br>    set_tests_properties(${TESTNAME} PROPERTIES<br>      FIXTURES_REQUIRED DB<br>      RESOURCE_LOCK DBLOCK)<br>  endif()<br>endforeach()<br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <strong class="gmail_sendername" dir="auto">Esteban Zimanyi</strong> <span dir="auto"><<a href="mailto:estebanzimanyi@gmail.com" target="_blank">estebanzimanyi@gmail.com</a>></span><br>Date: Mon, Aug 23, 2021 at 6:58 PM<br>Subject: Re: Update about my experiments integrating PostGIS 3.1.3 and MobilityDB<br>To: Vicky Vergara <<a href="mailto:vicky@georepublic.de" target="_blank">vicky@georepublic.de</a>><br>Cc:  <<a href="mailto:mobilitydb-dev@lists.osgeo.org" target="_blank">mobilitydb-dev@lists.osgeo.org</a>>, Regina Obe <<a href="mailto:lr@pcorp.us" target="_blank">lr@pcorp.us</a>>, Mahmoud Sakr <<a href="mailto:m_attia_sakr@yahoo.com" target="_blank">m_attia_sakr@yahoo.com</a>>, mohamed sayed <<a href="mailto:mohamed_bakli@aun.edu.eg" target="_blank">mohamed_bakli@aun.edu.eg</a>>, SCHOEMANS Maxime <<a href="mailto:Maxime.Schoemans@ulb.be" target="_blank">Maxime.Schoemans@ulb.be</a>><br></div><br><br><div dir="ltr">I always solved that problem with the setPrecision functions<div><a href="https://docs.mobilitydb.com/MobilityDB/develop/ch04s05.html#box_setPrecision" target="_blank">https://docs.mobilitydb.com/MobilityDB/develop/ch04s05.html#box_setPrecision</a><br><div><a href="https://docs.mobilitydb.com/MobilityDB/develop/ch05s06.html#tpoint_setPrecision" target="_blank">https://docs.mobilitydb.com/MobilityDB/develop/ch05s06.html#tpoint_setPrecision</a></div><div>You can find numerous setPrecision calls in all the tests. I needed to do that when switching to PosgreSQL 13 because the output of the floating point values were different between versions.</div><div><br></div><div>The difference now is that in PostGIS 3 they started using the ryu library for output coordinates. The difference wrt the other tests is that we need to output a geometry/geography as result of the trajectory function.</div><div><br></div><div>I have almost finished today to write a simple setPrecision function for geometry/geography so that for example, the test</div><div> SELECT ST_AsText(trajectory(tnpoint 'Npoint(1, 0.5)@2000-01-01'));<br></div><div>will be replaced by </div><div> SELECT ST_AsText(setPrecision(trajectory(tnpoint 'Npoint(1, 0.5)@2000-01-01'), 6));<br></div><div>and this will solve the multiplatform variation for the tests.</div></div></div><div class="gmail_quote"><div> </div></div>
</div></div></div></div>