| | 56 | |
| | 57 | -- Repeat all tests with the new function names. |
| | 58 | -- No M value |
| | 59 | select '2d',ST_asewkt(ST_locate_along_measure('POINT(1 2)', 1)); |
| | 60 | select '3dz',ST_asewkt(ST_locate_along_measure('POINT(1 2 3)', 1)); |
| | 61 | |
| | 62 | -- Points |
| | 63 | select 'PNTM_1',ST_asewkt(ST_locate_along_measure('POINTM(1 2 3)', 1)); |
| | 64 | select 'PNTM_2',ST_asewkt(ST_locate_along_measure('POINTM(1 2 3)', 3)); |
| | 65 | select 'PNTM_3',ST_asewkt(ST_locate_between_measures('POINTM(1 2 3)', 2, 3)); |
| | 66 | select 'PNTM_4',ST_asewkt(ST_locate_between_measures('POINTM(1 2 3)', 3, 4)); |
| | 67 | select 'PNTM_5',ST_asewkt(ST_locate_between_measures('POINTM(1 2 4.00001)', 3, 4)); |
| | 68 | |
| | 69 | -- Multipoints |
| | 70 | select 'MPNT_1',ST_asewkt(ST_locate_between_measures('MULTIPOINTM(1 2 2)', 2, 5)); |
| | 71 | select 'MPNT_2', ST_asewkt(ST_locate_between_measures('MULTIPOINTM(1 2 8, 2 2 5, 2 1 0)', 2, 5)); |
| | 72 | select 'MPNT_3', ST_asewkt(ST_locate_between_measures('MULTIPOINTM(1 2 8, 2 2 5.1, 2 1 0)', 2, 5)); |
| | 73 | select 'MPNT_4', ST_asewkt(ST_locate_between_measures('MULTIPOINTM(1 2 8, 2 2 5, 2 1 0)', 4, 8)); |
| | 74 | |
| | 75 | -- Linestrings |
| | 76 | select 'LINEZM_1', ST_asewkt(ST_locate_between_measures('LINESTRING(0 10 100 0, 0 0 0 10)', 2, 18)); |
| | 77 | select 'LINEZM_2', ST_asewkt(ST_locate_between_measures('LINESTRING(0 10 0 0, 0 0 100 10)', 2, 18)); |
| | 78 | select 'LINEZM_3', ST_asewkt(ST_locate_between_measures('LINESTRING(0 10 100 0, 0 0 0 10, 10 0 0 0)', 2, 18)); |
| | 79 | select 'LINEZM_4', ST_asewkt(ST_locate_between_measures('LINESTRING(0 10 100 0, 0 0 0 20, 10 0 0 0)', 2, 18)); |
| | 80 | select 'LINEZM_5', ST_asewkt(ST_locate_between_measures('LINESTRING(0 10 100 0, 0 0 0 20, 0 10 10 40, 10 0 0 0)', 2, 18)); |
| | 81 | select 'LINEZM_6', ST_asewkt(ST_locate_between_measures('LINESTRING(0 10 10 40, 10 0 0 0)', 2, 2)); |
| | 82 | |
| | 83 | --- line_locate_point |
| | 84 | |
| | 85 | SELECT 'line_locate_point', ST_line_locate_point('LINESTRING(709243.393033887 163969.752725768,708943.240904444 163974.593889146,708675.634380651 163981.832927298)', 'POINT(705780 15883)'); |
| | 86 | |
| | 87 | --- postgis-users/2006-January/010613.html |
| | 88 | select 'line_locate_point', ST_line_locate_point(ST_geomfromtext('LINESTRING(-1953743.873 471070.784,-1953735.105 471075.419,-1953720.034 471081.649)', 6269), ST_geomfromtext('POINT(-1953720.034 471081.649)', 6269)); |
| | 89 | select 'line_locate_point', ST_line_locate_point(ST_geomfromtext('LINESTRING(-1953743.873 471070.784,-1953735.105 471075.419,-1953720.034 471081.649)', 6269), ST_geomfromtext('POINT(-1953743.873 471070.784)', 6269)); |
| | 90 | |
| | 91 | --- line_substring / line_interpolate_point |
| | 92 | |
| | 93 | --- postgis-devel/2006-January/001951.html |
| | 94 | select 'line_substring', ST_asewkt(ST_line_substring(ST_geomfromewkt('SRID=4326;LINESTRING(0 0 0 0, 1 1 1 1, 2 2 2 2, 3 3 3 3, 4 4 4 4)'), 0.5, 0.8)); |
| | 95 | |
| | 96 | select 'line_substring', ST_asewkt(ST_line_substring('LINESTRING(0 0 0 0, 1 1 1 1, 2 2 2 2, 3 3 3 3, 4 4 4 4)', 0.5, 0.75)); |
| | 97 | select 'line_substring', ST_asewkt(ST_line_substring('LINESTRING(0 0, 1 1, 2 2)', 0, 0.5)); |
| | 98 | select 'line_substring', ST_asewkt(ST_line_substring('LINESTRING(0 0, 1 1, 2 2)', 0.5, 1)); |
| | 99 | select 'line_substring', ST_asewkt(ST_line_substring('LINESTRING(0 0, 2 2)', 0.5, 1)); |
| | 100 | select 'line_substring', ST_asewkt(ST_line_substring('LINESTRING(0 0, 2 2)', 0, 0.5)); |
| | 101 | select 'line_substring', ST_asewkt(ST_line_substring('LINESTRING(0 0, 4 4)', .25, 0.5)); |
| | 102 | select 'line_substring', ST_asewkt(ST_line_substring('LINESTRINGM(0 0 0, 4 4 4)', .25, 0.5)); |
| | 103 | select 'line_substring', ST_asewkt(ST_line_substring('LINESTRINGM(0 0 4, 4 4 0)', .25, 0.5)); |
| | 104 | select 'line_substring', ST_asewkt(ST_line_substring('LINESTRING(0 0 4, 4 4 0)', .25, 0.5)); |
| | 105 | |
| | 106 | select 'line_substring', ST_asewkt(ST_line_substring('LINESTRING(0 0, 1 1)', 0, 0)); |
| | 107 | select 'line_substring', ST_asewkt(ST_line_substring('LINESTRING(0 0 10, 1 1 5)', 0.5, .5)); |
| | 108 | |
| | 109 | --- line_interpolate_point |
| | 110 | |
| | 111 | select 'line_interpolate_point', ST_asewkt(ST_line_interpolate_point('LINESTRING(0 0, 1 1)', 0)); |
| | 112 | select 'line_interpolate_point', ST_asewkt(ST_line_interpolate_point('LINESTRING(0 0 10, 1 1 5)', 0.5)); |