Changeset 2061

Show
Ignore:
Timestamp:
11/27/07 20:00:18 (12 months ago)
Author:
gyuque
Message:

lang/ruby/RubyESRIShape: updated test script and data

Location:
lang/ruby/RubyESRIShape/test/shape-test
Files:
3 added
1 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/RubyESRIShape/test/shape-test/test.rb

    r2026 r2061  
    22include RubyESRIShape 
    33 
    4 s = Shape.new("bnda_1_1") 
     4if (ARGV[2] == nil) 
     5        STDERR.puts "specify <shape_name> and <start> and <count>" 
     6        exit 
     7end 
     8 
     9$shape_name = ARGV[0] 
     10$out_start  = ARGV[1].to_i 
     11$out_count  = ARGV[2].to_i 
     12 
     13s = Shape.new($shape_name) 
    514 
    615json_records = [] 
    716STDERR.puts "#{s.length} records" 
    817s.each{|record_index, record| 
    9 #       next if record_index < 2501 
    10 #       break if record_index > 3500 
     18        next if record_index < $out_start 
     19        break if record_index >= ($out_start + $out_count) 
    1120 
    1221        STDERR.puts "record ##{record_index}: #{record.length} parts" 
     
    2332} 
    2433 
    25 puts "add_shape_data([" 
     34puts "add_shape_data(\"#{$shape_name}\", [" 
    2635puts json_records.join(',') 
    2736puts "]); Ten.JSONP.callback(null);"