Opened 13 years ago

Last modified 12 years ago

#3678 new enhancement

Render Polygons as 3D Buildings

Reported by: woodbri Owned by: sdlime
Priority: normal Milestone: 6.0 release
Component: MapServer C Library Version: unspecified
Severity: normal Keywords:
Cc: mko, dmorissette, nhermann

Description

I have a polygon layer with the building outlines and a height attribute. I would like to render these as nice buildings like Google does?

I can preprocess the data and extrude it into 3D shapes, but I'm not sure that gets me anywhere.

My one thought was to draw the polygon, then draw it again with an xy offset based on a function of the height. But this does not generate the vertical edges of the building.

I suppose I could generate all the vertical faces and the top of the build and then sort them all based on the z value of the centroid. I could event remove all the back facing polygons faces.

It would be cool if mapserver had:

LAYER
   TYPE POLYGON3D
   HEIGHT [height]
   ...
END

Steve Lime said:

Maybe this is a GEOMTRANSFORM function in 6.0 speak? You could do something like:

GEOMTRANSFORM (extrude(some view parameters, [height]))

Where the first few arguments define a view position and the last argument is height. Neat thing about this approach that height could be a constant or a bound to an attribute. The extrude function would generate the sides, top and bottom based on view parameters and a height. It could even (perhaps) create multiple features mirrored on the outline but with extended attributes that would define things like top vs. side vs. bottom, or whether a facet side is visible or not.

If done outside of STYLEs (e.g. a layer-level GEOMTRANSFORM) then one could draw things differently based on these pseudo attributes (e.g. if a side and visible do this).

Change History (5)

comment:1 by mko, 13 years ago

Cc: mko added

comment:2 by sdlime, 13 years ago

Just a note, a layer-level GEOMTRANSFORM would (in this case) have to return a feature collection with those being rendered in turn...

Steve

comment:3 by dmorissette, 13 years ago

Cc: dmorissette added

comment:4 by nhermann, 13 years ago

Cc: nhermann added
Note: See TracTickets for help on using tickets.