[postgis-users] Sampling a line shapefile based on own criteria

Gery gamejihou at hotmail.com
Mon Jan 9 14:07:01 PST 2012


The code works really good, I tried it already and it gives the distance,
really nice!, thanks Fred again :)

now I'm a bit confused, I'll try to explain it below, hope I can explain it
well :p, my table looks like this:

db=# select gid,profile,seg_fldr,dist_dd,dist_m from dd_line_smoothline;
gid |      profile       | seg_fldr |  dist_dd   |  dist_m   
-----+--------------------+----------+------------+-----------
   1 | 20111220102834P-LF |     7281 | 0.02525395 | 2416.5765
   2 | 20111220105932P-LF |     4997 | 0.02487362 | 2375.0371
   3 | 20111220112109P-LF |     5342 | 0.02502609 | 2390.6025
...
...

and I need to do it one by one, I did using the seg_fldr and dist_dd info in
the 1st row:
select st_astext(st_line_interpolate_point(geom,ser::float/7281)) as points
from (select st_geometryfromtext('linestring(0 0,0.02525395 0)') as geom) as
foo1, generate_series(1,7281,1) as ser;

and got:
            points             
-------------------------------
 POINT(3.46847273726137e-06 0)
 POINT(6.93694547452273e-06 0)
 POINT(1.04054182117841e-05 0)
 POINT(1.38738909490455e-05 0)
 POINT(1.73423636863068e-05 0)
 POINT(2.08108364235682e-05 0)
 POINT(2.42793091608296e-05 0)
 POINT(2.77477818980909e-05 0)
...
...

but I tried to specify the row with "where profile='20111220102834P-LF' but
didnt work. The geom is wgs84 (SRID=4326) Also, is it possible to derive the
longitude and latitude positions instead that only distances?

Thanks in advance,

Gery

--
View this message in context: http://postgis.17.n6.nabble.com/Sampling-a-line-shapefile-based-on-own-criteria-tp3518606p3521745.html
Sent from the PostGIS - User mailing list archive at Nabble.com.



More information about the postgis-users mailing list