[Geoserver-users] GETMAP POST WITH CQL_FILTER PARAMETER

Hi list!

I want to parse my get request to post request with all parameters.

http://XXXXXXXXXXXXXXX/Geoserver/wms?LAYERS=aaa%3ABBBBBB&GEOMETRY_COLUMN=LOCATION&FEATURENS=http%3A%2F%2Fwww.yyyy.cz%2Fabc&TRANSPARENT=true&FORMAT=image%2Fpng&STYLES=sld_aaa&CQL_FILTER=TYPE%20%3D%201&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A27492&BBOX=-89920.88750938741,-98306.97096979122,-89209.27020477188,-98066.10854430137&WIDTH=1492&HEIGHT=505

I obtained this post request but I doesn't known how can i put the
CQL_FILTER parameter in the xml... Someone have an example of post request
with the parameter CQL_FILTER?

<?xml version="1.0" encoding="ISO-8859-1"?><wms:GetMap service="WMS"
version="1.3.0" xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:ows="http://www.opengis.net/ows&quot;
xmlns:sld="http://www.opengis.net/sld&quot;
xmlns:wms="http://www.opengis.net/ows&quot;
xmlns:xlink="http://www.w3.org/1999/xlink&quot;
xmlns:ogc="http://www.opengis.net/ogc&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/ows
http://giswebservices.massgis.state.ma.us/geoserver/schemas/sld/GetMap.xsd&quot;&gt;
<sld:StyledLayerDescriptor version="1.0.0">
<sld:NamedLayer>
<sld:Name>aaa:BBBBBB</sld:Name>
<sld:NamedStyle><sld:Name>sld_ccc</sld:Name></sld:NamedStyle>
</sld:NamedLayer>
</sld:StyledLayerDescriptor>
<wms:BoundingBox srsName="EPSG#913900">
<gml:coord><gml:X>-89773.793857</gml:X><gml:Y>-98321.739757</gml:Y></gml:coord>
<gml:coord><gml:X>-89356.363856</gml:X><gml:Y>-98051.339757</gml:Y></gml:coord>
</wms:BoundingBox>
<wms:Output>
<wms:Format>image/png</wms:Format>
<wms:Transparent>false</wms:Transparent>
<wms:BGcolor>0xFFFFFF</wms:BGcolor>
<wms:Size>
<wms:Width>934</wms:Width>
<wms:Height>605</wms:Height>
</wms:Size>
</wms:Output>
<wms:Exceptions>application/vnd.ogc.se+inimage</wms:Exceptions>
</wms:GetMap>
--
View this message in context: http://www.nabble.com/GETMAP-POST-WITH-CQL_FILTER-PARAMETER-tp22607430p22607430.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Helder Brandao ha scritto:

Hi list!

Hi. Remember to subscribe before posting to the ml

I want to parse my get request to post request with all parameters.

http://XXXXXXXXXXXXXXX/Geoserver/wms?LAYERS=aaa%3ABBBBBB&GEOMETRY_COLUMN=LOCATION&FEATURENS=http%3A%2F%2Fwww.yyyy.cz%2Fabc&TRANSPARENT=true&FORMAT=image%2Fpng&STYLES=sld_aaa&CQL_FILTER=TYPE%20%3D%201&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A27492&BBOX=-89920.88750938741,-98306.97096979122,-89209.27020477188,-98066.10854430137&WIDTH=1492&HEIGHT=505

I obtained this post request but I doesn't known how can i put the
CQL_FILTER parameter in the xml... Someone have an example of post request
with the parameter CQL_FILTER?

There is a simple answer, you cannot. None of the vendor parameters
is supported in POST xml requests
Plus, GeoServer rimplements WMS 1.1, not WMS 1.3.
What is the reason you're trying to use XML POST? There are
other ways to deal with custom, big styles.

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

There is a simple answer, you cannot. None of the vendor parameters
is supported in POST xml requests
Plus, GeoServer rimplements WMS 1.1, not WMS 1.3.

Ok! Thank you! I had doubts about this question.

What is the reason you're trying to use XML POST? There are
other ways to deal with custom, big styles.

The reason is the query string length of HTTP GET, it's too big...

Now, i want to create layers with the HTTP POST properties.

Before, i had
var layer = new OpenLayers.Layer.WMS("title",
"http://localhost/Geoserver/wms&quot;, { layers: "aaa: BBB", transparent:
'true', format: "image/png", styles: "sld_AAAA"}, "ESPG#913900");

