[postgis-users] Point calculation based on stationary distance

Simon Greener simon at spatialdbadvisor.com
Sat May 19 05:33:20 PDT 2012


Try something like this:

SELECT ST_AsEWKT(ST_PointN(ST_OffsetCurve(line1,5),ST_NPoints(line1))) as offset_point,
        ST_AsEWKT(ST_PointN(line1,ST_NPoints(line1)))                   as point_10m_on_line
   FROM (SELECT ST_GeometryN(ST_Split(the_line,
                                      ST_Line_Interpolate_Point(the_line,1.0/ST_Length(the_line))),
                             1) as line1
           FROM (SELECT ST_GeomFromEWKT('LINESTRING(25 50, 100 125, 150 190)') as the_line ) as a
        ) as f;

regards
Simon
On Sat, 19 May 2012 17:34:07 +1000, Uroš Bernik <uros.bernik at siol.net> wrote:

>
> Hello,
>
>
>
>
> A question: I have a linestring (polyline) for which i would like to calculate a point which is located on the polyline but a specific distance from the end or beggining of the polyline. Once this point is calculated >i would then like to calculate 2 points on both sides of the linestring, which are perpendicular to the line like this:
>
>
>
>
> [Description: cid:image001.jpg at 01CD3522.C7638240]
>
>
>
>
> Any idea how to do this? I didnt notice any function within postgis that deal with stationary distances which is what im looking for probably. Thanks for any advice!
>
>
>



-- 
Holder of "2011 Oracle Spatial Excellence Award for Education and Research."
SpatialDB Advice and Design, Solutions Architecture and Programming,
Oracle Database 10g Administrator Certified Associate; Oracle Database 10g SQL Certified Professional
Oracle Spatial, SQL Server, PostGIS, MySQL, ArcSDE, Manifold GIS, FME, Radius Topology and Studio Specialist.
39 Cliff View Drive, Allens Rivulet, 7150, Tasmania, Australia.
Website: www.spatialdbadvisor.com
   Email: simon at spatialdbadvisor.com
   Voice: +61 362 396397
Mobile: +61 418 396391
Skype: sggreener
Longitude: 147.20515 (147° 12' 18" E)
Latitude: -43.01530 (43° 00' 55" S)
GeoHash: r22em9r98wg
NAC:W80CK 7SWP3



More information about the postgis-users mailing list