[mapguide-users] Making Tiles

George McLean gmclean at gorge.net
Wed Feb 13 09:53:20 EST 2008


Hello,

I am trying to use mapguide to create a large set of tiles that are 
compatible with google maps. I have a php script that will create the 
tiles and it appears to run fine but when I try and create a large set 
of tiles, I end up getting some tiles that are transparent. I do not get 
an error while my script is running but if I try and create another set 
of tiles after the script finishes, I get the following error:

Error: Out of Memory in NsSAX2Reader parse File: 
..\src\dbxml\nodeStore\NsSAX2Reader.cpp Line: 352
An Exception occurred in method 
MgResrouceDefinitionManager.ValidateDocument at line 429 in file
c:\build_bond_area\mapguide_open_source_v1.2\build_18.1\mgdev\server\src\resource\ResourceDefinitionManager.cpp

It is not consistent in how many tiles are transparent, but I have had 
some transparent tiles in sets as small as 1000 tiles.

I am running on MGOS 1.2 on XP with apache and PHP. The PC has 2gb of 
RAM and has a 1.5mhz core 2 duo processor. In the server.cfg I changed 
the rows and columns per folder to 512.

Any suggestions on how to trap the transparent tiles while they are 
created or how to fix this?

Thanks

George McLean

My PHP script is below:


<?
    require_once 'common_locations.php';
    include 'c:\program 
files\MapGuideOpenSource\WebServerExtensions\www\mapviewerphp\constants.php';
    try
    {
          $mgMapName = "umsfdo";
          MgInitializeWebTier("$extensionsDir\webconfig.ini");
        // Get the user information using the session id,
        // and set up a connection to the site server.
        $userInfo = new MgUserInformation("Administrator", "admin");
        $site = new MgSite();
        $site->Open($userInfo);
        $mgSessionId = $site->CreateSession();
        $userInfo = new MgUserInformation($mgSessionId);
        $siteConnection = new MgSiteConnection();
        $siteConnection->Open($userInfo);

        // Get an instance of the required service(s).
        $resourceService = $siteConnection->
            CreateService(MgServiceType::ResourceService);
        $featureService = $siteConnection->
            CreateService(MgServiceType::FeatureService);
        // Display the spatial reference system used for the map
        $map = new MgMap();
                $resourceID = new 
MgResourceIdentifier('Library://Gtest/Map/GoogleElipse.MapDefinition');
        $map->Create($resourceService, $resourceID, $mgMapName);
   
        $mgTileServer = 
$siteConnection->CreateService(MgServiceType::TileService);
   
        $tileSize = $mgTileServer->GetDefaultTileSizeX();
        for ($col = 100 ; $col < 112; $col++)
        {
                  for ($row = 0; $row < 256; $row++)
          {
                    $mgTileServer->GetTile($resourceID, 'Base Layer 
Group', $col, $row, 2);
                    echo 'Tile Built: '.$col.' '.$row;
          }
        }
    }
    catch (MgException $e)
    {
         echo "Error!";
         echo $e->GetMessage();
        echo $e->GetDetails();
    }

       
?>




More information about the mapguide-users mailing list