Skip to content

Commit

Permalink
Add specific test for ogr2ogr lat/lon detection #4730
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafa de la Torre committed Sep 4, 2015
1 parent fca6a81 commit 14ab4cf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/requests/api/imports_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@
import_table.should have_required_indexes_and_triggers
end

it 'detects lat/long columns and produces a the_geom column from them' do
post api_v1_imports_create_url,
params.merge(:filename => upload_file('spec/support/data/csv_with_lat_lon.csv', 'application/octet-stream'))
@table_from_import = UserTable.all.last.service

@table_from_import.geometry_types.should == ["ST_Point"]
@table_from_import.record(1)[:the_geom].should == '{"type":"Point","coordinates":[16.5607329,48.1199611]}'
end

it 'duplicates a table without geometries' do
post api_v1_imports_create_url,
params.merge(:filename => upload_file('spec/support/data/csv_with_number_columns.csv', 'application/octet-stream'))
Expand Down

0 comments on commit 14ab4cf

Please sign in to comment.