[postgis-tickets] [PostGIS] #4696: ST_LocateAlong returns EMPTY geom for certain terminal measures

PostGIS trac at osgeo.org
Wed May 27 15:28:47 PDT 2020


#4696: ST_LocateAlong returns EMPTY geom for certain terminal measures
--------------------------------+---------------------
 Reporter:  pauldzy             |      Owner:  pramsey
     Type:  defect              |     Status:  new
 Priority:  medium              |  Milestone:
Component:  postgis             |    Version:  2.5.x
 Keywords:  ST_LocateAlong LRS  |
--------------------------------+---------------------
 {{{
 POSTGIS="2.5.2 r17328" [EXTENSION] PGSQL="110" GEOS="3.7.0-CAPI-1.11.0
 673b9939" PROJ="Rel. 5.2.0, September 15th, 2018" GDAL="GDAL 2.3.1,
 released 2018/06/22" LIBXML="2.9.1" LIBJSON="0.12" LIBPROTOBUF="1.3.0"
 RASTER
 }}}

 I suspect this is related to floats within the measure code as it just
 goes away if the geometry is "rinsed" by casting it to text and back.

 {{{
 SELECT
  ST_IsValid(a.rawewkb) AS raw_valid
 ,ST_M(ST_StartPoint(a.rawewkb)) AS raw_startM
 ,ST_M(ST_Endpoint(a.rawewkb)) AS raw_endM
 ,ST_AsEWKT(ST_LocateAlong(a.rawewkb,30.46338)) AS raw_locatealong
 ,ST_IsValid(a.rawewkb) AS rinsed_valid
 ,ST_M(ST_StartPoint(a.rawewkb)) AS rinsed_startM
 ,ST_M(ST_Endpoint(a.rawewkb)) AS rinsed_endM
 ,ST_AsEWKT(ST_LocateAlong(a.rinsed,30.46338)) AS rinsed_locate
 FROM (
    SELECT
         aa.rawewkb
    ,ST_AsEWKT(aa.rawewkb) AS txted
    ,ST_GeomFromEWKT(ST_AsEWKT(aa.rawewkb)) AS rinsed
    FROM (
       SELECT
 ST_GeomFromEWKB(decode('AQIAAGDOEwAAAwAAAEei4br9RCdBbmmOozvgLEHXnlkSoHY+QBCLlwkIRSdBIlcDZybgLEE6r7FLVO86QBDucKJ2RSdBsmULZJjfLEEAAAAAAAAAAA==','base64'))
 AS rawewkb
    ) aa
 ) a;
 }}}

 On my 2.5.2 instance I receive
 * true, 30.46338, 0, SRID=5070;MULTIPOINTM EMPTY,
 * true, 30.46338, 0, SRID=5070;MULTIPOINTM(762494.8650027 946205.819445891
 30.46338)
 with of course the rinsed results being the desired output.

 Thanks,

 Paul

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4696>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list