shp2geocouch 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/bin/shp2geocouch +4 -9
- metadata +4 -4
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.3
|
data/bin/shp2geocouch
CHANGED
|
@@ -9,7 +9,7 @@ class ShapefileToGeoCouch
|
|
|
9
9
|
|
|
10
10
|
def initialize(options)
|
|
11
11
|
set_accessors(options)
|
|
12
|
-
@db = CouchRest.database!
|
|
12
|
+
@db = CouchRest.database! @couch_url
|
|
13
13
|
verify_dependencies
|
|
14
14
|
convert
|
|
15
15
|
upload
|
|
@@ -28,15 +28,10 @@ class ShapefileToGeoCouch
|
|
|
28
28
|
raise "#{dependency} isn't installed or isn't in your current path."
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
|
-
begin
|
|
32
|
-
@db.get("")
|
|
33
|
-
rescue Errno::ECONNREFUSED
|
|
34
|
-
raise "Couldnt find a Couch instance running at #{@couch_url}"
|
|
35
|
-
end
|
|
36
31
|
end
|
|
37
32
|
|
|
38
33
|
def database_url
|
|
39
|
-
|
|
34
|
+
@couch_url
|
|
40
35
|
end
|
|
41
36
|
|
|
42
37
|
def output_folder
|
|
@@ -104,7 +99,7 @@ end
|
|
|
104
99
|
|
|
105
100
|
defaults = {:cleanup => true, :verbose => false}
|
|
106
101
|
OptionParser.new do |opts|
|
|
107
|
-
opts.banner = "Usage: #{__FILE__} [path-to-shapefile] [your-geocouch-
|
|
102
|
+
opts.banner = "Usage: #{__FILE__} [path-to-shapefile] [your-geocouch-url (optional, default: http://localhost:5984/zip_filename)]"
|
|
108
103
|
opts.on("--no-cleanup", "Don't remove converted files after upload") do |v|
|
|
109
104
|
defaults[:cleanup] = false
|
|
110
105
|
end
|
|
@@ -122,6 +117,6 @@ raise "You must specify a .shp or a .zip" unless extension =~ /zip|shp/i
|
|
|
122
117
|
name = ARGV[0].split('/')[-1].split('.')[0]
|
|
123
118
|
|
|
124
119
|
options = {:path => ARGV[0], :name => name.downcase, :extension => extension}.merge(defaults)
|
|
125
|
-
options[:couch_url] = ARGV[1] || "http://localhost:5984"
|
|
120
|
+
options[:couch_url] = ARGV[1] || "http://localhost:5984/#{name.downcase}"
|
|
126
121
|
|
|
127
122
|
ShapefileToGeoCouch.new(options)
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: shp2geocouch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 25
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 0.0.
|
|
9
|
+
- 3
|
|
10
|
+
version: 0.0.3
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Max Ogden
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2010-
|
|
18
|
+
date: 2010-10-23 00:00:00 -07:00
|
|
19
19
|
default_executable: shp2geocouch
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|