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

Fred Lehodey lehodey at gmail.com
Mon Jan 9 10:19:48 PST 2012


Hi Gery,
here an example for scenario (a)

SELECT ST_Astext(ST_Line_Interpolate_point (the_geom,ser::float/20)) as
points
FROM (SELECT  ST_GeometryFromText('LINESTRING(0 0,1000 0)') as the_geom) as
foo1,
generate_series(1,20,1) as ser

You can easily make a function....

HTH,
Fred



On Mon, Jan 9, 2012 at 5:48 PM, Gery . <gamejihou at hotmail.com> wrote:

>
>
> Hello,
>
> I was looking in internet a way to sample my line shapefile based on my
> onw decision, for instance, my line is 1-km long and I want three
> scenarios: (a) 1 point every 50 meters (20 points including starting and
> ending points), (b) 1 point every 20 meters (50 points including starting
> and ending points), (c) 1 point every 10 meters (100 points including
> starting and ending points).
>
> I appreciate your ideas about it.
>
> Thanks,
>
> Gery
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120109/ed694d20/attachment.html>


More information about the postgis-users mailing list