1

I'm trying to use some features recommended in another post here on the forum:

I have this query to PostGIS:

SELECT ST_LineLocatePoint (
ST_GeomFromText (
'LINESTRING (174 425, 230 402, 246 369, 242 309, 218 270, 198 192, 216 156, 257 88, 336 63, 395 66, 429 96, 444 170, 431 216, 412 249, 415 293, 448 329 , 478 356, 510 388) ':: geometry),
ST_GeomFromText (
'POINT (206 234)' :: geometry));

When I try to run directly in phpPgAdmin it gives me the following error:

> ERROR: function st_linelocatepoint (geometry, geometry) does not exist
> LINE 1: SELECT COUNT (*) AS total FROM (SELECT ST_LineLocatePoint (
>                                               ^ HINT: No function matches the given name and argument types. You might need to add
> explicit type casts. In statement: SELECT COUNT (*) AS total FROM
> (SELECT ST_LineLocatePoint ( ST_GeomFromText ( 'LINESTRING (174 425,
> 230 402, 246 369, 242 309, 218 270, 198 192, 216 156, 257 88, 336 63,
> 395 66, 429 96, 444 170, 431 216, 412 249, 415 293, 448 329 , 478 356,
> 510 388) ':: geometry), ST_GeomFromText ( 'POINT (206 234)' ::
> geometry))) AS sub

Does anyone know what the problem is?

1
  • 3
    which version of PostGIS are you using? "Up to 2.0.x this was called ST_Line_Locate_Point"
    – Ian Turton
    Feb 8 at 14:52

1 Answer 1

1

Thank you @Ian Turton

SELECT ST_Line_Locate_Point( ST_GeomFromText( 'LINESTRING ( 174 425, 230 402, 246 369, 242 309, 218 270, 198 192, 216 156, 257 88, 336 63, 395 66, 429 96, 444 170, 431 216, 412 249, 415 293, 448 329, 478 356, 510 388 )'), ST_GeomFromText( 'POINT ( 206 234 )'));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.