<div dir="ltr">Hi all!<br><br>First of all I would like to say this is my first email in the list since I joined OSGeo some days ago so I am sorry if I miss something! :)<br><br>I would like starting to contribute to Postgis and I was taking a look to the ticket <a href="https://trac.osgeo.org/postgis/ticket/4561">#4561</a> when some questions came to my mind.<br><br><div>At this moment the function ST_AsEwkt is missing the ZM for a 3-dimensional measured geometry:<br><br><blockquote style="margin:0 0 0 40px;border:none;padding:0px">query: SELECT ST_AsEwkt(ST_GeomFromText('POINTZM(10 10 2 3)'));<br>expected: POINT ZM (10 10 2 3)<br>output: POINT(10 10 2 3)</blockquote><br>However, the ST_AsText (WKT ISO) is working as expected:<br><br><blockquote style="margin:0 0 0 40px;border:none;padding:0px">query: SELECT ST_AsText(ST_GeomFromText('POINTZM(10 10 2 3)'));<br>expected: POINT ZM (10 10 2 3)<br>output: POINT ZM (10 10 2 3)</blockquote><br>So if we change "WKT_EXTENDED" to "WKT_EXTENDED | WKT_ISO" in LWGEOM_asEWKT / ST_AsEWKT then the SRID and ZM are kept:<div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>query: SELECT ST_AsEwkt(ST_GeomFromEWKT('SRID=100;POINTZM(10 10 2 3)'));</div><div>expected: "SRID=100;POINT ZM (10 10 2 3)"</div><div>output: "SRID=100;POINT ZM (10 10 2 3)"</div></blockquote><div><br></div><div>But we should change other tests tests which are failing with these changes, e.g.:</div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>CU_ASSERT_STRING_EQUAL(cu_wkt("POINT(0 0 0 0)",WKT_EXTENDED),"POINT(0 0 0 0)")</div></div></blockquote>we should change it to:<blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>CU_ASSERT_STRING_EQUAL(cu_wkt("POINT(0 0 0 0)",WKT_EXTENDED),"POINT ZM (0 0 0 0)")</div></blockquote><div><div><div><br></div><div>According to <a href="https://github.com/postgis/postgis/blob/master/doc/ZMSgeoms.txt">this doc</a> the ST_AsEwkt function should omit the Z qualifier but in my opinion it should have the same behaviour than WKT ISO in those cases.</div><div><br></div><div>What do you think?</div><div><br></div><div>Best.</div><div><br></div><div>-- <br>Manuel Jesús Morillo<br><br>Software Engineer<br><br>+1 917 463 3232 | <a href="mailto:mmorillo@carto.com">mmorillo@carto.com</a></div></div></div></div>