# File lib/geo_ruby/shp4r/shp.rb, line 33
      def initialize(file)
        #strip the shp out of the file if present

        @file_root = file.gsub(/.shp$/i,"")
        #check existence of shp, dbf and shx files       

        unless File.exists?(@file_root + ".shp") and File.exists?(@file_root + ".dbf") and File.exists?(@file_root + ".shx")
          raise MalformedShpException.new("Missing one of shp, dbf or shx for: #{@file}")
        end

        @dbf = Dbf::Reader.open(@file_root + ".dbf")
        @shx = File.open(@file_root + ".shx","rb")
        @shp = File.open(@file_root + ".shp","rb")
        read_index
      end