Opened 17 years ago
Closed 17 years ago
#2068 closed defect (invalid)
error setFilter(...);Can you help me,please?
Reported by: | Owned by: | tamas | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | MapScript-C# | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: | tranminhquy@… |
Description
I add : layerObj objLayber = objMapServer.getLayerByName("District label"); objLayber.setFilter("id = 1"); objimg = objMapServer.draw();-> run goog; But When I add: layerObj objLayber = objMapServer.getLayerByName("District label"); objLayber.setFilter("id != 1"); //(or id <1 )//(or id >1 ) objimg = objMapServer.draw();-> exception [System.ApplicationException] = {"msDrawMap(): Image handling error. Failed to draw layer named 'District label'.;prepare_database(): Query error. Error executing POSTGIS DECLARE (the actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT \"name\"::text,asbinary(force_collect... My file source: using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.IO; using System.ComponentModel; using System.Drawing; namespace vietnamarilines { public partial class MapStream : System.Web.UI.Page { mapObj objMapServer; // Mapserver.Mapserver objMapServer1; /// <summary> /// Do a Map Action and send an image stream /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { try { if (Request.Params["type"] != null) { string strType = Request.Params["type"].ToString(); objMapServer = (mapObj)Session["Map"]; layerObj objLayber = objMapServer.getLayerByName("District label"); objLayber.setFilter("id != 1"); RefreshMap(strType); } } catch (Exception ex) { Response.Write(ex.Message); } } /// <summary> /// Refresh MapServer map and send the image stream to output /// </summary> private void RefreshMap(string strType) { try { imageObj objimg = null; if (strType == "map") { objMapServer.width = 600; objMapServer.height = 460; objimg = objMapServer.draw(); } else if (strType == "demo") { objimg = objMapServer.drawReferenceMap(); } else { objimg = objMapServer.drawLegend(); } byte[] byImg = objimg.getBytes(); using (MemoryStream objStream = new MemoryStream(byImg)) { System.Drawing.Image img = System.Drawing.Image.FromStream(objStream); Bitmap bp = (Bitmap)img; bp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif); } } catch (Exception ex) { throw ex; } } } }
Change History (4)
comment:1 by , 17 years ago
Cc: | added |
---|
comment:3 by , 17 years ago
Owner: | changed from | to
---|
comment:4 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
We haven't enough information to move forward with this. At least the complete postgis error would be required. Closing as invalid for now. Will reopen on further information.
Note:
See TracTickets
for help on using tickets.