[mapserver-users] Why $map->scaledenom returns -1 ?

Vladimir fl_v at inbox.ru
Sun Jun 15 23:12:13 PDT 2014


 Hello list

I stuck on the scaledenom definition in my PHPMapScript v. 6.4.1.
The current scaledenom  required to embed in SQL-statement, but   
$map->scaledenom returns -1. Tons of googling got nothing. Please help!

 phpscript.php --------------------------------------------------------------------------------------------- 
     
        $map = ms_newMapobj("/srv/www/htdocs/tez/design/mapfile.map");        
        $request = ms_newOwsrequestObj();
        if(!empty($_GET)){
            foreach ($_GET as $key => $value) {
                $request->setparameter($key, $value);
            }
        }
       
        $map->preparequery();
        $map->scaledenom;//returns -1          
        
        $rayonLayer = $map->getLayerByName("rayon");    
        $rayonLayer->set("data","geom from (select id, name, geom from location
        where ST_Intersects(geom, !BOX!)) as subquery using unique id using srid=3857");
        
        ms_ioinstallstdouttobuffer();
        $map->owsDispatch($request);        
        
        $contenttype = ms_iostripstdoutbuffercontenttype();
        header('Content-type:'.$contenttype);
        ms_iogetStdoutBufferBytes();
        ms_ioresethandlers(); 


mapfile.map---------------------------------------------------------------------------------------------    

MAP
    NAME    "Map"
    OUTPUTFORMAT
        NAME 'AGG'
        DRIVER AGG/PNG
        IMAGEMODE RGB
    END #OUTPUTFORMAT
    STATUS        ON
    FONTSET    "fonts/fonts.list"    
    CONFIG    "PROJ_LIB" "/usr/lib/proj/"
    WEB         
        METADATA
            wms_title    "Map"
            wms_abstract    "Map"
            wms_onlineresource    "http://localhost/phpscript.php"
            wms_srs    "EPSG:3857"    
            wms_enable_request        "*"
            wms_encoding    "utf-8"
        END # end METADATA        
    END # end WEB    
    PROJECTION
        "init=epsg:3857"
    END # end PROJECTION    
    LAYER
        NAME    "rayon"            
        STATUS        ON
        CONNECTIONTYPE    postgis
        CONNECTION    "user=ms_viewer password=1 dbname=ms_db host=localhost"        
        TYPE    POLYGON
        LABELITEM    "name"
        CLASS 
            NAME    "rayons"            
                STYLE
                    OUTLINECOLOR    255 0 0
                    OUTLINEWIDTH    5
                END # end STYLE
        END # end CLASS
        PROJECTION
            "init=epsg:3857"
        END # end PROJECTION
        METADATA
            wms_title    "rayon"
            wms_abstract    "rayon"            
            wms_srs    "EPSG:3857"
            wms_include_items    "all"
        END # end METADATA
    END # end LAYER    
END # end MAP
---------------------------------------------------------------------------------------------

Best regards

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140616/fe0d1978/attachment.html>


More information about the mapserver-users mailing list