diff --git a/datastore.go b/datastore.go index a887ab7..24feaa5 100644 --- a/datastore.go +++ b/datastore.go @@ -11,6 +11,7 @@ type datastore struct { Name string `yaml:"name"` } +//BuildConnectionString return postgres connection as string func (ds *datastore) BuildConnectionString() string { return fmt.Sprintf("PG: host=%s port=%d dbname=%s user=%s password=%s", ds.Host, ds.Port, ds.DBName, ds.DBUser, ds.DBPass) } diff --git a/layer.go b/layer.go index ffa5752..c6e3c69 100644 --- a/layer.go +++ b/layer.go @@ -55,14 +55,14 @@ func (layer *GdalLayer) LayerToPostgis(targetSource gdal.DataSource, manager *Ma return } -//GetGeomtryName Get Geometry Name +//GetGeomtryName Get Geometry Name point/line/....etc func (layer *GdalLayer) GetGeomtryName() (geometryName string) { geom := gdal.Create(layer.Layer.Type()) geometryName = geom.Name() return } -//GetLayerSchema Get Layer Schema +//GetLayerSchema return slice of layer fields func (layer *GdalLayer) GetLayerSchema() (fields []*LayerField) { if layer.Layer != nil { layerDef := layer.Layer.Definition() @@ -84,7 +84,7 @@ func (layer *GdalLayer) GetLayerSchema() (fields []*LayerField) { return } -//GetFeatures Get Layer Features +//GetFeatures return layer features func (layer *GdalLayer) GetFeatures() (features []*gdal.Feature) { if layer.Layer != nil { count, ok := layer.Layer.FeatureCount(true) diff --git a/manager.go b/manager.go index 7ae40cb..90aad86 100644 --- a/manager.go +++ b/manager.go @@ -50,7 +50,7 @@ func (manager *ManagerConfig) PublishGeoserverLayer(layer *GdalLayer) (ok bool, return } -//OpenSource open Datasource +//OpenSource open data source from path func (manager *ManagerConfig) OpenSource(path string, access int) (source gdal.DataSource, ok bool) { driver, err := manager.GetDriver(path) if err != nil { @@ -60,7 +60,7 @@ func (manager *ManagerConfig) OpenSource(path string, access int) (source gdal.D return } -//GetDriver open Datasource +//GetDriver return the proper driver based on file path func (manager *ManagerConfig) GetDriver(path string) (driver gdal.OGRDriver, err error) { if pgRegex.MatchString(path) { driver = gdal.OGRDriverByName(postgreSQLDriver)