[mapserver-users] PHP mapscript $shape->buffer() takes alongtime

Steve Lime Steve.Lime at dnr.state.mn.us
Wed Nov 18 14:36:41 PST 2009


No, once you've got the shape it probably doesn't matter much. The patch associated
with #2753 would allow you to simplify in MapScript. It's not complete though as it's 
PHP only. Will pursue adding to 5.6...

Steve

>>> On 11/18/2009 at 4:30 PM, in message
<8BE0B8DC92AE4F3EACC4D17786C5232C at Worthlaptop>, "Worth Lutz"
<wal3 at mindspring.com> wrote:
> I need the buffered shape to draw it.  Once I have it does it make any
> difference is how I do the query?
> 
> Is the enhancement described in Ticket #2753 implemented in 5.6 for PHP
> mapscript?  Or will I need to take my shape to postGIS to simplify before
> buffer?
> 
> -----Original Message-----
> From: Steve Lime [mailto:Steve.Lime at dnr.state.mn.us] 
> Sent: Wednesday, November 18, 2009 9:35 AM
> To: ludwig at kni-online.de; mapserver-users at lists.osgeo.org;
> wal3 at mindspring.com 
> Subject: RE: [mapserver-users] PHP mapscript $shape->buffer() takes
> alongtime
> 
> You may not need to buffer at all. The shape query honors layer tolerances
> so
> you can find parcels within a certain distance. So if $layer->{tolerance} is
> 500
> and $layer->{toleranceunits} is 'meters' then your shape query will find all
> 
> features within 500 meters. If you don't need to draw the buffered shape
> then
> this might be a good option.
> 
> Steve
> 
>>>> "Worth Lutz" <wal3 at mindspring.com> 11/18/09 8:23 AM >>>
> I'm learning a lot here.
> 
> I now understand how to get the buffered geometry quickly.
> 
> I am using the buffered geometry to use PHP mapscript to select parcel
> intersecting the buffered geometry.
> 
> $layer->queryByShape($bufferedShape);
> 
> Are you telling me that there is a better/faster way to do this?
> 
> 
> 
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org 
> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Ludwig
> Kniprath
> Sent: Wednesday, November 18, 2009 3:01 AM
> To: mapserver-users at lists.osgeo.org 
> Subject: Re: [mapserver-users] PHP mapscript $shape->buffer() takes a
> longtime
> 
> We had the same problem. In deed the buffer-algorithm is very expensive,
> especially with large polygons and a large buffer-radius. If you use
> Postgis, you can simplify the Polygon with ST_Simplify or
> ST_SimplifyPreserveTopology in dependency from scale and buffer-radius, this
> will make the buffer-process much faster without significant loss of
> quality. You can do this on runtime on your original data with dynamic
> PostGIS-queries. If you don't use PostGis, you have to create simplified
> layers.
> 
> Pseudo-PHP-PostGIS-SQL:
> SELECT ...
> ST_SetSRID(ST_BUFFER(ST_SIMPLIFY($geometery_field,$simplify_tolerance),$buff
> er_radius, $number_of_segments),$srid)::geometry ...FROM...
> 
> And don't use the buffered polygon for geo-queries, there are faster ways in
> PostGIS and Mapserver.
> 
> Regards
> Ludwig Kniprath 
> 
>>
>>I'm trying to buffer a shape returned from a point query on a polygon layer
>>of parcels.
>>
>> 
>>
>>When I try to use:
>>
>> 
>>
>>$bufferedShape = $shape->buffer(200);
>>
>> 
>>
>>I get back a fatal error: Maximum execution time of 30 seconds exceeded.
>>
>>I know that this is a php error message and that I could increase the
>>allowable execution time.
>>
>> 
>>
>>If I use a buffer distance of 175 I get results.
>>
>> 
>>
>>Should it take such a long time to but a buffer around this parcel?  It is
> a
>>large parcel with one corner being a long curve like a quarter of a circle
>>and another section on one side being a half circle.
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org 
> http://lists.osgeo.org/mailman/listinfo/mapserver-users 
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org 
> http://lists.osgeo.org/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list