[OSGeo-Discuss] [mapserver-dev] [discuss] featurereader, tileservice, map.open() problem

Áron Deák deakaron at gmail.com
Tue Mar 11 09:20:14 PDT 2008

Hello everybody,

I am new to mapguide. I am writing a java thick client map application using
MapGuide Open Source as map server. I query images from the map server, this
part works pretty well, not  fast enought tough.

My problem is that I also need to be able to read the feature data in order
to be able to provide some simplified geocoding service as well, but I can't
get the feature reader to work, I also need the tile service because
rendering images takes a lot of time and even implementing tile caching in
the program is not enough, so I would like to use MapGuide's tile service as
well reading tile data through  MgByteReader in a similar way as reading
arbitrary sized images.

I have problem running even the simplest sample codes, eg. map.Open()
function throws an exception so I have to use map.Create() to open a map and
I am thinking that this might be the root of my problems.

Here is how my code works: (simplified) I have followed instruction from the
GettingStartedGuide.pdf to the letter when installing the MapGuide server

try {
            MgUserInformation userInfo = new MgUserInformation("Anonymous",
            mapDefid = new MgResourceIdentifier(
            MgSite site = new MgSite();
            String sessionId = site.CreateSession();
            MgSiteConnection siteConnection = new MgSiteConnection();
            MgResourceService service = (MgResourceService) siteConnection
            MgMap map;
            map = new MgMap();
            MgRenderingService renderingService = (MgRenderingService)
            MgFeatureService featureService = (MgFeatureService)
            MgTileService tileService = (MgTileService) siteConnection
            MgResourceService resourceService = (MgResourceService)
            map.Create(resourceService, mapDefid, "MyMap");
             * Opening map throws exception
    //        map.Open(resourceService, "Sheboygan");
            MgResourceIdentifier districtsId = new MgResourceIdentifier(

             * Selecting features throws exception
//            featureService.SelectFeatures(districtsId, "VotingDistricts",
//                     new MgFeatureQueryOptions(), "Sheboygan");
             * Reading a certain area of the map as an image file stream
works fine
            MgByteReader reader = this.mapGuideResourceManager
                    this.mapGuideResourceManager.getSelection(), env,
                    (int) renderSpec.getImageSize().getWidth(),
                    (int) renderSpec.getImageSize().getHeight(),
                    new MgColor((short) 0, (short) 0, (short) 0xff),
        } catch (MgException ex) {

Any help or ideas would be appreciated, now I am stuck with the development
because of these problems.


aron deak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/discuss/attachments/20080311/419c62e3/attachment-0002.html>

More information about the Discuss mailing list