Skip to content

Commit

Permalink
remake won't allow duplication location tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Lindsay Carr committed Jan 5, 2018
1 parent 6b40412 commit cf79e4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions scripts/process/save_map.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ process.save_map <- function(viz){
# saves empty file if there is not any map features
if(nrow(map_data) > 0){
map_data_sp <- as(map_data, "Spatial")
rgdal::writeOGR(map_data_sp, viz[['location']],
rgdal::writeOGR(map_data_sp, viz[['savelocation']],
layer="map_data_sp", driver="GeoJSON")
} else {
write.table(data.frame(), viz[["location"]])
write.table(data.frame(), viz[["savelocation"]])
}

}
8 changes: 4 additions & 4 deletions viz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ process:
mask_poly: "state_map_data"
-
id: state_map_geojson
location: cache/state_map.geojson
savelocation: cache/state_map.geojson
reader: json
processor: save_map
scripts: [scripts/process/save_map.R]
Expand All @@ -141,23 +141,23 @@ process:
mimetype: application/javascript
-
id: county_map_geojson
location: cache/county_map.geojson
savelocation: cache/county_map.geojson
reader: json
processor: save_map
scripts: [scripts/process/save_map.R]
depends:
map_data: county_map_data
-
id: puerto_rico_map_geojson
location: cache/puerto_rico_map.geojson
savelocation: cache/puerto_rico_map.geojson
reader: json
processor: save_map
scripts: [scripts/process/save_map.R]
depends:
map_data: puerto_rico_map_data
-
id: islands_map_geojson
location: cache/islands_map.geojson
savelocation: cache/islands_map.geojson
reader: json
processor: save_map
scripts: [scripts/process/save_map.R]
Expand Down

3 comments on commit cf79e4c

@aappling-usgs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this. Isn't location a really standard viz argument? What is remake telling you?

@lindsayplatt
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to use location: cache/state_map.geojson in both a process ID and a publish ID. If both keys are location, then I get this error (which I assumed was remake, but might be vizlab):

Error in yaml.load(readLines(con), error.label = error.label, ...) : 
  (remake.yaml) Duplicate map key: 'cache/state_map.geojson'

location is standard ... but not sure how else to get around that duplication bit.

@aappling-usgs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a remake error but occurs because of the remake/vizlab combo. Would you mind changing location back locally (temporarily), running vizmake, and then sharing a copy of the full remake file with me? This might be quickly solvable.

Please sign in to comment.