Sha256: 737ed2d9227242ec5d2b4c3f17e709a88e9a6d6cb49d3c0d7a5a6699a1d4ed55
Contents?: true
Size: 938 Bytes
Versions: 10
Compression:
Stored size: 938 Bytes
Contents
#!/usr/bin/env jruby # useful if being run inside a source code checkout $: << 'lib' $: << '../lib' require 'rubygems' require 'neo4j/spatial' require 'neo4j/spatial/cmd' require 'fileutils' $files = Neo4j::Spatial::Cmd.args $script = $0.split(/[\\\/]+/)[-1].gsub(/\.rb$/,'') $formats = [:shp, :osm] $formats.each do |f| $format = f if($0 =~ /#{f}/) end if $help || $files.length < 1 || $format.nil? puts "usage: #{$script} <-d> <-D storage_path> #{$format ? "file.#{$format}" : "<-F format> file"}" puts "\t-d\tDelete database first" puts "\t-D\tUse specified database location" puts "\t-F\tImport specified format (#{$formats.join(', ')})" unless($format) exit end if $delete puts "Deleting previous database #{Neo4j::Config[:storage_path]}" FileUtils.rm_rf Neo4j::Config[:storage_path] end importer = eval "Neo4j::Spatial::#{$format.to_s.upcase}Importer.new" $files.each do |file| importer.import file end
Version data entries
10 entries across 2 versions & 1 rubygems