Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new connection to PostGIS
        /// </summary>
        /// <param name="connectionString">Connectionstring</param>
        /// <param name="tablename">Name of data table</param>
        /// <param name="objectIdColumnName">Name of column with unique identifier</param>
        public PostGIS(string connectionString, string tablename, string objectIdColumnName)
            : this(connectionString, tablename, "", objectIdColumnName)
        {
            int srid;

            GeometryColumn = GetGeometryColumn(out srid);
            SRID           = srid;

            if (!string.IsNullOrEmpty(GeometryColumn))
            {
                _postGisSpatialObject = GetSpatialObjectType();
                SRID = GetGeometrySrid();
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new connection to PostGIS
 /// </summary>
 /// <param name="connectionString">Connectionstring</param>
 /// <param name="tablename">Name of data table</param>
 /// <param name="geometryColumnName">Name of geometry column</param>
 /// <param name="objectIdColumnName">Name of column with unique identifier</param>
 public PostGIS(string connectionString, string tablename, string geometryColumnName, string objectIdColumnName)
 {
     ConnectionString = connectionString;
     Table            = tablename;
     GeometryColumn   = geometryColumnName;
     if (!string.IsNullOrEmpty(geometryColumnName))
     {
         _postGisSpatialObject = GetSpatialObjectType();
         SRID = GetGeometrySrid();
     }
     ObjectIdColumn         = objectIdColumnName;
     _postGisVersion        = GetPostGISVersion();
     _supportSTIntersects   = _postGisVersion >= 1.3;
     _supportSTMakeBox2d    = _postGisVersion >= 1.4;
     _supportSTMakeEnvelope = _postGisVersion >= 2.0;
     if (_postGisVersion >= 1.5)
     {
         _prefixFunction = "ST_";
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new connection to PostGIS
        /// </summary>
        /// <param name="connectionString">Connectionstring</param>
        /// <param name="tablename">Name of data table</param>
        /// <param name="objectIdColumnName">Name of column with unique identifier</param>
        public PostGIS(string connectionString, string tablename, string objectIdColumnName)
            : this(connectionString, tablename, "", objectIdColumnName)
        {
            int srid;
            GeometryColumn = GetGeometryColumn(out srid);
            SRID = srid;

            if (!string.IsNullOrEmpty(GeometryColumn))
            {
                _postGisSpatialObject = GetSpatialObjectType();
                SRID = GetGeometrySrid();
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new connection to PostGIS
 /// </summary>
 /// <param name="connectionString">Connectionstring</param>
 /// <param name="tablename">Name of data table</param>
 /// <param name="geometryColumnName">Name of geometry column</param>
 /// <param name="objectIdColumnName">Name of column with unique identifier</param>
 public PostGIS(string connectionString, string tablename, string geometryColumnName, string objectIdColumnName)
 {
     ConnectionString = connectionString;
     Table = tablename;
     GeometryColumn = geometryColumnName;
     if (!string.IsNullOrEmpty(geometryColumnName))
     {
         _postGisSpatialObject = GetSpatialObjectType();
         SRID = GetGeometrySrid();
     }
     ObjectIdColumn = objectIdColumnName;
     _postGisVersion = GetPostGISVersion();
     _supportSTIntersects = _postGisVersion >= 1.3;
     _supportSTMakeBox2d = _postGisVersion >= 1.4;
     _supportSTMakeEnvelope = _postGisVersion >= 2.0;
     if (_postGisVersion >= 1.5)
         _prefixFunction = "ST_";
 }