dotConnect for PostgreSQL Documentation
In This Topic
    Spatial Service Type
    In This Topic

    This topic is applicable to Entity Framework v5 and v6. For Entity Framework Core, see Spatial Data Support for EF Core.

    The spatial service used is specified in the SpatialServiceType property.

    var config = PgSqlEntityProviderConfig.Instance;
    config.SpatialOptions.SpatialServiceType = SpatialServiceType.NetTopologySuite;
    
    
    Dim config = PgSqlEntityProviderConfig.Instance
    config.SpatialOptions.SpatialServiceType = SpatialServiceType.NetTopologySuite
    
    

    Setting this property is enough to use spatials. You can omit setting other options related to spatials.

    Alternatively, you may specify the spatial service to use in the project config file. For this, you need to update or add the configSections element like it is described in the Entity Framework Provider Configuration section and then add the following Devart.Data.PostgreSql.Entity tag to the configuration tag:

     <Devart.Data.PostgreSql.Entity xmlns="http://devart.com/schemas/Devart.Data.PostgreSql.Entity/1.0">
      <SpatialOptions SpatialServiceType="NetTopologySuite" />
     </Devart.Data.PostgreSql.Entity>
    

    Note: If you need to set multiple Entity Framework provider options for dotConnect for PostgreSQL, don't add multiple Devart.Data.PostgreSql.Entity tags. Specify all settings in one Devart.Data.PostgreSql.Entity tag.

    See Also

    Default SRID  | Choosing Spatial Service  | Area and Distance Units  | DbGeometry/DbGeography Support in Spatial Services