[Geoserver-users] How to getMap with POST data in PHP???

I use PHP for my map, so I want to get an image of map, but my request is too long, thus I can’t use URL request. I must post request data to Geoserver, but I don’t know how to post to and get an image from Geoserver. Who can show me? Thank you so much.


Nguyễn Đình Toán


Neu khong doc duoc tieng Viet, vui long vao menu View → chon Encoding → chon Unicode (UTF-8). Cam on.

Hi,

If you check out the sample requests page and look at the WMS_getMap_inlineFeature.xml, you will see an example of how to make a GetMap request with a POST.

Hope that helps.

-Justin

Toan Nguyen wrote:

I use PHP for my map, so I want to get an image of map, but my request is too long, thus I can't use URL request. I must post request data to Geoserver, but I don't know how to post to and get an image from Geoserver. Who can show me? Thank you so much.

--
   Nguyễn Đình Toán

-------------------------
Neu khong doc duoc tieng Viet, vui long vao menu View --> chon Encoding --> chon Unicode (UTF-8). Cam on. !DSPAM:4007,47d49a6e157151637810514!

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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

!DSPAM:4007,47d49a6e157151637810514!

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

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,47d49a6e157151637810514!

I know that. But in this example, request is posted to http://localhost:8080/geoserver/testwfs and it is submited in a frame.
If I use Javascript to post request through XMLHttpRequest object, I down’t know how to make a image from response.
And, I want to use PHP to post request and get that image to print it into PDF file.

On Mon, Mar 10, 2008 at 10:55 PM, Justin Deoliveira <jdeolive@…1…> wrote:

Hi,

If you check out the sample requests page and look at the
WMS_getMap_inlineFeature.xml, you will see an example of how to make a
GetMap request with a POST.

Hope that helps.

-Justin


Nguyễn Đình Toán


Neu khong doc duoc tieng Viet, vui long vao menu View → chon Encoding → chon Unicode (UTF-8). Cam on.

You should be able to post directory to http://…/geoserver/wms. Something like the following (note the OutputFormat element specified in the near the end).

As for how exactly to read the image or pdf that is returned in php... i am not sure off the top of my head, perhaps someone more familiar with php libraries can lend some guidance.

-Justin

<?xml version="1.0" encoding="UTF-8"?>
<ogc:GetMap xmlns:ogc="http://www.opengis.net/ows&quot;
             xmlns:gml="http://www.opengis.net/gml&quot;
             version="1.2.0"
             service="WMS">

   <StyledLayerDescriptor>
     <NamedLayer>
       <Name>topp:states</Name>

       <UserStyle>
         <FeatureTypeStyle/>

       </UserStyle>

     </NamedLayer>

   </StyledLayerDescriptor>

   <BoundingBox>
     <gml:coord>
       <gml:X>-180</gml:X>
       <gml:Y>-90</gml:Y>
     </gml:coord>
     <gml:coord>
       <gml:X>180</gml:X>
       <gml:Y>90</gml:Y>
     </gml:coord>
   </BoundingBox>

   <Output>
     <Format>application/pdf</Format>
     <Transparent>false</Transparent>
     <Size>
       <Width>501</Width>
       <Height>501</Height>
     </Size>
   </Output>

   <Exceptions>application/vnd.ogc.se+xml</Exceptions>

</ogc:GetMap>

Toan Nguyen wrote:

I know that. But in this example, request is posted to http://localhost:8080/geoserver/testwfs and it is submited in a frame.
If I use Javascript to post request through XMLHttpRequest object, I down't know how to make a image from response.
And, I want to use PHP to post request and get that image to print it into PDF file.

On Mon, Mar 10, 2008 at 10:55 PM, Justin Deoliveira <jdeolive@anonymised.com <mailto:jdeolive@anonymised.com>> wrote:

    Hi,

    If you check out the sample requests page and look at the
    WMS_getMap_inlineFeature.xml, you will see an example of how to make a
    GetMap request with a POST.

    Hope that helps.

    -Justin

