[postgis-devel] Issue 21 in postgis: locate_along_measure: wrong values, invalid data ?

codesite-noreply at google.com codesite-noreply at google.com
Thu Sep 25 02:51:24 PDT 2008


Issue 21: locate_along_measure: wrong values, invalid data ?
http://code.google.com/p/postgis/issues/detail?id=21

Comment #13 by mark.cav... at siriusit.co.uk:
Hi Richard,

I'm afraid I don't see that result here at all. Here are my results using  
SVN PostGIS
1.3 branch:


Current behaviour:

postgis13=# select asewkt(st_locate_along_measure(ST_GeomFromEWKT('
SRID=31293;LINESTRINGM(
6193.76 5337404.95 4519,
6220.13 5337367.145 4566,
6240.889 5337337.383 4603
)'), 4566));
                                           asewkt
-------------------------------------------------------------------------------------------
  SRID=31293;MULTIPOINTM(1.99915902736236e+37 -1.05616313798637e+45
5.41519507362328e-315,)
(1 row)

postgis13=# select 'LINEZM_6',
asewkt(locate_between_measures('LINESTRING(0 10 10 40, 10 0 0 0)', 2, 2));
  ?column? |        asewkt
----------+----------------------
  LINEZM_6 | POINT(9.5 0.5 0.5 2)
(1 row)


Behaviour with attached patch:

postgis13=# select asewkt(st_locate_along_measure(ST_GeomFromEWKT('
SRID=31293;LINESTRINGM(
6193.76 5337404.95 4519,
6220.13 5337367.145 4566,
6240.889 5337337.383 4603
)'), 4566));
                    asewkt
---------------------------------------------
  SRID=31293;POINTM(6220.13 5337367.145 4566)
(1 row)

postgis13=# select 'LINEZM_6',
asewkt(locate_between_measures('LINESTRING(0 10 10 40, 10 0 0 0)', 2, 2));
  ?column? |        asewkt
----------+----------------------
  LINEZM_6 | POINT(9.5 0.5 0.5 2)
(1 row)


Furthermore with the same patch I see the same results for your extra  
regression tests:

postgis13=# select 'LINEZM_7', asewkt(locate_between_measures('LINESTRING(0  
0 0 0, 1
1 1 1, 2 2 2 2, 3 4 5 6)', 1, 2));
  ?column? |           asewkt
----------+-----------------------------
  LINEZM_7 | LINESTRING(1 1 1 1,2 2 2 2)
(1 row)

postgis13=# select 'LINEZM_8', asewkt(locate_between_measures('LINESTRING(0  
0 0 0, 1
1 1 1, 2 2 2 2, 3 4 5 6)', 1.1, 2.1));
  ?column? |                          asewkt
----------+----------------------------------------------------------
  LINEZM_8 | LINESTRING(1.1 1.1 1.1 1.1,2 2 2 2,2.025 2.05 2.075 2.1)
(1 row)

postgis13=# select 'LINEZM_9', asewkt(locate_between_measures('LINESTRING(0  
0 0 0, 1
1 1 1, 2 2 2 2, 3 4 5 6)', 2, 2));
  ?column? |     asewkt
----------+----------------
  LINEZM_9 | POINT(2 2 2 2)
(1 row)

postgis13=# select 'LINEPZM_1', asewkt(locate_along_measure('LINESTRING(0 0  
0 0, 1 1
1 1, 2 2 2 2, 3 4 5 6)', 0));
  ?column?  |     asewkt
-----------+----------------
  LINEPZM_1 | POINT(0 0 0 0)
(1 row)

postgis13=# select 'LINEPZM_2', asewkt(locate_along_measure('LINESTRING(0 0  
0 0, 1 1
1 1, 2 2 2 2, 3 4 5 6)', 1));
  ?column?  |     asewkt
-----------+----------------
  LINEPZM_2 | POINT(1 1 1 1)
(1 row)

postgis13=# select 'LINEPZM_3', asewkt(locate_along_measure('LINESTRING(0 0  
0 0, 1 1
1 1, 2 2 2 2, 3 4 5 6)', 1.5));
  ?column?  |         asewkt
-----------+------------------------
  LINEPZM_3 | POINT(1.5 1.5 1.5 1.5)
(1 row)


So I'm really confused as to why your results don't match mine?!


ATB,

Mark.



Attachments:
	lwgeom_functions_lrs.patch  631 bytes



-- 
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings



More information about the postgis-devel mailing list