[mapserver-users] Buffer features?
Lime, Steve D (DNR)
Steve.Lime at state.mn.us
Tue Feb 15 09:21:55 PST 2011
Not quite, I’m thinking of a single layer setup:
LAYER
DATA myfile.shp # or whatever connection information is necessary
TYPE POLYGON
STATUS DEFAULT
NAME ‘buffered_shapes’
GEOMTRANSFORM (buffer([shape], 500)) # buffer each shape by 500 map units
# classes and styles follow
TEMPLATE ‘void’
END
The GEOMTRANSFORM would be applied as shapes are pulled from a data source so you would draw or, potentially, query the transformed shapes. The difference between a layer-level GEOMTRANSFORM and a style-level one is the coordinates they operate on. Layer-level work would be done on a raw feature in map coordinates and style-level works on pixels. We do layer-level stuff already, conceptually, in the form of projections and clipping. The GEOMTRANSFORM just provides a way of extending that work…
Note this type of GEOMTRANSFORM expression is working for buffers in STYLEs in trunk (but using pixels for the moment).
Steve
From: Tamas Szekeres [mailto:szekerest at gmail.com]
Sent: Tuesday, February 15, 2011 11:12 AM
To: Lime, Steve D (DNR)
Cc: mapserver-users
Subject: Re: [mapserver-users] Buffer features?
Steve,
Did you mean to achieve something like?:
LAYER
CONNECTIONTYPE TRANSFORM
CONNECTION sourcelayer # reference to another layer
NAME transformlayer
PROCESSING "TRANSFORM=(buffer([shape]))"
TEMPLATE query.html
....
END
LAYER
CONNECTIONTYPE SHAPE
DATA myfile.shp
NAME sourcelayer
....
END
Which is simple and easy to implement.
Best regards,
Tamas
2011/2/15 Lime, Steve D (DNR) <Steve.Lime at state.mn.us<mailto:Steve.Lime at state.mn.us>>
I’d approach RFC 22, especially the transform piece, differently now with the parser changes implemented in 6.0. We now have (with GEOS enabled) an expression syntax available to support things like buffering, convex hull, differences, etc… or combinations thereof. I’d implement layer-level GEOMTRANSFORMs in that case using these expressions.
On the query result side of things I’d consider adding a layer template as a layer option. This would kinda work like the approach outlined for Bob. You’d define a presentation template layer (no DATA value) and run the query results through it instead of the regular layer (for certain querymap types, e.g. highlight).
Steve
From: mapserver-users-bounces at lists.osgeo.org<mailto:mapserver-users-bounces at lists.osgeo.org> [mailto:mapserver-users-bounces at lists.osgeo.org<mailto:mapserver-users-bounces at lists.osgeo.org>] On Behalf Of Tamas Szekeres
Sent: Tuesday, February 15, 2011 3:06 AM
To: Bistrais, Bob
Cc: mapserver-users
Subject: Re: [mapserver-users] Buffer features?
In accordance with the problem mentioned, I recall a resonable enhancement as described in RFC22a<http://www.mapserver.org/development/rfc/ms-rfc-22a.html> which would provide an option to configure all the stuff in the mapfile (not requiring MapScript) and would make it easier to customize the query maps as well.
With this enhancement 2 new layer data providers could be implemented, like:
1. CONNECTIONTYPE=QUERYRESULT would provide to represent the result sets of one layer in a new layer.
2. CONNECTIONTYPE=TRANSFORM would provide simple geometry transformations on a source layer and then provide the modified features as a new layer.
By chaining these layers together in a map configuration we could get such results<http://trac.osgeo.org/mapserver/attachment/ticket/2128/sample4.png> as included in the RFC document.
I consider this kind of enhancement could be implemented within the scope of 1-2 days of work (comparable with a fully elaborated MapScript solution providing the same)
Best regards,
Tamas
2011/2/14 Bistrais, Bob <Bob.Bistrais at maine.gov<mailto:Bob.Bistrais at maine.gov>>
This question may have come up before, but I haven’t found it in the archives. I would like to take a selected feature and buffer it to a specified distance. I know it’s possible to do a queryByPoint with a buffer distance, but I need to create an actual buffer shape to display on the map. Has anyone done something like this before? Does MapServer have this capability?
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org<mailto: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/20110215/43e194df/attachment.htm>
More information about the MapServer-users
mailing list