ThinkGeo.com    |     Documentation    |     Premium Support

Wms Layer Types for Line, Point, Polygon

MapSuite Team,

Is it possible to have the WMS Server send the actual data contained in a shape file (line, point, Polygon) to a WMS Client for the requested extent? And the client would render the map. Or are only images supported by a WMS Server?

Thanks,
Dennis

Hi Dennis,

The WMS server support three types request:
GETCAPABILITIES
GETMAP
GETFEATUREINFO

I think the GETFEATUREINFO is what you want, you can use that like this:

WmsRasterLayer layer2;
layer2.GetFeatureInfo(new ScreenPointF(e.ScreenX, e.ScreenY), “text/html”, 1);

And you should want to return what you want in the GetCapabilitiesCore of plugin.

Regards,

Ethan

hi Ethan,

What does one then do with the results of the GetFeatureInfo? Is there anything to do or will it then be rendered?

Thanks,
Dennis

Hi Dennis,

You can think it’s just a web service, so the return result is decided by the code you write in the GetCapabilitiesCore of plugin.

You can parse the coordinates from parameter, then find target feature in your layer, and return the layer back.

I think you can return any format you want for example WellKnownText.

So your client side can get the string and parse it to valid shape.

Regards,

Ethan

Ethan,

Do I understand this correctly in that WKT would be returned to client and then client would populate an InMemoryFeatureLayer?

It appears that WKT only deals with the shape. What about other features of the shape such as a column used for a label?

Can you provide any sample code that shows what is done on the client and the server?

Seems to me there is an awful lot of work to display points from a WMS Server on a client.

Thanks,
Dennis

Hi Dennis,

In other topic you mentioned your client side is our WPF map, so you can do that by GeoSerializer, you can pass the stringFeature instead of WKT. As below is a sample code shows how to use it:

        Feature testF = new Feature(new PointShape(1, 1));
        testF.Id = "testF";
        testF.ColumnValues.Add("name", "feature1");

        GeoSerializer s = new GeoSerializer();
        string stringFeature = s.Serialize(testF); 

        Feature deTestF = s.Deserialize(stringFeature) as Feature; // Do this in client side

Wish that’ helpful.

Regards,

Ethan

hi Ethan,

Yes, that is helpful. GeoSerializer is much more useful.

Would you please provide a GetCapabilitiesCore method with your example code?

Thanks,
Dennis

Hi Dennis,

GetCapabilitiesCore is works for get capability xml, I don’t suggest you use it to implement the communication between client side and server side.

I think you should want to use GetFeatureInfo, but we don’t have related sample for this function. You can try to implement it just like the other functions GetMap and Getcapability.

Regards,

Ethan

Ethan,

I’m kind of surprised there is not an out-of-the-box api set to render line/point/polygon layers from a WMS Server. Even though it may not be a standard it should be!

Why doesn’t ThinkGeo provide this capability? Granted it would be non-standard, but who cares.

Does TMS or WMTS provide this ability?

Dennis

Hi Dennis,

The TMS and WMTS is focus on tile image, and I think the GetFeatureInfo can be used for your scenario.

You can easily implement that like this:

    protected override string GetFeatureInfoCore(GetFeatureInfoRequest getFeatureInfoRequest, MapConfiguration cachedMapConfiguration, System.Web.HttpContext context)
    {
        // Your code
        return base.GetFeatureInfoCore(getFeatureInfoRequest, cachedMapConfiguration, context);
    }

But you also need to write code to render the return value by your custom code.

And in our coming GisServer, we will support return serialized object instead of tile image.

Regards,

Ethan

hi Ethan,

Thanks for the information. I will move forward and see what I can put together.

Thanks,
Dennis
OriStar Mapping, Inc.

Hi Dennis,

Any question please let us know.

Regards,

Ethan

Hi Ethan,

In this thread you mention “in our coming GisServer”. When is it scheduled for release and do you have any documentation that describes its’ features?

Regards,
Dennis

Hi Dennis,

Our sales had replied your question in email, please check it.

Regards,

Ethan