[mapguide-internals] MapGuide seems to check the extent of each table/view with a geometry column
monfardini at ldpgis.it
Thu Nov 14 02:25:54 PST 2013
I've recently seen a strange behavior using Ajax viewer and Mapguide 2.4.
We are using OGRProvider with a recompiled libgdal to support
In my database there is a quite complicated view with a geometry column,
which is needed to export some data in a very specific workflow.
This view has a well defined SRID and is not used in any MapGuide layer.
When I start Ajax viewer on a simple map that uses some other tables from
the same db, the viewer seems to hang for a lot of time.
What happens is that apparently MapGuide is issuing a SELECT
Extent('geometry') on all tables with a geometry columns.
When the extenct is done against the problematic view the database work for
a minute to respond to the query.
Apparently MapGuide waits for the result before serving the initial map
1. Is it true that MapGuide tries to find the extent of all the tables? And
if it's true, why? Maybe to acquire some metadata or to validate the
2. Is it a libOGR provider specific behavior or not?
3. Is there any way to prevent MapGuide from issuing this kind of query
alltogether or to limit them to the tables/views really used in the map?
I've found a simple and brutal workaround.
Apparently MapGuide issues the query only if the table has a valid SRID,
and check the SRID in the table public.geometry_columns.
So I've set in public.geometry_columns the SRID to -1 for that view (which
is the SRID for "unknown coordinate system" in PostGIS 1.x) and the problem
This workaround works only for Postgis 1.x since in PostGIS 2
public.geometry_columns is a view that reports the value of the SRID
directly from the table.
LdP Progetti GIS
email: monfardini at ldpgis.it
More information about the mapguide-internals