[OpenLayers-Users] boundaries of lineString

Tim Schaub tschaub at openplans.org
Tue Feb 19 17:07:52 EST 2008


Hey-

Rupesh M G wrote:
> 
> Hi,
> 
>         Could you please tell me how to buffer a lineString, and get the 
> vertices of a polygon from it?
> 

Currently, there is not a way to buffer geometries on the client side 
with OpenLayers.  You can send your geometry to a buffering service 
somewhere (search for "webprocessingservice" or something similar).

I have put together a rough buffer operation that works with OpenLayers 
geometries:
http://dev.openlayers.org/sandbox/tschaub/geom/examples/geometry-buffer.html

There are plenty of issues with this (no simplification to remove 
self-intersections).  I'll be improving this and putting together an 
external lib to do this over the next week or so.

Tim

> Thanks & Regards,
> Rupesh
> 
> 
> 
> *users-request at openlayers.org*
> Sent by: users-bounces at openlayers.org
> 
> 02/12/2008 09:34 PM
> Please respond to
> users at openlayers.org
> 
> 
> 	
> To
> 	users at openlayers.org
> cc
> 	
> Subject
> 	Users Digest, Vol 17, Issue 13
> 
> 
> 	
> 
> 
> 
> 
> 
> 
> 
> ------------------------------
> 
> Message: 8
> Date: Tue, 12 Feb 2008 10:52:21 -0500
> From: Tim Schaub <tschaub at openplans.org>
> Subject: Re: [OpenLayers-Users] boundaries of lineString
> Cc: users at openlayers.org
> Message-ID: <47B1C0B5.4080006 at openplans.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Hey-
> 
> Rupesh M G wrote:
>  >
>  >         Thank you for the reply. But I think it is not correct.
>  >
>  > For example, if I draw the linestring with 4 points, I'm able to see a
>  > polygon with 8 vertices.
> 
> A linestring geometry with 4 points has 4 points.  When you see it
> rendered, it looks like a polygon to you, but the geometry is just a
> linestring.
> 
> It sounds like you're talking about buffering a geometry.  When you
> buffer a linestring geometry, you get a polygon geometry.
> 
> Tim
> 
>  >
>  > But if I print the components.length of the linestring, it just says 4.
>  >
>  > I tried it with the example in the url
>  > http://openlayers.org/dev/examples/vector-features.html
>  >
>  >
>  > Regards,
>  > Rupesh
>  >
>  >
>  >
>  > *"Pierre GIRAUD" <bluecarto at gmail.com>*
>  >
>  > 02/11/2008 03:58 PM
>  >
>  >                  
>  > To
>  >                  "Rupesh M G" <RupeshM at ibsplc.com>
>  > cc
>  >                  users at openlayers.org
>  > Subject
>  >                  Re: [OpenLayers-Users] boundaries of lineString
>  >
>  >
>  >                  
>  >
>  >
>  >
>  >
>  >
>  > It should be quite easy because geometry like lineString and Polygon
>  > are composite geometries.
>  > For example, a OpenLayers.LineString has a 'components' property which
>  > is an array of OpenLayers.Points.
>  > That way, you can get all the vertices using a loop like following :
>  >
>  > for(var i=0; i <= thelinestring.components.length; i++) {
>  >    // do something with thelinestring.components[i] which is an OL point
>  > }
>  >
>  > Regards,
>  > Pierre
>  >
>  > On Feb 11, 2008 9:02 AM, Rupesh M G <RupeshM at ibsplc.com> wrote:
>  >  >
>  >  > Hi,
>  >  >
>  >  >         I'm working on an application about roads. There I need to 
> mark a
>  >  > part of the road, and execute some query.
>  >  >
>  >  > My user will click a set of points to form a sequence of lines passing
>  >  > through the center of the road, because there can be bends in the 
> road.
>  >  >
>  >  > I plan to draw a lineString going through these points. Using a bigger
>  >  > strokeWidth, I can show it like a road (or like a filled polygon).
>  >  >
>  >  > Is there any way to get the vertices of that polygon?
>  >  >
>  >  >
>  >  > Thanks & Regards,
>  >  > Rupesh
>  >  >
>  >  >
> 
> ------------------------------
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 
> End of Users Digest, Vol 17, Issue 13
> *************************************
> 
> 
> 
> 
> _
> 
> DISCLAIMER:__ _
> 
> "The information in this e-mail and any attachment is intended only for 
> the person to whom it is addressed and may contain confidential and/or 
> privileged material. If you have received this e-mail in error, kindly 
> contact the sender and destroy all copies of the original communication. 
> IBS makes no warranty, express or implied, nor guarantees the accuracy, 
> adequacy or completeness of the information contained in this email or 
> any attachment and is not liable for any errors, defects, omissions, 
> viruses or for resultant loss or damage, if any, direct or indirect."
> 
> 
> 
> 
> 
> 
> _
> 
> DISCLAIMER:__ _
> 
> "The information in this e-mail and any attachment is intended only for 
> the person to whom it is addressed and may contain confidential and/or 
> privileged material. If you have received this e-mail in error, kindly 
> contact the sender and destroy all copies of the original communication. 
> IBS makes no warranty, express or implied, nor guarantees the accuracy, 
> adequacy or completeness of the information contained in this email or 
> any attachment and is not liable for any errors, defects, omissions, 
> viruses or for resultant loss or damage, if any, direct or indirect."
> 
> 
> 
> 
> !DSPAM:4033,47b509e0243231637810514!
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 
> !DSPAM:4033,47b509e0243231637810514!




More information about the Users mailing list