[Mapserver-users] Virtual Spatial Data

we wei mapgisnewbies at yahoo.com
Sat Feb 7 07:05:33 PST 2004


Frank,

Thanks a lot for your help.  The connection is working
right now and the connection throught mapserver is
working, too 'coz it didn't throw me the error like
"OGR ERROR: files not found or format not supported".

But I am now dealing with another problem that I have
no clue.  I set up a virtual file that with the
following content:

<OGRVRTDataSource>
    <OGRVRTLayer name="climate">
    
<SrcDataSource>ODBC:user/user at PostgresqlDSN</SrcDataSource>

        <SrcLayer>climate</SrcLayer> 
        <GeometryType>wkbPoint</GeometryType> 
        <GeometryField encoding="PointFromColumns"
x="long" y="lat"/> 
    </OGRVRTLayer>
</OGRVRTDataSource>

I put my OGRVRTLayer's name as my table's name
"climate".  is it okay ? and i didn't put <LayerSRS>
'coz I am using the lat and long data without any
projection.

And my mapfile is as below:
MAP
NAME VRTDEMO
STATUS ON
SIZE 400 300
SYMBOLSET ../etc/symbols.sym
EXTENT -2200000 -712631 3072800 3840000
UNITS METERS
SHAPEPATH "../data"
IMAGECOLOR 255 255 255
FONTSET ../etc/fonts.txtition

WEB
IMAGEPATH "/var/html/www/VRT/imagepath/imagetmp"
IMAGEURL "/imagepath/imagetmp"
LOG "error.log"
METADATA
    "wms_title"		"Virtual Spatial Data Demo"       
"wms_onlineresource"
"http://127.0.0.1/cgi-bin/mapserv_40?map=/var/www/html/VRT/htdocs/vrt_wms.map&service=WMS"
END

PROJECTION  
"init=epsg:42304"
END

LAYER
    NAME "vrtlayer"
    TYPE POINT
    CONNECTIONTYPE OGR
    CONNECTION "virtual.ovf" 
    DATA "climate"  
    STATUS ON
    PROJECTION
      "proj=latlong"
    END
    CLASS
      SYMBOL 2
      SIZE 8
      COLOR 0 0 0      
    END
END

And i put the mapfile and the .ovf file in the same
location.

and then I used the wms to open this image as this

http://localhost/cgi-bin/mapserv_40?map=/var/www/html/VRT/htdocs/vrtdemo.map&service=WMS&request=getmap&version=1.1.1

However, I got something weird.  It gave me a whole
bunch of odd characters like the boxs and something
else but starts with &PNG.  It didn't generate an
image to me.  

Do you have any idea of what's going wrong or do you
have any method for me to generate more information
for debugging?

Thanks!  

--- Frank Warmerdam <warmerdam at pobox.com> wrote:
> we wei wrote:
> > Hi list,
> >  
> > I am working on a problem in connecting ODBC to
> postgresql from 
> > mapserver.  I am using the suggestion from wiki,
> but i have a question 
> > on the tip wiki provided though. 
> >  
> > It mentioned that we need to configure the apache
> by
> > 1.Enable mod_env 
> > 2.add lines like: setenv ORACLE_HOME /path/ 
> > 3.restart apache
> >  
> > I am not quite sure about step 2.  What is the
> variable ORACLE_HOME and 
> > the "path" refer to?  In my case I am using
> Postgresql, so what should 
> > be the environment variable's name ? and what will
> be the path it is 
> > related to ? Will the path mean the folder has the
> postgresql driver 
> > installed or the folder that the postgresql
> installed ?
> 
> We Wei,
> 
> If you are using Postgresql you don't need to set
> the ORACLE_HOME environment
> variable. That was just one example of the sort of
> stuff you might need to do.
> You likely don't need to set any environment
> variables for Postgres.
> 
> You do need to ensure that ODBC access to the
> database works for the user that
> MapServer will run as (nobody, www-data, or an
> apache user or something like that).
> You might test this by running the unix odbc client
> as the web user.
> 
> eg.
> 
> su
> Password: <root password>
> su - www-data
> isql <your_dsn>
> 
> Or it may work differently for you.  The point is,
> it is up to you to first
> ensure that ODBC access is working before you start
> using OGR and MapServer.
> 
> Best regards,
> 
> -- 
>
---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank
> Warmerdam, warmerdam at pobox.com
> light and sound - activate the windows |
> http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial
> Programmer for Rent
> 


__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html



More information about the MapServer-users mailing list