SQL Server aggregate function in ogr2ogr command

المشرف العام

Administrator
طاقم الإدارة
I would like to define create a GeoJSON bounding box using SQL Server's EnvelopeAggregate function, embedded in an ogr2ogr command. I have the following command:

ogr2ogr -f GeoJSON envelope.json "MSSQL:server=SERVERNAME;database=DBNAME;trusted_connection=ye s;" -sql "select TR, Geometry::EnvelopeAggregate(Shape) as Shape from gis.USA_CatchArea_Cust_Prim where TR = '000280965 8' group by TR" "-s_srs" "+proj=tpeqd +lat_1=49 +lon_1=-110 +lat_2=49 +lon_2=-77 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no _defs", "-t_srs", "epsg:4326" The resulting GeoJSON file contains null geometry:

{ "type": "FeatureCollection", "crs": { "type": "name", "properties": { "name": "urn:eek:gc:def:crs:OGC:1.3:CRS84" } }, "features": [ { "type": "Feature", "properties": { "TR": "0002809658", "Shape": "00000000010405000000009899992166D5408061325554EB21C100E00B936336E0408061..." }, "geometry": null } ] }

أكثر...
 
أعلى