--
   Nguyễn Đình Toán

-------------------------
Neu khong doc duoc tieng Viet, vui long vao menu View --> chon Encoding --> chon Unicode (UTF-8). Cam on. !DSPAM:4007,47d5dcbb36131336712104!

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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

!DSPAM:4007,47d5dcbb36131336712104!

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

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,47d5dcbb36131336712104!

Yes, I want to post directly data from PHP to geoserver/wms, but I don’t know how to post from PHP to Geoserver, and how to get the response from Geoserver as image. I want to get image beause I want to put some information to PDF, not only image.

On Tue, Mar 11, 2008 at 9:27 PM, Justin Deoliveira <jdeolive@…1…> wrote:

You should be able to post directory to http://…/geoserver/wms.
Something like the following (note the OutputFormat element specified in
the near the end).

As for how exactly to read the image or pdf that is returned in php… i
am not sure off the top of my head, perhaps someone more familiar with
php libraries can lend some guidance.

-Justin

<?xml version="1.0" encoding="UTF-8"?>

<ogc:GetMap xmlns:ogc=“http://www.opengis.net/ows
xmlns:gml=“http://www.opengis.net/gml
version=“1.2.0”
service=“WMS”>

topp:states -180 -90 180 90 application/pdf false 501 501

application/vnd.ogc.se+xml

</ogc:GetMap>


Nguyễn Đình Toán


Neu khong doc duoc tieng Viet, vui long vao menu View → chon Encoding → chon Unicode (UTF-8). Cam on.

Hi Toan,

It sounds like your question is more to do with PHP than Geoserver at this
point. A brief look at the api docs for php suggest that the curllib
functions in the php standard library allow you to make custom HTTP requests
in PHP: http://www.php.net/manual/en/ref.curl.php

If this isn't enough to get you going, I suspect asking in a PHP-specific
forum would get you the answers you need more quickly than asking here.

Hope this helps,
-David Winslow

On Tuesday 11 March 2008 21:22:25 Toan Nguyen wrote:

Yes, I want to post directly data from PHP to geoserver/wms, but I don't
know how to post from PHP to Geoserver, and how to get the response from
Geoserver as image. I want to get image beause I want to put some
information to PDF, not only image.

On Tue, Mar 11, 2008 at 9:27 PM, Justin Deoliveira <jdeolive@anonymised.com>

wrote:
> You should be able to post directory to http://…/geoserver/wms.
> Something like the following (note the OutputFormat element specified in
> the near the end).
>
> As for how exactly to read the image or pdf that is returned in php... i
> am not sure off the top of my head, perhaps someone more familiar with
> php libraries can lend some guidance.
>
> -Justin
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ogc:GetMap xmlns:ogc="http://www.opengis.net/ows&quot;
> xmlns:gml="http://www.opengis.net/gml&quot;
> version="1.2.0"
> service="WMS">
>
> <StyledLayerDescriptor>
> <NamedLayer>
> <Name>topp:states</Name>
>
> <UserStyle>
> <FeatureTypeStyle/>
>
> </UserStyle>
>
> </NamedLayer>
>
> </StyledLayerDescriptor>
>
> <BoundingBox>
> <gml:coord>
> <gml:X>-180</gml:X>
> <gml:Y>-90</gml:Y>
> </gml:coord>
> <gml:coord>
> <gml:X>180</gml:X>
> <gml:Y>90</gml:Y>
> </gml:coord>
> </BoundingBox>
>
> <Output>
> <Format>application/pdf</Format>
> <Transparent>false</Transparent>
> <Size>
> <Width>501</Width>
> <Height>501</Height>
> </Size>
> </Output>
>
> <Exceptions>application/vnd.ogc.se+xml</Exceptions>
>
> </ogc:GetMap>

Thank you so much.


Nguyễn Đình Toán


Neu khong doc duoc tieng Viet, vui long vao menu View → chon Encoding → chon Unicode (UTF-8). Cam on.