Opened 12 years ago

Closed 9 years ago

#1858 closed defect (fixed)

GETFEATUREINFO for line or points on MapGuide 2.2

Reported by: mapaquin Owned by:
Priority: high Milestone: 3.0
Component: WMS Interface Version: 2.2.0
Severity: trivial Keywords: Point Lines WMS GETFEATUREINFO
Cc: External ID:

Description

When making a GETFEATUREINFO info on a point or line layer published via MapGuide WMS, nothing is returned.

At first I thought it was a precision issue as there is no "Tolerance" value that can be passed in regards of the pixel point that is sent with the request. But after doing numerous precise tests on specific pixels points I was enable to get a response with feature info from MapGuide.

We did our tests with the Sheboygan sample dataset by publishing the "Roads" layer via WMS.

Here are two examples of tests we did using the MapGuide agent webpage (.../mapguide/mapagent/index.html) that can easily be replicated:

Request: GETFEATUREINFO Service: WMS Version: 1.1.1 Image Format: image/png Info Format: text/xml Map Layers (comma-separated): Samples/Sheboygan/Layers/Roads Query Layers (comma-separated): Samples/Sheboygan/Layers/Roads Query Point X (pixels from left): 319 (Test 317-321) Query Point Y (pixels from top): 522 (Test 520-524) Bounding Box (minx,miny,maxx,maxy): -87.72673306169291,43.738909323497694,-87.72558891118628,43.73972724154777 Coordinate System: EPSG:4326 Display Width (pixels): 796 Display Height (pixels): 717

Request: GETFEATUREINFO Service: WMS Version: 1.1.1 Image Format: image/png Info Format: text/xml Map Layers (comma-separated): Samples/Sheboygan/Layers/Roads Query Layers (comma-separated): Samples/Sheboygan/Layers/Roads Query Point X (pixels from left): 319 (Test 317-321) Query Point Y (pixels from top): 9 (Test 7-11) Bounding Box (minx,miny,maxx,maxy): -87.72761000876332,43.74429248842982,-87.72758091682283,43.7443132853644 Coordinate System: EPSG:4326 Display Width (pixels): 796 Display Height (pixels): 717

I've tried sending a range of pixels that are close to the ones sent above without any success. These pixel coordinates were determined by doing a a "GETMAP" request using the same parameters as above and using a drawing software to determine the exact pixel position of the line feature.

P.S. When this defect will be corrected, this functionality would still be nearly unusable because of the amount of precision required from a mouse click. May a suggest adding a "Tolerance" parameter in pixels.

Attachments (1)

Fix1858.patch (2.5 KB ) - added by ChristineBao 9 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by zspitzer, 12 years ago

can you post the actual urls for the requests?

WMS has been heavily revised in trunk, this may have already been fixed

comment:3 by mapaquin, 12 years ago

This tricket has been open for over 3 months, has the bogue been a aknowledged? If so, are there any plans to fix it or is it already fixed in a future release?

Thanks

Marc

comment:4 by mphaneuf, 12 years ago

Maybe the following function MgGeometry* MgHttpWmsGetFeatureInfo::GetSelectionGeometry(MgMap* map) in /trunk/MgDev/Web/src/HttpHandler/HttpWmsGetFeatureInfo.cpp should be modified to take a small buffer into account.

The calculation for the geometry is done using a single pixel. Including rounding errors, it is highly unlikely that this would work using a single point. Perhaps a buffer done by adding N pixels around the pixel and then creating a polygon, instead of a point. It would fix the issue.

comment:5 by beginbenoit, 12 years ago

Perhaps the following patch would be useful to get this resolved.

MgGeometry* MgHttpWmsGetFeatureInfo::GetSelectionGeometry(MgMap* map)
{
    MgGeometry* selectionGeometry = NULL;

    // Get the lower left and upper right map coords in MCS
    Ptr<MgEnvelope> mcsExtent = map->GetMapExtent();
    Ptr<MgCoordinate> mcsLowerLeft = mcsExtent->GetLowerLeftCoordinate();
    Ptr<MgCoordinate> mcsUpperRight = mcsExtent->GetUpperRightCoordinate();

    // Convert the pixel coords to MCS coords
    double mcsMinX = mcsLowerLeft->GetX() + ((double)m_iCoord - 2) * mcsExtent->GetWidth() / map->GetDisplayWidth();
    double mcsMinY = mcsUpperRight->GetY() -((double)m_jCoord - 2) * mcsExtent->GetHeight() / map->GetDisplayHeight();

    double mcsMaxX = mcsLowerLeft->GetX() + ((double)m_iCoord + 2)* mcsExtent->GetWidth() / map->GetDisplayWidth();
    double mcsMaxY = mcsUpperRight->GetY() -((double)m_jCoord + 2) * mcsExtent->GetHeight() / map->GetDisplayHeight();

    // Create a new MgPoint representing these coordinates
    Ptr<MgGeometryFactory> geometryFact = new MgGeometryFactory();
    Ptr<MgCoordinateCollection> linearRingCoords = new MgCoordinateCollection();

    linearRingCoords->Add(new MgCoordinateXY(mcsMinX, mcsMinY));
    linearRingCoords->Add(new MgCoordinateXY(mcsMinX, mcsMaxY));
    linearRingCoords->Add(new MgCoordinateXY(mcsMaxX, mcsMaxY));
    linearRingCoords->Add(new MgCoordinateXY(mcsMaxX, mcsMinY));
    linearRingCoords->Add(new MgCoordinateXY(mcsMinX, mcsMinY));

    Ptr<MgLinearRing> linearRing = geometryFact->CreateLinearRing(linearRingCoords);
    selectionGeometry = geometryFact->CreatePolygon(linearRing, NULL);

    return selectionGeometry;
}

comment:6 by jng, 12 years ago

Milestone: 2.4

comment:7 by jng, 12 years ago

Milestone: 2.42.5

by ChristineBao, 9 years ago

Attachment: Fix1858.patch added

comment:8 by ChristineBao, 9 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.