[mapserver-users] This seems like a dumb question, how do I convert ST_EXTENT (POSTGIS) results back into a Geometry for Mapsever?

Basques, Bob (CI-StPaul) bob.basques at ci.stpaul.mn.us
Mon Aug 11 12:50:05 PDT 2014


All,

answering my own question . . .

Geez, was that involved . . . .

I get a (real polygon) geometry from this:

select
           st_transform(
                st_setSRID(
                    st_extent(
                        the_geom
                            )::geometry, 200068
                        ), 3857i
                    ) as boundingp
from
            loc_last
where
            vname in ('2293','2297')


bobb






On 8/11/14 1:04 PM, Basques, Bob (CI-StPaul) wrote:
Racked my brain on this last Friday, couldn't get anything to work from a Mapserver Mapfile.

I can get the numbers from POSTGIS just fine via PGADMIN, but they come back as a BOX entity which MapServer doesn't seem to know what to do with.   I tried casting but got no matching records.

MAPFILE fragment . . .

DATA "the_geom from (

                        select
                                st_extent(sub1.the_geom)::geometry as the_geom
                        from
                                loc_last as sub1
                        where
                                vname in (%asset_id%)  -- vname in ('2293','2297')

                        ) as subquery using unique the_geom using srid=200068"

In pgadmin, the above select returns polygon (per st_astext applied)  The subselect is grabbing a couple of points based on asset_id(s).

Thanks

bobb




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140811/624fd114/attachment.html>


More information about the mapserver-users mailing list