Пример #1
0
        public BadiuLBSYunResult geotableUpdate(int geotableId, int isPublished, string geoTableName = null)
        {
            string paraUrlCoded = "id=" + geotableId + "&is_published=" + isPublished + "&ak=" + _ak;

            if (!String.IsNullOrEmpty(_sn))
            {
                paraUrlCoded += ("&sn=" + _sn);
            }
            if (!String.IsNullOrEmpty(geoTableName))
            {
                paraUrlCoded += ("&name=" + geoTableName);
            }
            byte[]          postData = System.Text.Encoding.UTF8.GetBytes(paraUrlCoded);
            HttpWebResponse response = netWork(
                method: BadiuLBSYunMethods.POST,
                entity: BadiuLBSYunEntitys.GEOTABLE,
                operation: BadiuLBSYunOperations.UPDATE,
                postData: postData
                );
            Stream               s    = response.GetResponseStream();
            StreamReader         sr   = new StreamReader(s);
            string               json = sr.ReadToEnd();
            JavaScriptSerializer jss  = new JavaScriptSerializer();
            BadiuLBSYunResult    re   = jss.Deserialize <BadiuLBSYunResult>(json);

            return(re);
        }
        public BadiuLBSYunResult columnCreate(string columnName, string columnKey, UInt32 columnType, UInt32 maxLength,
                                              string defaultValue,
                                              UInt32 isSortfilterField, UInt32 isSearchField, UInt32 isIndexField, UInt32 isUniqueField,
                                              string geotableId)
        {
            //??????????????????
            //百度地图LBS云存储APIv3.0接口说明文档.doc
            //geotable_id	所属于的geotable_id	String(50)	 必选  Page 17
            string paraUrlCoded = "name=" + columnName + "&key=" + columnKey + "&type=" + columnType + "&max_length=" + maxLength
                                  + "&default_value=" + defaultValue
                                  + "&is_sortfilter_field=" + isSortfilterField + "&is_search_field=" + isSearchField
                                  + "&is_index_field=" + isIndexField
                                  + "&is_unique_field=" + isUniqueField + "&geotable_id=" + geotableId
                                  + "&ak=" + _ak;

            if (!String.IsNullOrEmpty(_sn))
            {
                paraUrlCoded += ("&sn=" + _sn);
            }
            byte[]          postData = System.Text.Encoding.UTF8.GetBytes(paraUrlCoded);
            HttpWebResponse response = netWork(
                method: BadiuLBSYunMethods.POST,
                entity: BadiuLBSYunEntitys.COLUMN,
                operation: BadiuLBSYunOperations.CREATE,
                postData: postData
                );
            Stream               s    = response.GetResponseStream();
            StreamReader         sr   = new StreamReader(s);
            string               json = sr.ReadToEnd();
            JavaScriptSerializer jss  = new JavaScriptSerializer();
            BadiuLBSYunResult    re   = jss.Deserialize <BadiuLBSYunResult>(json);

            return(re);
        }
        public BadiuLBSYunResult columnList(string geotableId, string key = null, string columnName = null)
        {
            //??????????????????
            //百度地图LBS云存储APIv3.0接口说明文档.doc
            //geotable_id	所属于的geotable_id	String(50)	必选  Page 19
            string paraUrlCoded = "ak=" + _ak + "&geotable_id=" + geotableId;

            if (!string.IsNullOrEmpty(key))
            {
                paraUrlCoded += ("&key=" + key);
            }
            if (!string.IsNullOrEmpty(columnName))
            {
                paraUrlCoded += ("&name=" + columnName);
            }
            if (!String.IsNullOrEmpty(_sn))
            {
                paraUrlCoded += ("&sn=" + _sn);
            }
            string          getData  = "?" + paraUrlCoded;
            HttpWebResponse response = netWork(
                method: BadiuLBSYunMethods.GET,
                entity: BadiuLBSYunEntitys.COLUMN,
                operation: BadiuLBSYunOperations.LIST,
                getData: getData
                );
            Stream               s    = response.GetResponseStream();
            StreamReader         sr   = new StreamReader(s);
            string               json = sr.ReadToEnd();
            JavaScriptSerializer jss  = new JavaScriptSerializer();
            BadiuLBSYunResult    re   = jss.Deserialize <BadiuLBSYunResult>(json);

            return(re);
        }
