[Mapbender-users] Re: geoserver print request wrong

Albert Polze A.Polze at mailbox.tu-berlin.de
Fri Jul 8 09:50:00 EDT 2011


Hello list,

at first i need to apologise for my last post, it wasn't the right etiquette
and overall nonsense. As said i don't run the apache rewrite-modul. With the
help of a friend I solved the problem. The ":" was double encoded into
"%253A" and we find the place to correct this by editing the
mod_print_.pdf.php. The changes are below.



diff -u mod_printPDF_pdf.a.php mod_printPDF_pdf.b.php 
--- mod_printPDF_pdf.a.php	2011-07-08 12:25:57.000000000 +0200    <-
original file
+++ mod_printPDF_pdf.b.php	2011-07-08 14:03:52.132657520 +0200 <- new file
@@ -67,6 +67,7 @@
 $format = $_REQUEST["format"];
 $map_scale = $_REQUEST["map_scale"];
 $overview_url = $_REQUEST["overview_url"];
+$overview_url=urldecode($overview_url);
 $epsg = $_REQUEST["epsg"];
 if($overview_url=='false'){
 	$overview = false;	
@@ -153,7 +154,7 @@
 $newArray_urls = array();
 for ($i=0; $i&lt;count($array_urls); $i++) {
 	if ($array_urls[$i] != 'false') {
 -	$newArray_urls[] = $array_urls[$i];
+	$newArray_urls[] = urldecode($array_urls[$i]);
 	}
 }
 $array_urls = $newArray_urls;

&lt;/raw&gt;

We had to decode the URLs again, this was also possible by putting
"encode=false" in some other file (sorry I dont't remember). But we thought
this could cause some trouble while requesting layers just to view them in
mapbender b.c. every request would be affected (normal requests aren't
double encoded...). Also we didn't run into one while short-testing it, we
decided to make it like above. My workmate also told me that even this place
isn't the right one to correct or problem. Be cause the URL is already wrong
when it comes into mod_printPDF.php. There (at line 222) the correct
"mapURL" must be given, but it isn't. So he thinks this might be a problem
with javascripts objects . 

We still need to get the "Legend" to print but the solution to this should
be alike and we got an new "ERROR: stripRequest: key 'map' lacks" be cause
of editing the file. We stoped working on this problem at this point for
some reasons (..Friday..). Hopefully we will get everything to work.

At all this goes way over my head and my workmate is not always around but I
will try to give further information if needed.

have a nice weekend, albert


armin11 wrote:
> 
> dear albert,
> 
> you have got a double encoding of the : . i think, that you work with an 
> apache mod_rewrite. maybe this is the mapbender owsproxy itself, which is
> used 
> to secure the access to ows.  please change the options of your rewrite
> rule 
> to  [P,L,QSA,NE] - it is really important to use the NE - otherwise the 
> requests will be double encoded and the geoserver don't know what %253A is
> ;-)
> 
> regards 
> armin
> 
> 
> Am Donnerstag 16 Juni 2011, 14:58:35 schrieb Albert Polze:
>> Setup: mapbender: 2.7.1 ; geoserver: 2.1.0 ; Debian 6.0
>> 
>> Error:
>> 2011.06.16, 13:21:51,ERROR: weldMaps2PNG: unable to load image:
>> http://xxx.xxx.xx.xx:xxxx/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=G
>> etMap&SERVICE=WMS&LAYERS=Casa%253Atest_name,Casa%253AVerkehr_poly_name,Casa
>> %253Aexport_roi_1_name&STYLES=,,,&SRS=EPSG:4326&BBOX=-7.67,33.4547,-7.54,33
>> .6367&WIDTH=445&HEIGHT=624&FORMAT=image/png&BGCOLOR=0xffffff&TRANSPARENT=TR
>> UE&EXCEPTIONS=application/vnd.ogc.se_xml
>> 
>> ---------------
>> 
>> Dear List,
>> 
>> trying to print my own wms (using printPDF) results in an print without
>> the
>> layers. The frame, comments, scalebar etc. are all there. Printing the
>> Demis World Map works fine.
>> 
>> Looking at the request there are some "mistakes" in the URL every colon
>> (":") is expressed with "%253A". Changing this in the URL and open it
>> with
>> a browser leads to the image that I wanted.
>> 
>> (Geoserver uses these colons to separate layer stores from layers, but
>> you
>> know this...)
>> 
>> Looking at this old
>> http://osgeo-org.1803224.n2.nabble.com/Laden-und-Drucken-externer-Kartendie
>> nste-td2057427.html thread  I came to the conclusion that I can solve the
>> problem by changing the "class_stripRequest.php".
>> 
>> Im not into php... so I have no idea what to do, I tried to append this
>> to
>> the file...
>> function encodeLegGET(){
>> 		$this->url = preg_replace("%253A", ":", $this->url);
>> 		return $this->url;
>> ... but it didnt work.
>> 
>> I hope somebody can give me a hint.
>> 
>> best regards A.Polze
>> 
>> ---------------
>> 
>> Hallo Liste,
>> 
>> beim versuch meinen eigenen wms zu drucken, bekam ich ein leeres *.pdf.
>> Der
>> Rahmen, Kommentare, Maßstabsleiste etc. waren vorhanden. Den wms der
>> Demis
>> World Map konnte ich problemlos drucken.
>> 
>> Das Problem liegt wohl in den Aufruf, da in der URL alle Doppelpunkte
>> durch
>> "%253A" ersetzt wurden.
>> (Die Doppelpunkte kommen vom geoserver der damit die Layerstores von den
>> Layern trennt aber das ist bekannt).
>> 
>> Ein älterer
>> http://osgeo-org.1803224.n2.nabble.com/Laden-und-Drucken-externer-Kartendie
>> nste-td2057427.html thread  hat mich auf die Idee gebracht die
>> "class_stripRequest.php" anzupassen.
>> 
>> Dummerweise hört es bei php bei mir auf. Weil es gut aussah habe ich
>> folgendes an die Datei noch ergänzt
>> ...function encodeLegGET(){
>> 		$this->url = preg_replace("%253A", ":", $this->url);
>> 		return $this->url;
>> ... wie zu erwarten war das aber blödsinn.
>> 
>> Ich hoffe ihr könnt mir weiterhelfen. Vllt. gibt es ja noch andere
>> Lösungen.
>> 
>> Grüße A.Polze
>> 
>> 
>> 
>> 
>> --
>> View this message in context:
>> http://osgeo-org.1803224.n2.nabble.com/geoserver-print-request-wrong-tp648
>> 2919p6482919.html Sent from the mapbender-users mailing list archive at
>> Nabble.com.
>> _______________________________________________
>> Mapbender_users mailing list
>> Mapbender_users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapbender_users
> 
> 
> -- 
> Im Auftrag
> --
> Armin Retterath
> 
> Zentrale Stelle Geodateninfrastruktur
> LVermGeo RP
> 
> Ferdinand-Sauerbruch-Straße 15
> 56073 Koblenz
> Telefon 0261/492-466
> Telefax 0261/492-492
> armin.retterath at lvermgeo.rlp.de
> http://www.geoportal.rlp.de
> _______________________________________________
> Mapbender_users mailing list
> Mapbender_users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapbender_users
> 


--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/geoserver-print-request-wrong-tp6482919p6562561.html
Sent from the mapbender-users mailing list archive at Nabble.com.


More information about the Mapbender_users mailing list