[mapserver-users] converting line object to series of points
Mark Brooks
mark_brooks at ncsu.edu
Thu Apr 15 10:07:14 PDT 2010
Thanks for your insights and help.
The lines I'm working with will have multiple points. They are
hurricane tracks. The tracks are made of points, about 3-12 hours
apart. Therefore, sometimes the points are close and other times very
far away from each other. I can easily connect the track points to
create a line. But I need the points in between each observation so
that I can determine what county landfall occurs. The y=mx+b method
will work, but I was hoping there may be an easier to do it. Or perhaps
I'm making the problem too complicated to begin with??
Mark
Bob Basques wrote:
> 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
More information about the MapServer-users
mailing list