Пример #4
0
        public BadiuLBSYunResult poiUpload(UInt32 geotableId, byte[] poi_list, UInt32 timestamp = 0)
        {
            string paraUrlCoded = "ak=" + _ak + "&geotableId=" + geotableId;

            if (timestamp != 0)
            {
                paraUrlCoded += ("&timestamp=" + timestamp);
            }


            byte[]          postData = System.Text.Encoding.UTF8.GetBytes(paraUrlCoded);
            HttpWebResponse response = netWork(
                method: BadiuLBSYunMethods.POST,
                entity: BadiuLBSYunEntitys.POI,
                operation: BadiuLBSYunOperations.UPLOAD,
                postData: postData
                );
            Stream               s    = response.GetResponseStream();
            StreamReader         sr   = new StreamReader(s);
            string               json = sr.ReadToEnd();
            JavaScriptSerializer jss  = new JavaScriptSerializer();
            BadiuLBSYunResult    re   = jss.Deserialize <BadiuLBSYunResult>(json);

            return(re);
        }
Пример #5
0
        public BadiuLBSYunResult geotableList(string geotableName)
        {
            string paraUrlCoded = "ak=" + _ak;

            if (!string.IsNullOrEmpty(geotableName))
            {
                paraUrlCoded += ("&name=" + geotableName);
            }

            if (!String.IsNullOrEmpty(_sn))
            {
                paraUrlCoded += ("&sn=" + _sn);
            }
            string          getData  = "?" + paraUrlCoded;
            HttpWebResponse response = netWork(
                method: BadiuLBSYunMethods.GET,
                entity: BadiuLBSYunEntitys.GEOTABLE,
                operation: BadiuLBSYunOperations.LIST,
                getData: getData
                );
            Stream               s    = response.GetResponseStream();
            StreamReader         sr   = new StreamReader(s);
            string               json = sr.ReadToEnd();
            JavaScriptSerializer jss  = new JavaScriptSerializer();
            BadiuLBSYunResult    re   = jss.Deserialize <BadiuLBSYunResult>(json);

            return(re);
        }
Пример #6
0
        public BadiuLBSYunResult poiDelete(UInt64 id, string geotableId, Hashtable indexKeyValue = null, string ids = null,
                                           string title = null, string bounds = null, string tags = null)
        {
            //自定义唯一索引key	Value	用户自定义类型 page 32
            //indexKeyValue includ  uniqueIndex key-value
            string paraUrlCoded = "ak=" + _ak + "&id=" + id;

            if (!string.IsNullOrEmpty(ids))
            {
                string p   = @"^(\d+,*)+$";
                Regex  reg = new Regex(p, RegexOptions.IgnoreCase);
                Match  m   = reg.Match(ids);
                if (!m.Success)
                {
                    throw new Exception("ids contains illegal characters.");
                }
                paraUrlCoded += ("&ids=" + ids);
            }
            if (!string.IsNullOrEmpty(title))
            {
                paraUrlCoded += ("&title=" + title);
            }
            if (!string.IsNullOrEmpty(bounds))
            {
                paraUrlCoded += ("&bounds=" + bounds);
            }
            if (!string.IsNullOrEmpty(tags))
            {
                paraUrlCoded += ("&tags=" + tags);
            }
            if (!string.IsNullOrEmpty(_sn))
            {
                paraUrlCoded += ("&sn=" + _sn);
            }
            if (indexKeyValue != null)
            {
                foreach (DictionaryEntry kv in indexKeyValue)
                {
                    paraUrlCoded += ("&" + kv.Key + "=" + kv.Value);
                }
            }
            byte[]          postData = System.Text.Encoding.UTF8.GetBytes(paraUrlCoded);
            HttpWebResponse response = netWork(
                method: BadiuLBSYunMethods.POST,
                entity: BadiuLBSYunEntitys.POI,
                operation: BadiuLBSYunOperations.DELETE,
                postData: postData
                );
            Stream               s    = response.GetResponseStream();
            StreamReader         sr   = new StreamReader(s);
            string               json = sr.ReadToEnd();
            JavaScriptSerializer jss  = new JavaScriptSerializer();
            BadiuLBSYunResult    re   = jss.Deserialize <BadiuLBSYunResult>(json);

            return(re);
        }