I known that i must create the mecanism to create the xml for http post but
my doubt is how can i execute the query???

--
View this message in context: http://www.nabble.com/GETMAP-POST-WITH-CQL_FILTER-PARAMETER-tp22607430p22622398.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Helder Brandao ha scritto:

There is a simple answer, you cannot. None of the vendor parameters
is supported in POST xml requests
Plus, GeoServer rimplements WMS 1.1, not WMS 1.3.

Ok! Thank you! I had doubts about this question.

What is the reason you're trying to use XML POST? There are
other ways to deal with custom, big styles.

The reason is the query string length of HTTP GET, it's too big...

Now, i want to create layers with the HTTP POST properties.

Before, i had
var layer = new OpenLayers.Layer.WMS("title",
"http://localhost/Geoserver/wms&quot;, { layers: "aaa: BBB", transparent:
'true', format: "image/png", styles: "sld_AAAA"}, "ESPG#913900");

I known that i must create the mecanism to create the xml for http post but
my doubt is how can i execute the query???

Eh, not so simple. OpenLayers as far as I know simply does not
work with POST requests, as far as I know.
Anyways, generally speaking, you can take a too big GET request and
turn it into a POST request with content type:
application/x-www-form-urlencoded
and GeoServer will handle it as the equivalent GET request.
Just not sure you can bend OL to make a POST request, afaik OL is just
creating image elements in the DOM and giving each the appropriate
GetMap URL. In that case, no POST request is allowed.

What (I believe) you need is some support for storing a
long filter on the server with a POST, get back an
identifier, and then use that as the way to express the
query in the WMS (something like ...&stored_filter_id=myStoredFilter).

We don't have such functionality but I believe it's possible
to code up one storing the filters in the http session.

If you have any java programming expertise we can try to get
you up to speed to add this kind of functionality, otherwise
you can contract someone to do the job for you, there
is a list of commercial support providers for GeoServer on
geoserver.org

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

We are facing a similar issue for one of our customers.

The solution we are following right now is to add a vendor parameter
to the WMS and build a Proxy between the client and GeoServer which
handles the users' requests and objects.

It would be useful in the future having time and some more sponsorship
to build a sort of "object" service which stores GeoServer large
objects, like filters, styles, etc... and allows it to retrieve them
by providing a sort of object_ID thgough the request.

Regards,
         Alessio.

-------------------------------------------------------
Eng. Alessio Fabiani
Vice-President /CTO GeoSolutions S.A.S.
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584 980933
fax: +39 0584 983027
mob: +39 349 8227000

http://www.geo-solutions.it

-------------------------------------------------------

On Mon, Mar 23, 2009 at 9:21 AM, Andrea Aime <aaime@anonymised.com> wrote:

Helder Brandao ha scritto:

There is a simple answer, you cannot. None of the vendor parameters
is supported in POST xml requests
Plus, GeoServer rimplements WMS 1.1, not WMS 1.3.

Ok! Thank you! I had doubts about this question.

What is the reason you're trying to use XML POST? There are
other ways to deal with custom, big styles.

The reason is the query string length of HTTP GET, it's too big...

Now, i want to create layers with the HTTP POST properties.

Before, i had
var layer = new OpenLayers.Layer.WMS("title",
"http://localhost/Geoserver/wms&quot;, { layers: "aaa: BBB", transparent:
'true', format: "image/png", styles: "sld_AAAA"}, "ESPG#913900");

I known that i must create the mecanism to create the xml for http post but
my doubt is how can i execute the query???

Eh, not so simple. OpenLayers as far as I know simply does not
work with POST requests, as far as I know.
Anyways, generally speaking, you can take a too big GET request and
turn it into a POST request with content type:
application/x-www-form-urlencoded
and GeoServer will handle it as the equivalent GET request.
Just not sure you can bend OL to make a POST request, afaik OL is just
creating image elements in the DOM and giving each the appropriate
GetMap URL. In that case, no POST request is allowed.

What (I believe) you need is some support for storing a
long filter on the server with a POST, get back an
identifier, and then use that as the way to express the
query in the WMS (something like ...&stored_filter_id=myStoredFilter).

We don't have such functionality but I believe it's possible
to code up one storing the filters in the http session.

If you have any java programming expertise we can try to get
you up to speed to add this kind of functionality, otherwise
you can contract someone to do the job for you, there
is a list of commercial support providers for GeoServer on
geoserver.org

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users