census_shapes 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module CensusShapes
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -136,6 +136,7 @@ namespace :census_shapes do
136
136
  if !File.exist?("#{local_path}#{shape}/#{file}.zip")
137
137
  `mkdir -p #{local_path}#{shape}`
138
138
  ftp = Net::FTP.new(CENSUS_HOST)
139
+ ftp.passive = true
139
140
  ftp.login(user = "anonymous")
140
141
  ftp.chdir(path)
141
142
  ftp.getbinaryfile("#{file}.zip", "#{local_path}#{shape}/#{file}.zip")
@@ -148,7 +149,7 @@ namespace :census_shapes do
148
149
  end
149
150
 
150
151
  def self.import_shapefiles(file, shape, archive)
151
- `shp2pgsql -W Latin1 -g geom -a -D #{local_path}#{shape}/#{file}/#{file} CONTROLLER_NAME #{TEMPLATE} | psql -h #{HOST} -U #{USER} -d #{DB}`
152
+ `shp2pgsql -W Latin1 -g geom -s 4326 -a -D #{local_path}#{shape}/#{file}/#{file} CONTROLLER_NAME #{TEMPLATE} | psql -h #{HOST} -U #{USER} -d #{DB}`
152
153
  `rm -rf #{local_path}#{shape}/#{file}`
153
154
  if archive.nil?
154
155
  `rm #{local_path}#{shape}/#{file}.zip`
@@ -164,4 +165,4 @@ namespace :census_shapes do
164
165
  ActiveRecord::Base.connection.execute("UPDATE CONTROLLER_NAME SET latlng = ST_GeomFromText('POINT(' || intptlon10 || ' ' || intptlat10 || ')', 4326) WHERE latlng IS NULL;")
165
166
  ActiveRecord::Base.connection.execute("UPDATE CONTROLLER_NAME SET name10 = namelsad10 WHERE namelsad10 IS NOT NULL AND name10 IS NULL;")
166
167
  end
167
- end
168
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: census_shapes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-19 00:00:00.000000000 Z
12
+ date: 2013-09-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -147,3 +147,4 @@ specification_version: 3
147
147
  summary: A Ruby Gem for importing US Census Shapes into PostGIS
148
148
  test_files:
149
149
  - spec/spec_helper.rb
150
+ has_rdoc: