Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hisham waleed karam committed Oct 6, 2018
1 parent 3a720c9 commit 7359b03
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
6 changes: 3 additions & 3 deletions layer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand Down

0 comments on commit 7359b03

Please sign in to comment.