st_asgeojson(geometry) geometry转geojson: st_geomfromgeojson(geojson) geojson转geometry st_transform(geometry, integer) 坐标转换 6.常用空间关系判断函数 st_equals(geometryA, geometryB) 相等(Equals)--几何形状拓扑上相等。 st_disjoint(geometryA, geometryB) 脱节(Disjoint)--几何形状没有共有的点。
ST_InteriorRingN: Returns the Nth interior linestring ring of the polygon geometry. Return NULL if the geometry is not a polygon or the given N is out of range. ST_Length: Returns the 2d length of the geometry if it is a linestring or multilinestring. geometry are in ...
select st_asgeojson(geom) geom from building_info where building_id = 84266; //获取几何对象的中心 ST_Centroid(geometry)
--查询空间数据--{"type":"Point","coordinates":[1731428,852776]}SELECTst_asgeojson(geometry)fromadmin_face_alllimit1;--POINT(1731428 852776)selectst_astext(geom)wheretableName; 插入一条空间数据 insertintomytable(geom)values(ST_GeomFromText('POINT(121.5 31.1)',4326)); ...
data}){ // 获得路径数据后,处理成GeoJSON const res = data.routes[0].steps.map(...
featurejson image.png SELECTrow_to_json(fc)from(SELECT'FeatureCollection'Astype,array_to_json(array_agg(f))AsfeaturesFROM(SELECT'Feature'Astype,ST_AsGeoJSON(lg.aoi_geom)::jsonAsgeometry,row_to_json((SELECTlFROM(SELECTaoi_name,hn_id)Asl))AspropertiesFROMpoi_hn_aoi lg limit10)f)fc; ...
浏览器将会收到一份GeoJSON数据: { "type": "FeatureCollection", "features": [{ "type": "Feature", "id": "shenzhen.fid-61be8e79_172e5251868_-7feb", "geometry": { "type": "LineString", "coordinates": [ [1.267733314942105E7, 2578207.10933218], [1.267731205437755E7, 2578186.95527014], [1....
ALTER TABLE gis_addr_sync_100wan ADD receiver_geom geometry(POINT,4326); ALTER TABLE gis_addr_sync_100wan ADD send_lat float; ALTER TABLE gis_addr_sync_100wan ADD send_lon float; ALTER TABLE gis_addr_sync_100wan ADD send_dzid varchar(32); ...
Datumgeography_as_geojson(PG_FUNCTION_ARGS){ LWGEOM *lwgeom =NULL; GSERIALIZED *g =NULL;char*geojson; text *result;intversion;intoption =0;inthas_bbox =0;intprecision = OUT_MAX_DOUBLE_PRECISION;char* srs =NULL;/* Get the version */version =PG_GETARG_INT32(0);if( version !=1)...