Skip to content

Commit 8c086be

Browse files
Merge pull request #10 from mikejohnson51/main
change inputs
2 parents 53c7bce + 6836bac commit 8c086be

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

README.Rmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Options:
4949
-r string
5050
Hydrofabric version (default "pre-release")
5151
-t string
52-
One of: "hf", "hl", "comid", "loc", or "nldi" (default "hf")
52+
One of: "id", "hl_uri", "comid", "xy", or "nldi" (default "hf")
5353
```
5454

5555
## NextGen Needs GeoJSON
@@ -64,11 +64,11 @@ Here is a full-stop example of extracting a subset for a hydrolocation, using th
6464
mkdir poudre
6565
cd poudre
6666
67-
hfsubset -l divides,nexus,flowpath_attributes -o ./poudre-subset.gpkg -r "pre-release" -t hl "Gages-06752260"
67+
hfsubset -l core -o ./poudre-subset.gpkg -r "pre-release" -t hl_uri "Gages-06752260"
6868
69-
ogr2ogr -f GeoJSON catchments.geojson poudre-subset.gpkg -nln divides
70-
ogr2ogr -f GeoJSON nexus.geojson poudre-subset.gpkg -nln nexus
71-
ogr2ogr -f CSV flowpath_attributes.csv poudre-subset.gpkg -nln flowpath_attributes
69+
ogr2ogr -f GeoJSON catchments.geojson poudre-subset.gpkg divides
70+
ogr2ogr -f GeoJSON nexus.geojson poudre-subset.gpkg nexus
71+
ogr2ogr -f CSV flowpath_attributes.csv poudre-subset.gpkg flowpath_attributes
7272
7373
ls poudre
7474
```

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Options:
4141
-r string
4242
Hydrofabric version (default "pre-release")
4343
-t string
44-
One of: "hf", "hl", "comid", "loc", or "nldi" (default "hf")
44+
One of: "id", "hl_uri", "comid", "xy", or "nldi" (default "hf")
4545
```
4646

4747
## NextGen Needs GeoJSON
@@ -59,15 +59,16 @@ using the CLI, and generating the needed files for NextGen
5959
mkdir poudre
6060
cd poudre
6161

62-
hfsubset -l divides,nexus,flowpath_attributes -o ./poudre-subset.gpkg -r "pre-release" -t hl "Gages-06752260"
62+
hfsubset -l core -o ./poudre-subset.gpkg -r "pre-release" -t hl_uri "Gages-06752260"
6363

64-
ogr2ogr -f GeoJSON catchments.geojson poudre-subset.gpkg -nln divides
65-
ogr2ogr -f GeoJSON nexus.geojson poudre-subset.gpkg -nln nexus
66-
ogr2ogr -f CSV flowpath_attributes.csv poudre-subset.gpkg -nln flowpath_attributes
64+
ogr2ogr -f GeoJSON catchments.geojson poudre-subset.gpkg divides
65+
ogr2ogr -f GeoJSON nexus.geojson poudre-subset.gpkg nexus
66+
ogr2ogr -f CSV flowpath_attributes.csv poudre-subset.gpkg flowpath_attributes
6767

6868
ls poudre
6969
```
7070

7171
## License
7272

73-
`hfsubset` is distributed under [GNU General Public License v3.0 or later](LICENSE.md)
73+
`hfsubset` is distributed under [GNU General Public License v3.0 or
74+
later](LICENSE.md)

cli/main.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ Examples:
4343
hfsubset -l divides,nexus \
4444
-o ./divides_nexus.gpkg \
4545
-r "pre-release" \
46-
-t hl \
46+
-t hl_uri \
4747
"Gages-06752260"
4848
49-
hfsubset -o ./poudre.gpkg -t hl "Gages-06752260"
49+
hfsubset -o ./poudre.gpkg -t hl_uri "Gages-06752260"
5050
5151
Options:
5252
`
@@ -83,25 +83,25 @@ func (opts *SubsetRequest) MarshalJSON() ([]byte, error) {
8383
jsonmap := make(map[string]any)
8484

8585
switch *opts.id_type {
86-
case "hf":
86+
case "id":
8787
key = "id"
8888
break
89-
case "hl":
89+
case "hl_uri":
9090
key = "hl_uri"
9191
break
9292
case "comid":
9393
key = "comid"
9494
break
95-
case "nldi":
95+
case "nldi_feature":
9696
// key = "nldi"
9797
// break
9898
fallthrough
9999
case "xy":
100100
// key = "loc"
101101
// break
102-
panic("-nldi and -xy support are not implemented currently")
102+
panic("-nldi_feature and -xy support are not implemented currently")
103103
default:
104-
panic("type " + *opts.id_type + " not supported; only one of: hf, hl, comid, nldi, xy")
104+
panic("type " + *opts.id_type + " not supported; only one of: id, hl_uri, comid, nldi_feature, xy")
105105
}
106106

107107
jsonmap["layers"] = opts.Layers()
@@ -183,7 +183,7 @@ Either "all" or "core", or one or more of:
183183
"reference_catchment", "reference_flowpaths", "reference_divides"`
184184

185185
opts := new(SubsetRequest)
186-
opts.id_type = flag.String("t", "hf", `One of: "hf", "hl", "comid", "loc", or "nldi"`)
186+
opts.id_type = flag.String("t", "id", `One of: "id", "hl_uri", "comid", "xy", or "nldi_feature"`)
187187
opts.layers = flag.String("l", "core", layers_help)
188188
opts.version = flag.String("r", "pre-release", "Hydrofabric version")
189189
opts.output = flag.String("o", "hydrofabric.gpkg", "Output file name")

0 commit comments

Comments
 (0)