Skip to content

Commit eb3b6a0

Browse files
author
潘卓然Y7000P
committed
【SDK】【新增】【增加DataStore/PostGIS的拉框,点查询,多边形查询,WKT查询】
1 parent c7b0953 commit eb3b6a0

4 files changed

Lines changed: 49 additions & 123 deletions

File tree

src/service/datastore/postgis/PostgisCatlogService.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,18 @@ import { DataStoreService } from '../ServiceBase';
66
* @class module:PostGIS.PostgisCatlogService
77
* @param {PostgisQueryParameter} option 查询条件
88
* @param {String} [option.path] 库名称
9-
* @param {Boolean} [option.classify = true] 类别,地址库、时空库等
9+
* @param {String} [option.classify] 类别,地址库、时空库、数据集等
1010
* @param {String} [option.keyWords] 关键字
11+
* @example
12+
* let param = {
13+
networkProtocol: 'http',
14+
ip: '192.168.96.101',
15+
port: 9091,
16+
path: 'bigdata03',
17+
classify: '数据集',
18+
keyWords: 'big'
19+
};
20+
let catlog = new Zondy.DataStore.PostGIS.PostgisCatlogService(param);
1121
*/
1222
export class PostgisCatlogService extends DataStoreService {
1323
constructor(option) {
@@ -26,6 +36,7 @@ export class PostgisCatlogService extends DataStoreService {
2636
/**
2737
* @member module:PostGIS.PostgisCatlogService.prototype.classify
2838
* @description 类别,地址库、时空库等
39+
* @enum datasets
2940
*/
3041
this.classify = option.classify;
3142
/**

src/service/datastore/postgis/PostgisQueryParameter.js

Lines changed: 0 additions & 115 deletions
This file was deleted.

src/service/datastore/postgis/PostgisQueryService.js

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class PostgisQueryService extends DataStoreService {
1616
* @member module:PostGIS.PostgisQueryService.prototype.serviceUrl
1717
* @description 服务地址
1818
*/
19-
this.serviceUrl = '/datastore/rest/dataset/pg/query';
19+
this.serviceUrl = '/datastore/rest/dataset/pg/query/';
2020
/**
2121
* @member module:PostGIS.PostgisQueryService.prototype.path
2222
* @description 库名称/工作空间
@@ -105,11 +105,34 @@ export class PostgisQueryService extends DataStoreService {
105105
* @param {Function} onError 查询失败回调函数。
106106
*/
107107
query(onSuccess, onError) {
108-
let { serviceUrl, path, option } = this;
109-
serviceUrl += path;
108+
let { serviceUrl, path, option, geometry, geoFormat } = this;
109+
serviceUrl += path;
110110
let url = this.getFullUrl(serviceUrl, option);
111111
this.get(url, onSuccess, onError);
112112
}
113+
114+
/**
115+
* @description 通过wkt查询数据
116+
* @param {String} wkt
117+
*/
118+
queryByWkt(wkt) {}
119+
120+
/**
121+
* @description 通过geojson查询数据
122+
* @param {String} geojson
123+
*/
124+
queryByGeojson(geojson) {}
125+
126+
/**
127+
* @description 通过circle查询数据
128+
* @param {String} circle 格式: x坐标,y坐标,半径
129+
*/
130+
queryByCircle(circle) {}
131+
/**
132+
* @description 通过rect查询数据
133+
* @param {String} rect 格式: xmin,ymin,xmax,ymax
134+
*/
135+
queryByRect(rect) {}
113136
}
114137

115138
export default PostgisQueryService;

src/service/datastore/postgis/PostgisTableService.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ import { DataStoreService } from '../ServiceBase';
77
* @param {PostgisQueryParameter} option 查询条件
88
* @param {String} option.path 库名称/工作空间
99
* @param {String} option.tableNames 表名,多个用逗号分隔,如:X431102TDXZ2005GDLTB,dltb2005
10+
* @example
11+
* let param = {
12+
networkProtocol: 'http',
13+
ip: '192.168.96.101',
14+
port: 9091,
15+
path: 'bigdata03/bigdata03',
16+
tableNames: 'mpf24091'
17+
};
18+
let catlog = new Zondy.DataStore.PostGIS.PostgisTableService(param);
1019
*/
1120
export class PostgisTableService extends DataStoreService {
1221
constructor(option) {
@@ -36,9 +45,7 @@ export class PostgisTableService extends DataStoreService {
3645
*/
3746
fixOption(option) {
3847
this.option = {
39-
tableNames: option.tableNames,
40-
pageSize: option.pageSize,
41-
pageNo: option.pageNo
48+
tableNames: option.tableNames
4249
};
4350
}
4451

@@ -50,7 +57,7 @@ export class PostgisTableService extends DataStoreService {
5057
*/
5158
query(onSuccess, onError) {
5259
let { serviceUrl, path, option } = this;
53-
serviceUrl += path;
60+
serviceUrl += path;
5461
let url = this.getFullUrl(serviceUrl, option);
5562
this.get(url, onSuccess, onError);
5663
}

0 commit comments

Comments
 (0)