[mapserver-users] converting line object to series of points
Bob Basques
Bob.Basques at ci.stpaul.mn.us
Thu Apr 15 08:56:38 PDT 2010
All,
If you don't care about the actual coordinates of the points along the line (just trying to display things) I wonder if a linetype/combined with a scaling option would get you what you are looking for.
bobb
>>> Andy Colson <andy at squeakycode.net> wrote:
On 4/15/2010 10:51 AM, Mark Brooks wrote:
> I'm using PHP Mapscript. I need a point every X meters along the line.
>
> Mark
>
>
> Andy Colson wrote:
>> On 4/15/2010 10:24 AM, Mark Brooks wrote:
>>> I have a line object that I need to to turn into points. How can I
>>> create a series of points from the line object?
>>>
>>> Mark
>>> NC State University
>>
>> A line has many many points. Which are you interested in? Just the
>> first and last? Any one point on the line? The mid-point? A point
>> every meter along the line? The closes point on the line to some other
>> object?
>>
>> I know of two options:
>> 1) use PostGIS:
>> select st_centroid(the_geom) from layer
>>
>> 2) use mapscript
>>
>>
>> -Andy
>
Does the line have a single start and end point? (a MULTILINE record
can have multiple lines (so multiple start and end points, all stuck
togethor).
In general, find the start and end points, use them to find the equation
of the line (y=mx+b if I recall correctly), then use that equation to
find one corrd based on another. (so, plug in a buch of x's to find
their y's).
-Andy
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100415/41919cf2/attachment.htm>
More information about the MapServer-users
mailing list