Skip to content

Commit

Permalink
addGeoRegion() actually doesn't serve a purpose, replace with add()
Browse files Browse the repository at this point in the history
  • Loading branch information
natgeo-wong committed Sep 7, 2024
1 parent f9cec08 commit 2085361
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 25 deletions.
4 changes: 1 addition & 3 deletions src/GeoRegions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ export
RectRegion, PolyRegion, TiltRegion,

==, isGeoRegion, isID,
add, addGeoRegion,
rm, rmID,
overwrite,
add, rm, rmID, overwrite,

templateGeoRegions, readGeoRegions, addGeoRegions, resetGeoRegions,
tableGeoRegions, tableRectRegions, tableTiltRegions, tablePolyRegions,
Expand Down
38 changes: 16 additions & 22 deletions src/georegions/add.jl
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
add(
geo :: GeoRegion;
path :: AbstractString = dirname(geo.path),
verbose :: Bool = true
) = addGeoRegion(geo,path,verbose=verbose)

function overwrite(
geo :: GeoRegion;
path :: AbstractString,
verbose :: Bool = true
)

rmID(geo.ID,path=path)
add(geo,path=path,verbose=verbose)

return nothing

end

function addGeoRegion(
function add(
geo :: RectRegion,
path :: AbstractString = dirname(geo.path);
verbose :: Bool = true
Expand All @@ -33,7 +14,7 @@ function addGeoRegion(

end

function addGeoRegion(
function add(
geo :: TiltRegion,
path :: AbstractString = dirname(geo.path);
verbose :: Bool = true
Expand All @@ -49,7 +30,7 @@ function addGeoRegion(

end

function addGeoRegion(
function add(
geo :: PolyRegion,
path :: AbstractString = dirname(geo.path);
verbose :: Bool = true
Expand All @@ -65,4 +46,17 @@ function addGeoRegion(

return nothing

end

function overwrite(
geo :: GeoRegion;
path :: AbstractString,
verbose :: Bool = true
)

rmID(geo.ID,path=path)
add(geo,path=path,verbose=verbose)

return nothing

end

0 comments on commit 2085361

Please sign in to comment.