forked from MapComplete/MapComplete
		
	Add button to reload the cache in the import helper
This commit is contained in:
		
							parent
							
								
									50a7597c5a
								
							
						
					
					
						commit
						34e7a98d5d
					
				
					 3 changed files with 37 additions and 19 deletions
				
			
		|  | @ -1,6 +1,7 @@ | |||
| import * as fs from "fs"; | ||||
| import {TagUtils} from "../Logic/Tags/TagUtils"; | ||||
| import {writeFileSync} from "fs"; | ||||
| import {TagsFilter} from "../Logic/Tags/TagsFilter"; | ||||
| 
 | ||||
| function main(args) { | ||||
|     if (args.length < 2) { | ||||
|  | @ -13,7 +14,13 @@ function main(args) { | |||
|     const output = args[2] | ||||
| 
 | ||||
|     const data = JSON.parse(fs.readFileSync(path, "UTF8")) | ||||
|     const filter = TagUtils.Tag(JSON.parse(spec)) | ||||
|     let filter : TagsFilter ; | ||||
|     try{ | ||||
|        filter = TagUtils.Tag(JSON.parse(spec)) | ||||
|          | ||||
|     }catch(e){ | ||||
|         filter = TagUtils.Tag(spec) | ||||
|     } | ||||
|     const features = data.features.filter(f => filter.matchesProperties(f.properties)) | ||||
| 
 | ||||
|     if(features.length === 0){ | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue