I had to adjust the height parameter to make it work when downloading as KML:
height = ((maxy-miny)/(maxx-minx))*width It still seems like a bug, but does this help? I guess the WIDTH and HEIGHT parameters don't make much sense when outputting as KML. ----- Original Message ----- From: Jeff McKenna <[email protected]> To: mapserver-users <[email protected]> Cc: Sent: Wednesday, July 6, 2011 8:00 AM Subject: Re: [mapserver-users] KML as Outputformat returns incorrect coordinates You might be hitting the same issue that I reported a few weeks ago (http://trac.osgeo.org/mapserver/ticket/3928). -jeff -- Jeff McKenna MapServer Consulting and Training Services http://www.gatewaygeomatics.com/ On 11-07-06 8:17 AM, luis peinado wrote: > Hi all, > I'm having some related problem: > I have no problem with my mapserver png outputformat: > This png request works really fine: > http://geoserver3/wms60/ddgi/servidor/espaisprotegits?FORMAT=image/png&TRANSPARENT=true&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&LAYERS=zonhum&SRS=EPSG%3A4326&BBOX=-1.0469740101326659,41.39036252208658,5.764549426147167,42.77237478582793&WIDTH=1860&HEIGHT=1039 > <http://geoserver3/wms60/ddgi/servidor/espaisprotegits?FORMAT=image/png&TRANSPARENT=true&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&LAYERS=zonhum&SRS=EPSG%3A4326&BBOX=-1.0469740101326659,41.39036252208658,5.764549426147167,42.77237478582793&WIDTH=1860&HEIGHT=1039> > > Changing only the FORMAT parameter to KML: > http://geoserver3/wms60/ddgi/servidor/espaisprotegits?FORMAT=KML&TRANSPARENT=true&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&LAYERS=zonhum&SRS=EPSG%3A4326&BBOX=-1.0469740101326659,41.39036252208658,5.764549426147167,42.77237478582793&WIDTH=1860&HEIGHT=1039 > <http://geoserver3/wms60/ddgi/servidor/espaisprotegits?FORMAT=KML&TRANSPARENT=true&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&LAYERS=zonhum&SRS=EPSG%3A4326&BBOX=-1.0469740101326659,41.39036252208658,5.764549426147167,42.77237478582793&WIDTH=1860&HEIGHT=1039> > > (sorry, my server is not at the Internet). > > I get as a response an xml file with no extension and taking a look at > it with my text editor, I can see things like > <Polygon><outerBoundaryIs><LinearRing><coordinates> > 583.23708456,950.02673133 > 583.22503040,950.03227145 > > And these coordinates are wrong. > > Mapserver's log doese not seem to show any problem: > Log after the FORMAT=kml query > > [Wed Jul 6 13:08:21 2011].550681 CGI Request 1 on process 1073 > [Wed Jul 6 13:08:21 2011].550929 msWMSLoadGetMapParams(): enabling > non-square pixels. > [Wed Jul 6 13:08:21 2011].551361 msDrawMap(): kicking into non-square > pixel preserving mode. > [Wed Jul 6 13:08:21 2011].551380 msDrawMap(): rendering using > outputformat named kml (KML). > [Wed Jul 6 13:08:21 2011].551400 msDrawMap(): WMS/WFS set-up and query, > 0.000s > [Wed Jul 6 13:08:22 2011].533734 msDrawMap(): Layer 0 (zonhum), 0.982s > [Wed Jul 6 13:08:22 2011].533776 msDrawMap(): Drawing Label Cache, 0.000s > [Wed Jul 6 13:08:22 2011].533791 msDrawMap() total time: 0.983s > [Wed Jul 6 13:08:22 2011].942736 msSaveImage(stdout) total time: 0.409s > [Wed Jul 6 13:08:22 2011].943681 mapserv request processing time > (msLoadMap not incl.): 1.393s > [Wed Jul 6 13:08:22 2011].943700 msFreeMap(): freeing map at 0x9603678. > > Can someone help me? > Thanks in advance for any response. > Lluís. > > 2011/6/6 Joe Franklin <[email protected] <mailto:[email protected]>> > > I'm using Mapserver 6.0. I get the same results using the windows > MS4W version as well as compiling it myself on Centos 5. I'm > including a simple map file with an embedded point, but I also > tested using a point shapefile. Anyone else see this problem? > > Works using shp2img- returns -77.00000000,48.000000000: > shp2img -m airport.map > > Doesn't work using mapserv CGI or PHP Mapscript - returns > 76.80000000,409.60000000 > mapserv -nh > >"QUERY_STRING=map=airport.map&service=wms&VERSION=1.1.1&REQUEST=GetMap&SRS=epsg:4326&WIDTH=512&HEIGHT=512&LAYERS=Airports&TRANSPARENT=TRUE&FORMAT=kml&BBOX=-80,40,-60,50" > > > MAP > NAME "Airport" > STATUS ON > SIZE 512 512 > EXTENT -80 40 -60 50 > IMAGETYPE kml > UNITS DD > IMAGECOLOR 255 255 255 > PROJECTION > "init=epsg:4326" > END > WEB > METADATA > "ows_enable_request" "*" > "wms_title" "Airport" > "wms_onlineresource" "http://localhost/mapserv?map=/tmp/airport.map" > "ows_srs" "epsg:4326" > END > END #WEB > SYMBOL > NAME 'circle' > TYPE ellipse > FILLED true > POINTS 1 1 END > END > LAYER > NAME "Airports" > TYPE point > FEATURE > POINTS -77 48 END > END > METADATA > "wms_title" "Airports" > END # METADATA > STATUS ON > CLASS > STYLE > COLOR 255 0 0 > SYMBOL 1 > SIZE 5 > END # STYLE > TEMPLATE "ttt_query.html" > END # CLASS > END # LAYER > END > > > MapServer version 6.0.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML > SUPPORTS=PROJ > SUPPORTS=AGG SUPPORTS=CAIRO SUPPORTS=FREETYPE SUPPORTS=ICONV > SUPPORTS=FRIBIDI > SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER > SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER > SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG > INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE > _______________________________________________ mapserver-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapserver-users _______________________________________________ mapserver-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapserver-users
