-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathOracle.cs
More file actions
809 lines (707 loc) · 22 KB
/
Oracle.cs
File metadata and controls
809 lines (707 loc) · 22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
// Copyright 2006 - Humberto Ferreira
// Oracle provider by Humberto Ferreira (humbertojdf@hotmail.com)
//
// Date 2006-09-05
//
// This file is part of SharpMap.
// SharpMap is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// SharpMap is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public License
// along with SharpMap; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data;
using System.Globalization;
using Oracle.DataAccess.Client;
using SharpMap.Converters.WellKnownBinary;
using SharpMap.CoordinateSystems;
using SharpMap.CoordinateSystems.Transformations;
using SharpMap.Data;
using SharpMap.Geometries;
namespace SharpMap.Extensions.Data.Providers.Oracle
{
/// <summary>
/// Oracle dataprovider
/// </summary>
/// <remarks>
/// <para>
/// This provider needs the Oracle software client installed
/// on the PC where the application runs.
/// If you need to connect to an Oracle database, it has to have an
/// Oracle client (or Oracle Instant Client) installed.
/// </para>
/// <para>
/// You can download Oracle Client here:
/// http://www.oracle.com/technology/software/index.html
/// </para>
/// <para>
/// If the client doesn't need an instance of Oracle,
/// a better option is to use Oracle Instant client, found here:
/// http://www.oracle.com/technology/tech/oci/instantclient/index.html
/// </para>
/// <example>
/// Adding a datasource to a layer:
/// <code lang="C#">
/// string connStr = "Server=127.0.0.1;Port=5432;User Id=userid;Password=password;Database=myGisDb;";
/// SharpMap.Extensions.Data.Providers.Oracle.OracleSpatialProvider dataSource = new OracleSpatialProvider(
/// connStr, "myTable", "GeomColumn", "OidColumn");
/// SharpMap.Layers.VectorLayer myLayer = new VectorLayer("My layer", dataSource);
/// </code>
/// </example>
/// <para>
/// SharpMap Oracle provider originally by Humberto Ferreira (humbertojdf at hotmail com).
/// </para>
/// </remarks>
[Serializable]
public class OracleSpatialProvider : IVectorLayerProvider<uint>
{
private const string RetrievedGeometryColumnName = "sharpmap_tempgeometry";
private static readonly NumberFormatInfo NumberFormat_enUS
= new CultureInfo("en-US", false).NumberFormat;
private string _defintionQuery;
private string _objectIdColumn;
private string _geometryColumn;
private string _table;
private bool _isOpen;
private string _connectionString;
private bool _isDisposed = false;
private int? _srid = null;
#region Object construction and disposal
#region Constructors
/// <summary>
/// Initializes a new connection to Oracle
/// </summary>
/// <param name="connectionString">Connectionstring</param>
/// <param name="tablename">Name of data table</param>
/// <param name="geometryColumnName">Name of geometry column</param>
/// /// <param name="oidColumnName">Name of column with unique identifier</param>
public OracleSpatialProvider(string connectionString, string tablename, string geometryColumnName,
string oidColumnName)
{
ConnectionString = connectionString;
Table = tablename;
GeometryColumn = geometryColumnName;
ObjectIdColumn = oidColumnName;
}
/// <summary>
/// Initializes a new connection to Oracle
/// </summary>
/// <param name="username">Username</param>
/// <param name="password">Password</param>
/// <param name="datasource">Datasoure</param>
/// <param name="tablename">Tablename</param>
/// <param name="geometryColumnName">Geometry column name</param>
/// <param name="oidColumnName">Object ID column</param>
public OracleSpatialProvider(string username, string password, string datasource, string tablename,
string geometryColumnName, string oidColumnName)
: this(String.Format("User Id={0};Password={1};Data Source={2}", username, password, datasource),
tablename, geometryColumnName, oidColumnName)
{
}
/// <summary>
/// Initializes a new connection to Oracle
/// </summary>
/// <param name="connectionString">Connectionstring</param>
/// <param name="tablename">Name of data table</param>
/// <param name="oidColumnName">Name of column with unique identifier</param>
public OracleSpatialProvider(string connectionString, string tablename, string oidColumnName)
: this(connectionString, tablename, "", oidColumnName)
{
GeometryColumn = GetGeometryColumn();
}
#endregion
#region Disposers and finalizers
/// <summary>
/// Finalizer
/// </summary>
~OracleSpatialProvider()
{
Dispose(false);
}
#region IDisposable Memebers
/// <summary>
/// Disposes the object
/// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
IsDisposed = true;
}
#endregion
private void Dispose(bool disposing)
{
if (IsDisposed)
{
return;
}
if (disposing)
{
}
}
public bool IsDisposed
{
get { return _isDisposed; }
private set { _isDisposed = value; }
}
#endregion
#endregion
/// <summary>
/// Connectionstring
/// </summary>
public string ConnectionString
{
get { return _connectionString; }
set { _connectionString = value; }
}
/// <summary>
/// Definition query used for limiting dataset
/// </summary>
public string DefinitionQuery
{
get { return _defintionQuery; }
set { _defintionQuery = value; }
}
/// <summary>
/// Gets the connection id of the datasource
/// </summary>
public string ConnectionId
{
get { return _connectionString; }
}
public ICoordinateTransformation CoordinateTransformation
{
get { throw new NotImplementedException(); }
set { throw new NotImplementedException(); }
}
/// <summary>
/// Name of geometry column
/// </summary>
public string GeometryColumn
{
get { return _geometryColumn; }
set { _geometryColumn = value; }
}
/// <summary>
/// Returns true if the datasource is currently open
/// </summary>
public bool IsOpen
{
get { return _isOpen; }
}
/// <summary>
/// Name of column that contains the Object ID
/// </summary>
public string ObjectIdColumn
{
get { return _objectIdColumn; }
set { _objectIdColumn = value; }
}
public ICoordinateSystem SpatialReference
{
get { throw new NotImplementedException(); }
}
/// <summary>
/// Gets the id of a well-known spatial reference system.
/// </summary>
public int? Srid
{
get
{
if (_srid == null)
{
string sql = "SELECT SRID FROM USER_SDO_GEOM_METADATA WHERE TABLE_NAME='" + Table + "'";
using (OracleConnection conn = new OracleConnection(_connectionString))
{
using (OracleCommand command = new OracleCommand(sql, conn))
{
try
{
conn.Open();
_srid = (int)(decimal)command.ExecuteScalar();
conn.Close();
}
catch (OracleException) { }
}
}
}
return _srid;
}
set { throw new NotSupportedException("Spatial Reference ID cannot be set on an Oracle table"); }
}
/// <summary>
/// Data table name
/// </summary>
public string Table
{
get { return _table; }
set { _table = value; }
}
/// <summary>
/// Closes the datasource
/// </summary>
public void Close()
{
//Don't really do anything. Oracle's connection pooling takes over here.
_isOpen = false;
}
public IFeatureDataReader ExecuteIntersectionQuery(BoundingBox box)
{
throw new NotImplementedException();
}
public void ExecuteIntersectionQuery(BoundingBox box, FeatureDataTable table)
{
throw new NotImplementedException();
}
/// <summary>
/// Returns all features with the view box
/// </summary>
/// <param name="bbox">view box</param>
/// <param name="ds">FeatureDataSet to fill data into</param>
public void ExecuteIntersectionQuery(BoundingBox bbox, FeatureDataSet ds)
{
using (OracleConnection conn = new OracleConnection(_connectionString))
{
//Get bounding box string
string strBbox = getBoxFilterClause(bbox);
string sql = "SELECT g.*, g." + GeometryColumn + ".Get_WKB() AS " + RetrievedGeometryColumnName
+ "FROM " + Table + " g WHERE ";
if (!String.IsNullOrEmpty(_defintionQuery))
{
sql += DefinitionQuery + " AND ";
}
sql += strBbox;
using (OracleDataAdapter adapter = new OracleDataAdapter(sql, conn))
{
conn.Open();
DataSet ds2 = new DataSet();
adapter.Fill(ds2);
conn.Close();
if (ds2.Tables.Count > 0)
{
FeatureDataTable fdt = new FeatureDataTable(ds2.Tables[0]);
foreach (DataColumn col in ds2.Tables[0].Columns)
{
if (col.ColumnName != GeometryColumn && col.ColumnName != RetrievedGeometryColumnName)
{
fdt.Columns.Add(col.ColumnName, col.DataType, col.Expression);
}
}
foreach (DataRow dr in ds2.Tables[0].Rows)
{
FeatureDataRow fdr = fdt.NewRow();
foreach (DataColumn col in ds2.Tables[0].Columns)
{
if (col.ColumnName != GeometryColumn && col.ColumnName != RetrievedGeometryColumnName)
{
fdr[col.ColumnName] = dr[col];
}
}
fdr.Geometry = GeometryFromWkb.Parse((byte[])dr[RetrievedGeometryColumnName]);
fdt.AddRow(fdr);
}
ds.Tables.Add(fdt);
}
}
}
}
public IFeatureDataReader ExecuteIntersectionQuery(Geometry geom)
{
throw new NotImplementedException();
}
public void ExecuteIntersectionQuery(Geometry geom, FeatureDataTable table)
{
throw new NotImplementedException();
}
/// <summary>
/// Returns the features that intersects with 'geom'
/// </summary>
/// <param name="geom"></param>
/// <param name="ds">FeatureDataSet to fill data into</param>
public void ExecuteIntersectionQuery(Geometry geom, FeatureDataSet ds)
{
using (OracleConnection conn = new OracleConnection(_connectionString))
{
string strGeom = "MDSYS.SDO_GEOMETRY('" + geom.AsText() + "', #SRID#)";
if (Srid != null)
{
strGeom = strGeom.Replace("#SRID#", Srid.Value.ToString(NumberFormat_enUS));
}
else
{
strGeom = strGeom.Replace("#SRID#", "NULL");
}
strGeom = "SDO_RELATE(g." + GeometryColumn + ", " + strGeom + ", 'mask=ANYINTERACT querytype=WINDOW') = 'TRUE'";
string strSQL = "SELECT g.*, g." + GeometryColumn + ").Get_WKB() As " + RetrievedGeometryColumnName
+ " FROM " + Table + " g WHERE ";
if (!String.IsNullOrEmpty(_defintionQuery))
strSQL += DefinitionQuery + " AND ";
strSQL += strGeom;
using (OracleDataAdapter adapter = new OracleDataAdapter(strSQL, conn))
{
conn.Open();
adapter.Fill(ds);
conn.Close();
if (ds.Tables.Count > 0)
{
FeatureDataTable fdt = new FeatureDataTable(ds.Tables[0]);
foreach (DataColumn col in ds.Tables[0].Columns)
if (col.ColumnName != GeometryColumn && col.ColumnName != RetrievedGeometryColumnName)
fdt.Columns.Add(col.ColumnName, col.DataType, col.Expression);
foreach (DataRow dr in ds.Tables[0].Rows)
{
FeatureDataRow fdr = fdt.NewRow();
foreach (DataColumn col in ds.Tables[0].Columns)
{
if (col.ColumnName != GeometryColumn && col.ColumnName != RetrievedGeometryColumnName)
{
fdr[col.ColumnName] = dr[col];
}
}
fdr.Geometry = GeometryFromWkb.Parse((byte[])dr[RetrievedGeometryColumnName]);
fdt.AddRow(fdr);
}
ds.Tables.Add(fdt);
}
}
}
}
/// <summary>
/// Computes the full extents of the data which this data source represents.
/// </summary>
/// <returns>A BoundingBox fully containing all the available features.</returns>
public BoundingBox GetExtents()
{
using (OracleConnection conn = new OracleConnection(_connectionString))
{
string sql = "SELECT SDO_AGGR_MBR(g." + GeometryColumn + ").Get_WKT() FROM " + Table + " g ";
if (!String.IsNullOrEmpty(_defintionQuery))
{
sql += " WHERE " + DefinitionQuery;
}
using (OracleCommand command = new OracleCommand(sql, conn))
{
conn.Open();
object result = command.ExecuteScalar();
conn.Close();
if (result == DBNull.Value)
{
return BoundingBox.Empty;
}
string boxClause = (string)result;
if (boxClause.StartsWith("POLYGON", StringComparison.InvariantCultureIgnoreCase))
{
boxClause = boxClause.Replace("POLYGON", "");
boxClause = boxClause.Trim();
boxClause = boxClause.Replace("(", "");
boxClause = boxClause.Replace(")", "");
List<double> xX = new List<double>();
List<double> yY = new List<double>();
String[] points = boxClause.Split(',');
string point;
foreach (string s in points)
{
String[] nums;
point = s.Trim();
nums = point.Split(' ');
xX.Add(double.Parse(nums[0], NumberFormat_enUS));
yY.Add(double.Parse(nums[1], NumberFormat_enUS));
}
double minX = Double.MaxValue;
double minY = Double.MaxValue;
double maxX = Double.MinValue;
double maxY = Double.MinValue;
foreach (double d in xX)
{
if (d > maxX)
{
maxX = d;
}
if (d < minX)
{
minX = d;
}
}
foreach (double d in yY)
{
if (d > maxY)
{
maxY = d;
}
if (d < minY)
{
minY = d;
}
}
return new BoundingBox(minX, minY, maxX, maxY);
}
else
{
return BoundingBox.Empty;
}
}
}
}
/// <summary>
/// Returns a feature based on an object id.
/// </summary>
/// <param name="oid"></param>
/// <returns>datarow</returns>
public FeatureDataRow<uint> GetFeature(uint oid)
{
using (OracleConnection conn = new OracleConnection(_connectionString))
{
string sql = "SELECT g.* , g." + GeometryColumn + ").Get_WKB() As " + RetrievedGeometryColumnName
+ " FROM " + Table + " g WHERE " + ObjectIdColumn + "='" + oid + "'";
using (OracleDataAdapter adapter = new OracleDataAdapter(sql, conn))
{
FeatureDataSet ds = new FeatureDataSet();
conn.Open();
adapter.Fill(ds);
conn.Close();
if (ds.Tables.Count > 0)
{
FeatureDataTable<uint> fdt = new FeatureDataTable<uint>(ds.Tables[0], ObjectIdColumn);
foreach (DataColumn col in ds.Tables[0].Columns)
{
if (col.ColumnName != GeometryColumn && col.ColumnName != RetrievedGeometryColumnName)
{
fdt.Columns.Add(col.ColumnName, col.DataType, col.Expression);
}
}
if (ds.Tables[0].Rows.Count > 0)
{
DataRow dr = ds.Tables[0].Rows[0];
FeatureDataRow<uint> fdr = fdt.NewRow((uint)dr[ObjectIdColumn]);
foreach (DataColumn col in ds.Tables[0].Columns)
{
if (col.ColumnName != GeometryColumn
&& col.ColumnName != RetrievedGeometryColumnName
&& col.ColumnName != ObjectIdColumn)
{
fdr[col.ColumnName] = dr[col];
}
}
fdr.Geometry = GeometryFromWkb.Parse((byte[])dr[RetrievedGeometryColumnName]);
return fdr;
}
else
{
return null;
}
}
else
{
return null;
}
}
}
}
/// <summary>
/// Returns the number of features in the dataset
/// </summary>
/// <returns>number of features</returns>
public int GetFeatureCount()
{
int count;
using (OracleConnection conn = new OracleConnection(_connectionString))
{
string strSQL = "SELECT COUNT(*) FROM " + Table;
if (!String.IsNullOrEmpty(_defintionQuery))
strSQL += " WHERE " + DefinitionQuery;
using (OracleCommand command = new OracleCommand(strSQL, conn))
{
conn.Open();
count = (int)command.ExecuteScalar();
conn.Close();
}
}
return count;
}
/// <summary>
/// Returns geometries within the specified bounding box
/// </summary>
/// <param name="bbox"></param>
/// <returns></returns>
public IEnumerable<Geometry> GetGeometriesInView(BoundingBox bbox)
{
Collection<Geometry> features = new Collection<Geometry>();
using (OracleConnection conn = new OracleConnection(_connectionString))
{
//Get bounding box string
string strBbox = getBoxFilterClause(bbox);
//string strSQL = "SELECT AsBinary(" + this.GeometryColumn + ") AS Geom ";
string sql = "SELECT g." + GeometryColumn + ".Get_WKB() ";
sql += " FROM " + Table + " g WHERE ";
if (!String.IsNullOrEmpty(_defintionQuery))
{
sql += DefinitionQuery + " AND ";
}
sql += strBbox;
using (OracleCommand command = new OracleCommand(sql, conn))
{
conn.Open();
using (OracleDataReader dr = command.ExecuteReader())
{
while (dr.Read())
{
if (dr[0] != DBNull.Value)
{
Geometry geom = GeometryFromWkb.Parse((byte[])dr[0]);
if (geom != null)
{
features.Add(geom);
}
}
}
}
conn.Close();
}
}
return features;
}
/// <summary>
/// Returns the geometry corresponding to the Object ID
/// </summary>
/// <param name="oid">Object ID</param>
/// <returns>geometry</returns>
public Geometry GetGeometryById(uint oid)
{
Geometry geom = null;
using (OracleConnection conn = new OracleConnection(_connectionString))
{
string sql = "SELECT g." + GeometryColumn + ".Get_WKB() FROM " + Table
+ " g WHERE " + ObjectIdColumn + "='" + oid + "'";
conn.Open();
using (OracleCommand command = new OracleCommand(sql, conn))
{
using (OracleDataReader dr = command.ExecuteReader())
{
while (dr.Read())
{
if (dr[0] != DBNull.Value)
{
geom = GeometryFromWkb.Parse((byte[])dr[0]);
}
}
}
}
conn.Close();
}
return geom;
}
/// <summary>
/// Queries the Oracle database to get the name of the Geometry Column. This is used if the columnname isn't specified in the constructor
/// </summary>
/// <remarks></remarks>
/// <returns>Name of column containing geometry</returns>
private string GetGeometryColumn()
{
string strSQL = "select COLUMN_NAME from USER_SDO_GEOM_METADATA WHERE TABLE_NAME='" + Table + "'";
using (OracleConnection conn = new OracleConnection(_connectionString))
using (OracleCommand command = new OracleCommand(strSQL, conn))
{
conn.Open();
object columnname = command.ExecuteScalar();
conn.Close();
if (columnname == DBNull.Value)
throw new ApplicationException("Table '" + Table + "' does not contain a geometry column");
return (string)columnname;
}
}
/// <summary>
/// Returns geometry Object IDs whose bounding box intersects 'bbox'
/// </summary>
/// <param name="bbox"></param>
/// <returns></returns>
public IEnumerable<uint> GetObjectIdsInView(BoundingBox bbox)
{
List<uint> objectlist = new List<uint>();
using (OracleConnection conn = new OracleConnection(_connectionString))
{
//Get bounding box string
string boundsClause = getBoxFilterClause(bbox);
string sql = "SELECT g." + ObjectIdColumn + " ";
sql += "FROM " + Table + " g WHERE ";
if (!String.IsNullOrEmpty(_defintionQuery))
{
sql += DefinitionQuery + " AND ";
}
sql += boundsClause;
using (OracleCommand command = new OracleCommand(sql, conn))
{
conn.Open();
using (OracleDataReader dr = command.ExecuteReader())
{
while (dr.Read())
{
if (dr[0] != DBNull.Value)
{
uint id = (uint)(decimal)dr[0];
objectlist.Add(id);
}
}
}
conn.Close();
}
}
return objectlist;
}
public DataTable GetSchemaTable()
{
throw new NotImplementedException();
}
/// <summary>
/// Opens the datasource
/// </summary>
public void Open()
{
//Don't really do anything. Oracle's connection pooling takes over here.
_isOpen = true;
}
public void SetTableSchema(FeatureDataTable<uint> table)
{
throw new NotImplementedException();
}
public void SetTableSchema(FeatureDataTable table)
{
throw new NotImplementedException();
}
#region Private helper methods
/// <summary>
/// Returns the box filter string needed in SQL query
/// </summary>
/// <param name="bbox"></param>
/// <returns></returns>
private string getBoxFilterClause(BoundingBox bbox)
{
string strBbox = "SDO_FILTER(g." + GeometryColumn + ", mdsys.sdo_geometry(2003,#SRID#,NULL," +
"mdsys.sdo_elem_info_array(1,1003,3)," +
"mdsys.sdo_ordinate_array(" +
bbox.Min.X.ToString(NumberFormat_enUS) + ", " +
bbox.Min.Y.ToString(NumberFormat_enUS) + ", " +
bbox.Max.X.ToString(NumberFormat_enUS) + ", " +
bbox.Max.Y.ToString(NumberFormat_enUS) + ")), " +
"'querytype=window') = 'TRUE'";
if (Srid != null)
{
strBbox = strBbox.Replace("#SRID#", Srid.Value.ToString(NumberFormat_enUS));
}
else
{
strBbox = strBbox.Replace("#SRID#", "NULL");
}
return strBbox;
}
#endregion
}
}