OpenLayers + MapServer + Postgis <problem>

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

OpenLayers + MapServer + Postgis <problem>

E.Stefanakis
Hi!
 
I have two layers defined as follows...
 
var mslayer1 = new OpenLayers.Layer.WMS( "SHAPEFILE LAYER", 
    "http://83.212.51.160/cgi-bin/mapserv.exe?map=/ms4w/apps/emmanuel/htdocs/grdata_nomoi_wgs84.map", {'layers': 'NOMOI' , 'format':'image/png'}); 
var mslayer2 = new OpenLayers.Layer.WMS( "POSTGIS LAYER",
    "http://83.212.51.160/cgi-bin/mapserv.exe?map=/ms4w/apps/emmanuel/htdocs/grdata_nomoi_wgs84.map", {'layers': 'MATHITES' , 'format':'image/png'}); 
 
 
and the following map file:
 
MAP
  IMAGETYPE      png
  EXTENT         19.341085 34.809638 29.577942 41.757412
  SIZE           500 500
  SHAPEPATH      "c:/emmanuel/grdata"
  IMAGECOLOR     255 255 255
  UNITS DD
 
PROJECTION
   "init=epsg:4326"
  END
 
SYMBOL
   NAME "Circle"
   FILLED true
   TYPE ellipse
   POINTS 1 1 END
END
 

  # LAYER SHAPEFILE ---------
  LAYER
    NAME         NOMOI
    DATA         NOMOI_wgs84
    STATUS       OFF
    TYPE         POLYGON
 
    CLASS
      NAME       "The Greek Prefectures"
      STYLE
        COLOR        200 200 200
        OUTLINECOLOR 32 32 32
      END
    END
  END # 
 
END #
 

# Layer POSTGIS -----------
 
 LAYER # Mathites in PostGIS
   NAME         MATHITES
   STATUS ON
   TYPE POINT
   CONNECTIONTYPE POSTGIS
   CONNECTION "dbname=postgis host=localhost
                              user=postgres password=postgres port=5432"
   DATA "the_geom from (select the_geom from mathites_wgs84 where id <10)"  
 
    CLASS
       NAME       "Mathites"
       STYLE 
          SYMBOL "Circle"
          SIZE 3
          COLOR        0 0 200
       END
    END
 
    PROJECTION
      "init=epsg:4326"
    END
 
 END
 
#End of Layer ---------------
 
END
 
 
=================
 
The SHAPEFILE layer works fine! Howver I cannot see the POSTGIS layer...
I get an error message "declare mycursor binary cursor..."
 
Any suggestion would be greatly appreciated !
 
Emmanuel.
 
 

_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: OpenLayers + MapServer + Postgis <problem>

Christopher Schmidt-2
On Mon, Apr 02, 2007 at 12:32:08AM +0300, E.Stefanakis wrote:

> Hi!
>
> I have two layers defined as follows...
>
> var mslayer1 = new OpenLayers.Layer.WMS( "SHAPEFILE LAYER",
>     "http://83.212.51.160/cgi-bin/mapserv.exe?map=/ms4w/apps/emmanuel/htdocs/grdata_nomoi_wgs84.map", {'layers': 'NOMOI' , 'format':'image/png'});
> var mslayer2 = new OpenLayers.Layer.WMS( "POSTGIS LAYER",
>     "http://83.212.51.160/cgi-bin/mapserv.exe?map=/ms4w/apps/emmanuel/htdocs/grdata_nomoi_wgs84.map", {'layers': 'MATHITES' , 'format':'image/png'});
>
>
> and the following map file:
> The SHAPEFILE layer works fine! Howver I cannot see the POSTGIS layer...
> I get an error message "declare mycursor binary cursor..."
>
> Any suggestion would be greatly appreciated !

When debugging image creation from OpenLayers, if you right click on the
image and copy the URL, then paste it, you can usually edit it to remove
the 'exceptions=inimage' parameter, and get a more useful/readable error
message than the one in the image.

However, I don't recognize your problem specifically.

This problem is on the MapServer end of the spectrum: If you take your
URL to the MapServer list, you'll probably get a better response than I
can give :)

Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev