Skip to content

Commit

Permalink
Working lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
korczis committed Aug 18, 2014
1 parent c4b2ab2 commit fdd16f3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/esri/helpers/postgis_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ def import_shapes(shapes, _opts = load_db_config)
end

def lookup_zip
puts 'Looking up for zip'
point = 'POINT(-122.4246 37.80145)'
table = 'gis_esri_zip_poly'
where = "st_contains(geom, ST_GeomFromText('#{point}'))"
query = "SELECT zip FROM #{table} WHERE #{where}"
cmd = "echo \"#{query}\" | #{PSQL_CMD}"
system cmd
end
end
end
Expand Down

0 comments on commit fdd16f3

Please sign in to comment.