Пример #7
0
        public BadiuLBSYunResult poiUpdate(UInt64 id, double longitude, double latitude, UInt32 coordType, string geotableId, Hashtable columnKeyValue = null,
                                           string title = null, string address = null, string tags = null)
        {
            //自定义唯一索引key	Value	用户自定义类型 page 32
            //columnKeyValue includ  index key value
            string paraUrlCoded = "longitude=" + longitude + "&latitude=" + latitude + "&coord_type=" + coordType + "&geotableId=" + geotableId
                                  + "&ak=" + _ak + "&id=" + id;

            if (!string.IsNullOrEmpty(title))
            {
                paraUrlCoded += ("&title=" + title);
            }
            if (!string.IsNullOrEmpty(address))
            {
                paraUrlCoded += ("&address=" + address);
            }
            if (!string.IsNullOrEmpty(tags))
            {
                paraUrlCoded += ("&tags=" + tags);
            }
            if (!string.IsNullOrEmpty(_sn))
            {
                paraUrlCoded += ("&sn=" + _sn);
            }
            if (columnKeyValue != null)
            {
                foreach (DictionaryEntry kv in columnKeyValue)
                {
                    paraUrlCoded += ("&" + kv.Key + "=" + kv.Value);
                }
            }
            byte[]          postData = System.Text.Encoding.UTF8.GetBytes(paraUrlCoded);
            HttpWebResponse response = netWork(
                method: BadiuLBSYunMethods.POST,
                entity: BadiuLBSYunEntitys.POI,
                operation: BadiuLBSYunOperations.UPDATE,
                postData: postData
                );
            Stream               s    = response.GetResponseStream();
            StreamReader         sr   = new StreamReader(s);
            string               json = sr.ReadToEnd();
            JavaScriptSerializer jss  = new JavaScriptSerializer();
            BadiuLBSYunResult    re   = jss.Deserialize <BadiuLBSYunResult>(json);

            return(re);
        }
        public BadiuLBSYunResult columnDelete(UInt32 columnId, UInt32 geotableId)
        {
            string paraUrlCoded = "id=" + columnId + "&geotable_id=" + geotableId + "&ak=" + _ak;

            if (!String.IsNullOrEmpty(_sn))
            {
                paraUrlCoded += ("&sn=" + _sn);
            }
            byte[]          postData = System.Text.Encoding.UTF8.GetBytes(paraUrlCoded);
            HttpWebResponse response = netWork(
                method: BadiuLBSYunMethods.POST,
                entity: BadiuLBSYunEntitys.COLUMN,
                operation: BadiuLBSYunOperations.DELETE,
                postData: postData
                );
            Stream               s    = response.GetResponseStream();
            StreamReader         sr   = new StreamReader(s);
            string               json = sr.ReadToEnd();
            JavaScriptSerializer jss  = new JavaScriptSerializer();
            BadiuLBSYunResult    re   = jss.Deserialize <BadiuLBSYunResult>(json);

            return(re);
        }
        public BadiuLBSYunResult columnDetail(UInt32 geotableId, UInt32 columnId)
        {
            string paraUrlCoded = "ak=" + _ak + "&geotable_id=" + geotableId + "&id=" + columnId;

            if (!String.IsNullOrEmpty(_sn))
            {
                paraUrlCoded += ("&sn=" + _sn);
            }
            string          getData  = "?" + paraUrlCoded;
            HttpWebResponse response = netWork(
                method: BadiuLBSYunMethods.GET,
                entity: BadiuLBSYunEntitys.COLUMN,
                operation: BadiuLBSYunOperations.DETAIL,
                getData: getData
                );
            Stream               s    = response.GetResponseStream();
            StreamReader         sr   = new StreamReader(s);
            string               json = sr.ReadToEnd();
            JavaScriptSerializer jss  = new JavaScriptSerializer();
            BadiuLBSYunResult    re   = jss.Deserialize <BadiuLBSYunResult>(json);

            return(re);
        }
Пример #10
0
        public BadiuLBSYunResult geotableCreate(string geotableName, int geoType, int isPublished, UInt32 timestamp)
        {
            string paraUrlCoded = "name=" + geotableName + "&geotype=" + geoType + "&is_published=" + isPublished + "&timestamp=" + timestamp + "&ak=" + _ak;

            if (!String.IsNullOrEmpty(_sn))
            {
                paraUrlCoded += ("&sn=" + _sn);
            }
            byte[]          postData = System.Text.Encoding.UTF8.GetBytes(paraUrlCoded);
            HttpWebResponse response = netWork(
                method: BadiuLBSYunMethods.POST.ToString(),
                entity: BadiuLBSYunEntitys.geotable.ToString(),
                operation: BadiuLBSYunOperations.create.ToString(),
                postData: postData
                );
            Stream               s    = response.GetResponseStream();
            StreamReader         sr   = new StreamReader(s);
            string               json = sr.ReadToEnd();
            JavaScriptSerializer jss  = new JavaScriptSerializer();
            BadiuLBSYunResult    re   = jss.Deserialize <BadiuLBSYunResult>(json);

            return(re);
        }
Пример #11
0
        public BadiuLBSYunResult geotableDetail(int geotableId)
        {
            string paraUrlCoded = "ak=" + _ak + "&id=" + geotableId.ToString();

            if (!String.IsNullOrEmpty(_sn))
            {
                paraUrlCoded += ("&sn=" + _sn);
            }
            string          getData  = "?" + paraUrlCoded;
            HttpWebResponse response = netWork(
                method: BadiuLBSYunMethods.GET.ToString(),
                entity: BadiuLBSYunEntitys.geotable.ToString(),
                operation: BadiuLBSYunOperations.detail.ToString(),
                getData: getData
                );
            Stream               s    = response.GetResponseStream();
            StreamReader         sr   = new StreamReader(s);
            string               json = sr.ReadToEnd();
            JavaScriptSerializer jss  = new JavaScriptSerializer();
            BadiuLBSYunResult    re   = jss.Deserialize <BadiuLBSYunResult>(json);

            return(re);
        }
Пример #12
0
        public BadiuLBSYunResult columnUpdate(UInt32 columnId, string columnKey, UInt32 columnType, UInt32 maxLength,
                                              UInt32 isSortfilterField, UInt32 isSearchField, UInt32 isIndexField, UInt32 isUniqueField,
                                              UInt32 geotableId, string defaultValue = null, string columnName = null)
        {
            string paraUrlCoded = "id=" + columnId + "&key=" + columnKey + "&type=" + columnType + "&max_length=" + maxLength
                                  + "&is_sortfilter_field=" + isSortfilterField + "&is_search_field=" + isSearchField
                                  + "&is_index_field=" + isIndexField
                                  + "&is_unique_field=" + isUniqueField + "&geotable_id=" + geotableId
                                  + "&ak=" + _ak;

            if (!String.IsNullOrEmpty(columnName))
            {
                paraUrlCoded += ("&name=" + columnName);
            }
            if (!String.IsNullOrEmpty(defaultValue))
            {
                paraUrlCoded += ("&default_value=" + defaultValue);
            }
            if (!String.IsNullOrEmpty(_sn))
            {
                paraUrlCoded += ("&sn=" + _sn);
            }
            byte[]          postData = System.Text.Encoding.UTF8.GetBytes(paraUrlCoded);
            HttpWebResponse response = netWork(
                method: BadiuLBSYunMethods.POST.ToString(),
                entity: BadiuLBSYunEntitys.column.ToString(),
                operation: BadiuLBSYunOperations.update.ToString(),
                postData: postData
                );
            Stream               s    = response.GetResponseStream();
            StreamReader         sr   = new StreamReader(s);
            string               json = sr.ReadToEnd();
            JavaScriptSerializer jss  = new JavaScriptSerializer();
            BadiuLBSYunResult    re   = jss.Deserialize <BadiuLBSYunResult>(json);

            return(re);
        }