Пример #1
0
        private void setQueryValues(string q     = "", int c = 30, bool Clustering = false, bool maxModel         = false,
                                    string theme = null, string category = null, string POItype   = null, CRS srs = CRS.WGS84,
                                    int?id       = null, string niscode  = null, boundingBox bbox = null)
        {
            qryValues.Clear();

            if (q != null || q != "")
            {
                qryValues.Add("keyword", q);
            }

            if (Clustering && !maxModel)
            {
                qryValues.Add("Clustering", "true");
            }
            else
            {
                qryValues.Add("Clustering", "false");
            }
            //srs
            qryValues.Add("srsIn", Convert.ToString((int)srs));
            qryValues.Add("srsOut", Convert.ToString((int)srs));
            //string lists
            if (id != null)
            {
                qryValues.Add("id", id.ToString());
            }
            if (niscode != null || niscode != "")
            {
                qryValues.Add("region", niscode);
            }
            if (theme != null || theme != "")
            {
                qryValues.Add("theme", theme);
            }
            if (category != null || category != "")
            {
                qryValues.Add("category", category);
            }
            if (POItype != null || POItype != "")
            {
                qryValues.Add("POItype", POItype);
            }
            qryValues.Add("maxcount", c.ToString());

            if (maxModel)
            {
                qryValues.Add("maxmodel", "true");
            }
            else
            {
                qryValues.Add("maxmodel", "false");
            }

            if (bbox != null)
            {
                qryValues.Add("bbox", bbox.ToBboxString("|", "|"));
            }
        }
Пример #2
0
        private void setQueryValues(DateTime?startdate, DateTime?enddate,
                                    string city, string province, string owner, string eventtype, CRS sRS, int c, int offset, boundingBox bbox = null)
        {
            //counters
            qryValues.Add("offset", offset.ToString());
            qryValues.Add("limit", c.ToString());
            //string lists
            if (city != "" || city != null)
            {
                qryValues.Add("city", city);
            }
            if (province != "" || province != null)
            {
                qryValues.Add("province", province);
            }
            if (owner != "" || owner != null)
            {
                qryValues.Add("owner", owner);
            }
            if (eventtype != "" || eventtype != null)
            {
                qryValues.Add("eventtype", eventtype);
            }
            //CRS
            qryValues.Add("CRS", Convert.ToString((int)sRS));

            //Time
            if (startdate != null)
            {
                qryValues.Add("startdate", startdate.Value.ToString("yyyy-MM-dd"));
            }
            if (enddate != null)
            {
                qryValues.Add("enddate", enddate.Value.ToString("yyyy-MM-dd"));
            }

            //bbox
            if (bbox != null)
            {
                qryValues.Add("bbox", bbox.ToBboxString(",", "|"));
            }
        }
Пример #3
0
        private void setQueryValues(string q = "", int c = 30, bool Clustering = false, bool maxModel = false,
             string theme = null, string category = null, string POItype = null, CRS srs = CRS.WGS84, 
             int? id = null, string niscode = null, boundingBox bbox = null)
        {
            qryValues.Clear();

            if (q != null || q != "") qryValues.Add("keyword", q);

            if (Clustering && !maxModel ) qryValues.Add("Clustering", "true");
            else qryValues.Add("Clustering", "false");
            //srs
            qryValues.Add("srsIn", Convert.ToString((int)srs));
            qryValues.Add("srsOut", Convert.ToString((int)srs));
            //string lists
            if (id != null ) qryValues.Add("id", id.ToString());
            if (niscode != null || niscode != "") qryValues.Add("region", niscode);
            if (theme != null || theme != "" ) qryValues.Add("theme", theme);
            if (category != null || category != "" ) qryValues.Add("category", category);
            if (POItype != null || POItype != "" ) qryValues.Add("POItype", POItype);
            qryValues.Add("maxcount", c.ToString());

            if (maxModel)
            {
                qryValues.Add("maxmodel", "true");
            }
            else
            {
                qryValues.Add("maxmodel", "false");
            }

            if (bbox != null) qryValues.Add("bbox", bbox.ToBboxString("|", "|"));
        }
Пример #4
0
        private void setQueryValues(DateTime? startdate, DateTime? enddate, 
            string city, string province, string owner, string eventtype, CRS sRS, int c, int offset, boundingBox bbox = null)
        {
            //counters
            qryValues.Add("offset", offset.ToString());
            qryValues.Add("limit", c.ToString());
            //string lists
            if (city != "" || city != null) qryValues.Add("city", city);
            if (province != "" || province != null) qryValues.Add("province", province);
            if (owner != "" || owner != null) qryValues.Add("owner", owner);
            if (eventtype != "" || eventtype != null) qryValues.Add("eventtype", eventtype);
            //CRS
            qryValues.Add("CRS", Convert.ToString((int)sRS));

            //Time
            if (startdate != null) qryValues.Add("startdate", startdate.Value.ToString("yyyy-MM-dd"));
            if (enddate != null) qryValues.Add("enddate", enddate.Value.ToString("yyyy-MM-dd"));

            //bbox
            if (bbox != null) qryValues.Add("bbox", bbox.ToBboxString(",", "|") );
        }