[postgis-users] computing the center of a Linestring ?

Obe, Regina robe.dnd at cityofboston.gov
Thu Oct 16 04:38:59 PDT 2008


Smith,
 
Take a look at the Linear Referencing functions.  To get the center
point that is guaranteed to fall on the line, I would use
ST_line_interpolate_point(linestring, 0.5)
 
http://postgis.refractions.net/documentation/manual-svn/ch06.html#id2616
367
 
Be forewarned the above link will be changing soon since the SVN manual
is a moving target and will be added more examples shortly.
 
Hope that helps,
Regina

________________________________

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Smith Roman
Sent: Thursday, October 16, 2008 7:28 AM
To: Users Postgis
Subject: [postgis-users] computing the center of a Linestring ?


HI,
I have a base map of lagos, Nigeria that contains roads, streets and
points of interest (POI). Unfortunately the street addresses are not
geocoded. I was told they are possible ways to geocode such kind of data
e.g. geocode to a street name, geocode to a street intersection and/or
point of interest.
 
I will like to ask what postgis functions can be used to do this kind of
operation ? 
 
For example, If I intend geocoding to a street name, this will imply
assigning point coordinates to represent each street, to this i will
need to get the center point of each street. By their nature streets and
roads are not straight.
 is there a postgis function for computing the center of a Linestring ?
especially if the linestring is not straight but has a few curves. All
the roads and streets are represented as linestrings in my data.
 
It will be appreciated if I can get suggestions on the geocoding method
to use and how postgis can be used to implement it. 
 
Thanks, 
 
Smith.



-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20081016/2d9cc1f7/attachment.html>


More information about the postgis-users mailing list